ó
®â0_c           @   s©   d  d l  m Z d d l m Z m Z m Z d d l m Z e d d d ƒZ e d d d	 ƒZ	 d
 „  Z
 e e j d e ƒd „  ƒ Z e e j d e ƒd „  ƒ Z d S(   iÿÿÿÿ(   t   settingsi   (   t   Tagst   Warningt   register(   t   patch_middleware_messages  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.t   ids   security.W003sç   You 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.s   security.W016c           C   s%   d t  j k p$ t  j o$ d t  j k S(   Ns)   django.middleware.csrf.CsrfViewMiddleware(   R    t   MIDDLEWARE_CLASSESt
   MIDDLEWARE(    (    (    sB   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/csrf.pyt   _csrf_middleware   s    t   deployc         K   s    t  ƒ  } | r g  St t ƒ g S(   N(   R   R   t   W003(   t   app_configst   kwargst   passed_check(    (    sB   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/csrf.pyt   check_csrf_middleware   s    	c         K   s3   t  j p t ƒ  p t  j } | r& g  St t ƒ g S(   N(   R    t   CSRF_USE_SESSIONSR   t   CSRF_COOKIE_SECURER   t   W016(   R   R   R   (    (    sB   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/csrf.pyt   check_csrf_cookie_secure#   s    	
	N(   t   django.confR    t    R   R   R   t   utilsR   R
   R   R   t   securityt   TrueR   R   (    (    (    sB   /tmp/pip-unpacked-wheel-BAJOf3/django/core/checks/security/csrf.pyt   <module>   s   			