Django Book 翻译
菜单>:
TOC
返回
原文:
Returning HTTP error codes in Django is easy. Weve already mentioned the ``HttpResponseNotFound`` , ``HttpResponseForbidden`` , ``HttpResponseServerError`` , and other subclasses. Just return an instance of one of those subclasses instead of a normal ``HttpResponse`` in order to signify an error, for example:
翻译:
在Django中返回HTTP错误代码很容易。我们前面已经提到 ``HttpResponseNotFound`` , ``HttpResponseForbidden`` , ``HttpResponseServerError`` ,和其它子类。为了更好地表示一个错误,只要返回这些子类之一的一个实例,而不是一个通常的 ``HttpResponse`` ,例如:
备注:
译者: