a
    [f                     @   s   d dl Z d dlmZ ddlmZmZmZmZ edddZedd	dZ	d
d Z
eejdddd Zeejdddd Zeejdd ZdS )    N)settings   )ErrorTagsWarningregistera  You don't appear to be using Django's built-in cross-site request forgery protection via the middleware ('django.middleware.csrf.CsrfViewMiddleware' is not in your MIDDLEWARE). Enabling the middleware is the safest approach to ensure you don't leave any holes.zsecurity.W003idzYou have 'django.middleware.csrf.CsrfViewMiddleware' in your MIDDLEWARE, but you have not set CSRF_COOKIE_SECURE to True. Using a secure-only CSRF cookie makes it more difficult for network traffic sniffers to steal the CSRF token.zsecurity.W016c                   C   s
   dt jv S )Nz)django.middleware.csrf.CsrfViewMiddleware)r   Z
MIDDLEWARE r
   r
   rC:\Users\91910\OneDrive\Desktop\vts_admin_rebuild-master\vts\Lib\site-packages\django/core/checks/security/csrf.py_csrf_middleware   s    r   T)Zdeployc                 K   s   t  }|rg S tgS )N)r   W003app_configskwargsZpassed_checkr
   r
   r   check_csrf_middleware   s    r   c                 K   s&   t jpt  pt jdu }|r g S tgS )NT)r   ZCSRF_USE_SESSIONSr   ZCSRF_COOKIE_SECUREW016r   r
   r
   r   check_csrf_cookie_secure#   s    r   c              	   K   s   ddl m} g }z
| }W n. tyH   dtj }|t|dd Y nJ0 zt|j	d d d W n. t
y   dtj }|t|dd Y n0 |S )	Nr   )_get_failure_viewz1The CSRF failure view '%s' could not be imported.zsecurity.E102r   )reasonzIThe CSRF failure view '%s' does not take the correct number of arguments.zsecurity.E101)Zdjango.middleware.csrfr   ImportErrorr   ZCSRF_FAILURE_VIEWappendr   inspect	signaturebind	TypeError)r   r   r   errorsviewmsgr
   r
   r   check_csrf_failure_view-   s&    
r   )r   Zdjango.confr    r   r   r   r   r   r   r   securityr   r   r   r
   r
   r
   r   <module>   s"   		

	