This is my settings.py:
DEBUG = False
ALLOWED_HOSTS = ['localhost', '127.0.0.1']
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
main urls.py:
handler404 = 'home.views.custom_page_not_found_view'
my views for 404 page:
def custom_page_not_found_view(request, exception):
return render(request, "404.html", {}, status=404)
i tryed this solution:(Correct way of implementing custom 404 page in Django 3 in production) but it doesn't work and kept getting server 500 error responses
how do i fix this?