o 3a; @ s d dl mZ d dlmZmZmZmZ d dlmZm Z m Z mZ d dlm Z dZdZdZdZd Ze efd dZe efdd Ze efddZe efddZdS ) )quote)HttpResponseBadRequestHttpResponseForbiddenHttpResponseNotFoundHttpResponseServerError)ContextEngineTemplateDoesNotExistloader)requires_csrf_tokenz404.htmlz403.htmlz400.htmlz500.htmlz
%(details)s
c C s |j j}z|jd }W n ttfy Y nw t|tr|}t| j|d}zt |}||| }d}W n" tyW |t krA t tddd }|t|}d}Y nw t||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/htmlcontent_type) __class____name__argsAttributeError IndexError isinstancestrr pathr get_templaterenderr ERROR_404_TEMPLATE_NAMEr from_stringERROR_PAGE_TEMPLATEr r ) requestr template_nameexception_reprmessagecontexttemplatebodyr r( 7/usr/lib/python3/dist-packages/django/views/defaults.pypage_not_found s8 r* c C sN zt |}W n ty |tkr ttddd dd Y S w t| S )zS 500 error handler. Templates: :template:`500.html` Context: None zServer Error (500) r r r )r r r ERROR_500_TEMPLATE_NAMEr r r )r! r" r&