Answer the question
In order to leave comments, you need to log in
Weirdness with Django 404 page?
I decided to create a custom page for errors in Django
in the settings I wrote
DEBUG = False
ALLOWED_HOSTS = ["127.0.0.1"]
from django.conf.urls import handler400, handler403, handler404, handler500
handler400 = 'blog.views.page_not_found'
handler403 = 'blog.views.page_not_found'
handler404 = 'blog.views.page_not_found'
handler500 = 'blog.views.page_not_found'
def page_not_found(request):
return render(request, '404.html')
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question