o
    þÞha  ã                   @   sr   d dl mZ d dlmZ d dlmZ d dlmZmZm	Z	m
Z
 d dlmZ d dlmZ dZdd	„ Zd
efdd„ZdS )é    )ÚPath)Úsettings)ÚHttpResponseForbidden)ÚContextÚEngineÚTemplateDoesNotExistÚloader)Úgettext)Úget_docs_versionz403_csrf.htmlc                 C   s   t tƒjd |  S )z½
    Return a path to a builtin template.

    Avoid calling this function at the module level or in a class-definition
    because __file__ may not exist, e.g. in frozen environments.
    Ú	templates)r   Ú__file__Úparent)Úname© r   úQ/var/www/html/premium_crap/venv/lib/python3.10/site-packages/django/views/csrf.pyÚbuiltin_template_path   s   r   Ú c           	      C   sð   ddl m}m} tdƒtdƒ|||ktdƒtdƒtdƒ||ktdƒtd	ƒtjtƒ td
ƒdœ}zt |¡}|j	| d�}W t|ƒS  t
yw   |tkrqtdƒjdd��}tƒ  | ¡ ¡}W d  ƒ n1 sdw   Y  | 	t|ƒ¡}n‚ Y t|ƒS w )z>
    Default view used when request fails CSRF protection
    r   )ÚREASON_NO_CSRF_COOKIEÚREASON_NO_REFERERÚ	Forbiddenz*CSRF verification failed. Request aborted.uø   You are seeing this message because this HTTPS site requires a â€œReferer headerâ€� to be sent by your web browser, but none was sent. This header is required for security reasons, to ensure that your browser is not being hijacked by third parties.u±   If you have configured your browser to disable â€œRefererâ€� headers, please re-enable them, at least for this site, or for HTTPS connections, or for â€œsame-originâ€� requests.u^  If you are using the <meta name="referrer" content="no-referrer"> tag or including the â€œReferrer-Policy: no-referrerâ€� header, please remove them. The CSRF protection requires the â€œRefererâ€� header to do strict referer checking. If youâ€™re concerned about privacy, use alternatives like <a rel="noreferrer" â€¦> for links to third-party sites.zÍYou are seeing this message because this site requires a CSRF cookie when submitting forms. This cookie is required for security reasons, to ensure that your browser is not being hijacked by third parties.u‰   If you have configured your browser to disable cookies, please re-enable them, at least for this site, or for â€œsame-originâ€� requests.z.More information is available with DEBUG=True.)ÚtitleÚmainÚreasonÚ
no_refererÚno_referer1Úno_referer2Úno_referer3Ú	no_cookieÚ
no_cookie1Ú
no_cookie2ÚDEBUGÚdocs_versionÚmore)Úrequestzcsrf_403.htmlzutf-8)ÚencodingN)Údjango.middleware.csrfr   r   Ú_r   r    r
   r   Úget_templateÚrenderr   ÚCSRF_FAILURE_TEMPLATE_NAMEr   Úopenr   Úfrom_stringÚreadr   r   )	r#   r   Útemplate_namer   r   ÚcÚtÚbodyÚfhr   r   r   Úcsrf_failure   sN   ÿÿÿÿÿÚ(

÷ÿý÷r2   N)Úpathlibr   Údjango.confr   Údjango.httpr   Údjango.templater   r   r   r   Údjango.utils.translationr	   r&   Údjango.utils.versionr
   r)   r   r2   r   r   r   r   Ú<module>   s    
