How to setup the template for 404 error in django
I want to do whatever is written here
Ensure that your 404 template works
Note that the FlatpageFallbackMiddleware only steps in once another view has successfully produced a 404 response. If another view or middleware class attempts to produce a 404 but ends up raising an exception instead (such as a TemplateDoesNot开发者_Python百科Exist exception if your site does not have an appropriate template to use for HTTP 404 responses), the response will become an HTTP 500 (“Internal Server Error”) and the FlatpageFallbackMiddleware will not attempt to serve a flat page.
Can anyone tell me what thing i need to do for making the 404 template
Follow the advice in the tutorial on setting up 404 handling.
In particular, presuming you are not going to write your own 404 view, this advice is important:
If
DEBUG
is set toFalse
(in your settings module) and if you didn't create a404.html
file, anHttp500
is raised instead. So remember to create a404.html
.
精彩评论