I have tried using https://docs.djangoproject.com/en/dev/topics/http/views/ tutorial, but still I am getting the standard 404 html page. I want to switch in to my custom view
handler404 = 'myview.views.custom_page_not_found' ,
I did debug it (using eclipse), then the value of handler404(old value -'django.config.default.views.page_not_found
) is changed to the new value I have given ('myview.views.custom_page_not_found'). But it's still showing the older 404 page. And I have changed settings.py DEBUG into False then it shows the custom page. But it got some disadvantages (it won't load static files and all, DEBUG = false
is not the right way) so I had to reset to True.
Do I have to make some other modification for implementing this?
I think you can not change the 404 page in DEBUG = True
mode without difficulty.
There is a hint in the documentation (https://docs.djangoproject.com/en/dev/topics/http/views/#the-404-page-not-found-view):
If DEBUG is set to True (in your settings module), then your 404 view will never be used, and your URLconf will be displayed instead, with some debug information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With