How to display custom 404.html page in Django

后端 未结 1 942
误落风尘
误落风尘 2021-02-11 03:40

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:42

    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)
提交回复
热议问题