Django Book 翻译
菜单>:
TOC
返回
原文:
For convenience, and because its a good idea to have a consistent 404 error page across your site, Django provides an ``Http404`` exception. If you raise ``Http404`` at any point in a view function, Django will catch it and return the standard error page for your application, along with an HTTP error code 404.
翻译:
为了方便,而且定义一个通用的应用于网站的404错误页面也是一个很好的选择,Django提供了一个 ``Http404`` 异常。如果在视图的任何地方引发 ``Http404`` 异常,Django就会捕获错误并返回应用程序的标准错误页面,当然,还有HTTP错误代码404。
备注:
译者: