Not seeing my custom 404 page

I am trying to set up a custom 404 page but it is not working and I am seeing the Django 404 page and not my own.

debug is set to false
allowed hosts are set to *

main urls file the path ’ ’ includes app ‘pages’ urls.py file

the pages.urls.py file:

urlpatterns = [
    path('', views.homepage, name="home"),
]

handler404 = views.handler404
handler500 = views.handler500

the pages.views.py file:

from django.shortcuts import render

def homepage(request, *args, **kwargs):
    return render(request, "pages/home.html", context={'class': 'homepage'}, status=200)

def handler404(request, exception=None):
    return render(request, 'pages/404.html')

if I go to any path besides the root, which is the only path in the urls file then I do not see my custom 404 page and only the default Django 404 page. What am I doing wrong pls?

Your handler setting should be in the root urls.py file, not a subordinate urls.py file.

See URL dispatcher | Django documentation | Django

Thank you very much Ken solved my issue

I am trying to set up a custom 404 page too, is this all the code you wrote for implementing it?