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’ file

the file:

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

handler404 = views.handler404
handler500 = views.handler500

the 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 file, not a subordinate 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?