File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/django/views/__pycache__/defaults.cpython-310.pyc
Back
o �hK � @ s� d dl mZ d dlmZmZmZmZ d dlmZm Z m Z mZ d dlm Z dZdZdZdZd Ze efd d��Ze efdd ��Ze efdd��Ze efdd��ZdS )� )�quote)�HttpResponseBadRequest�HttpResponseForbidden�HttpResponseNotFound�HttpResponseServerError)�Context�Engine�TemplateDoesNotExist�loader)�requires_csrf_tokenz404.htmlz403.htmlz400.htmlz500.htmlz� <!doctype html> <html lang="en"> <head> <title>%(title)s</title> </head> <body> <h1>%(title)s</h1><p>%(details)s</p> </body> </html> c C s� |j j}z|jd }W n ttfy Y nw t|t�r|}t| j�|d�}zt � |�}|�|| �}W t|�S tyY |t krB� t� �tddd� �}|�t|��}Y t|�S w )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� exceptionz Not Foundz4The requested resource was not found on this server.��title�details)� __class__�__name__�args�AttributeError� IndexError� isinstance�strr �pathr �get_template�renderr �ERROR_404_TEMPLATE_NAMEr �from_string�ERROR_PAGE_TEMPLATEr r )�requestr � template_name�exception_repr�message�context�template�body� r% �K/usr/local/CyberPanel/lib/python3.10/site-packages/django/views/defaults.py�page_not_found"