How to display custom 404.html page in Django

后端 未结 1 568
慢半拍i
慢半拍i 2021-02-11 03:06

I want to display a custom 404 error page when an end user enters a wrong url. I have tried but I am only getting the Django default 404 page. I am using Python 2.7.5 and Django

相关标签:
1条回答
  • 2021-02-11 03:52

    Custom URL handlers don't work with DEBUG=True. Set DEBUG=False and it will work. (You'll also need to set ALLOWED_HOSTS=['127.0.0.1'])

    0 讨论(0)
提交回复
热议问题