
    h;                         d dl mZ d dlmZmZmZmZ d dlmZm	Z	m
Z
mZ d dlmZ dZdZdZdZd	Zeefd
       Zeefd       Zeefd       Zeefd       Zy)    )quote)HttpResponseBadRequestHttpResponseForbiddenHttpResponseNotFoundHttpResponseServerError)ContextEngineTemplateDoesNotExistloader)requires_csrf_tokenz404.htmlz403.htmlz400.htmlz500.htmlz
<!doctype html>
<html lang="en">
<head>
  <title>%(title)s</title>
</head>
<body>
  <h1>%(title)s</h1><p>%(details)s</p>
</body>
</html>
c                    |j                   j                  }	 |j                  d   }t        |t              r|}	 t        | j                        |d}	 t        j                  |      }|j                  ||       }d}t%        ||      S # t
        t        f$ r Y `w xY w# t        $ rL |t        k7  r t               j                  t         dddz        }|j                  t#        |            }d}Y vw xY 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	exceptionNz	Not Foundz4The requested resource was not found on this server.titledetails	text/htmlcontent_type)	__class____name__args
isinstancestrAttributeError
IndexErrorr   pathr   get_templaterenderr
   ERROR_404_TEMPLATE_NAMEr	   from_stringERROR_PAGE_TEMPLATEr   r   )	requestr   template_nameexception_reprmessagecontexttemplatebodyr   s	            X/var/www/html/ranktracker/api/venv/lib/python3.12/site-packages/django/views/defaults.pypage_not_foundr+      s     ((11N%..# gs#$Ngll+#G#&&}5w0  <@@7 J'    #33 8''$Q# 
 ww/0"#s$   B	 )B 	BBAC32C3c                     	 t        j                  |      }t	        |j                               S # t        $ r$ |t        k7  r t	        t
        dddz  d      cY S w xY w)zS
    500 error handler.

    Templates: :template:`500.html`
    Context: None
    zServer Error (500) r   r   r   )r   r   r
   ERROR_500_TEMPLATE_NAMEr   r"   r   )r#   r$   r(   s      r*   server_errorr/   O   sf    	
&&}5 #8??#455   
33&,@R"PP$
 	
	
   0 *AAc                     	 t        j                  |      }t	        |j                               S # t        $ r$ |t        k7  r t	        t
        dddz  d      cY S w xY w)zS
    400 error handler.

    Templates: :template:`400.html`
    Context: None
    zBad Request (400)r-   r   r   r   )r   r   r
   ERROR_400_TEMPLATE_NAMEr   r"   r   r#   r   r$   r(   s       r*   bad_requestr4   d   sf    	
&&}5 "(//"344   
33%,?B"OO$
 	
	
r0   c           	          	 t        j                  |      }t	        |j                  | dt        |      i            S # t        $ r$ |t        k7  r t	        t
        dddz  d      cY S w xY w)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-   r   r   r   r   )r#   r'   )r   r   r
   ERROR_403_TEMPLATE_NAMEr   r"   r   r   r3   s       r*   permission_deniedr7   }   sy    	
&&}5 !+s9~1NO    
33$O"KK$
 	
	
s   > *A+*A+N)urllib.parser   django.httpr   r   r   r   django.templater   r	   r
   r   django.views.decorators.csrfr   r    r6   r2   r.   r"   r+   r/   r4   r7        r*   <module>r>      s      J I <$ $ $ $ 
   5L -A -A` (? 6 6( 2I 5 50 8O  r=   