o 3a;@sddlmZddlmZmZmZmZddlmZm Z m Z m Z ddl m Z dZdZdZdZd Ze efd d Ze efd d Ze efddZe efddZdS))quote)HttpResponseBadRequestHttpResponseForbiddenHttpResponseNotFoundHttpResponseServerError)ContextEngineTemplateDoesNotExistloader)requires_csrf_tokenz404.htmlz403.htmlz400.htmlz500.htmlz %(title)s

%(title)s

%(details)s

c Cs|jj}z|jd}Wn ttfyYnwt|tr|}t|j|d}zt |}| ||}d}Wn"t yW|t krAttddd}| t|}d}Ynwt||dS) a Default 404 handler. Templates: :template:`404.html` Context: request_path The path of the requested URL (e.g., '/app/pages/bad_page/'). It's quoted to prevent a content injection attack. exception The message from the exception which triggered the 404 (if one was supplied), or the exception class name r) request_path exceptionNz Not Foundz4The requested resource was not found on this server.titledetails text/html content_type) __class____name__argsAttributeError IndexError isinstancestrrpathr get_templaterenderr ERROR_404_TEMPLATE_NAMEr from_stringERROR_PAGE_TEMPLATErr) requestr template_nameexception_reprmessagecontexttemplatebodyrr(7/usr/lib/python3/dist-packages/django/views/defaults.pypage_not_founds8     r*cCsNzt|}Wnty |tkrttdddddYSwt|S)zS 500 error handler. Templates: :template:`500.html` Context: None zServer Error (500)rrr)r rr ERROR_500_TEMPLATE_NAMErr r)r!r"r&r(r(r) server_errorOs    r-cCsNzt|}Wnty |tkrttdddddYSwt|S)zS 400 error handler. Templates: :template:`400.html` Context: None zBad Request (400)r+rrr)r rr ERROR_400_TEMPLATE_NAMErr rr!r r"r&r(r(r) bad_requestds    r0cCs\zt|}Wnty |tkrttdddddYSwt|j|dt|idS)z Permission denied (403) handler. Templates: :template:`403.html` Context: None If the template does not exist, an Http403 response containing the text "403 Forbidden" (as per RFC 7231) will be returned. z 403 Forbiddenr+rrrr )r!r%)r rr ERROR_403_TEMPLATE_NAMErr rrr/r(r(r)permission_denied}s    r2N) urllib.parser django.httprrrrdjango.templaterrr r django.views.decorators.csrfr rr1r.r,r r*r-r0r2r(r(r(r)s"  0