ó
Žâ0_c           @  sŤ   d  Z  d d l m Z d d l Z d d l m Z d d l m Z d d l m	 Z	 d d l
 m Z m Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d S(   uR  
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.

These are referenced from the 'context_processors' option of the configuration
of a DjangoTemplates backend and used by RequestContext.
i˙˙˙˙(   t   unicode_literalsN(   t   settings(   t	   get_token(   t
   force_text(   t   SimpleLazyObjectt   lazyc           s      f d   } i t  |  d 6S(   u    
    Context processor that provides a CSRF token, or the string 'NOTPROVIDED' if
    it has not been provided by either a view decorator or the middleware
    c            s*   t     }  |  d  k r d St |   Sd  S(   Nu   NOTPROVIDED(   R   t   NoneR   (   t   token(   t   request(    sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyt   _get_val   s    u
   csrf_token(   R   (   R   R	   (    (   R   sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyt   csrf   s    
c           sg   i  } t  j rc |  j j d  t  j k rc t | d <d d l m   t   f d   t	  | d <n  | S(   u:   
    Returns context variables helpful for debugging.
    u   REMOTE_ADDRu   debugi˙˙˙˙(   t   connectionsc            s-   t  t j g    D] }    |  j ^ q    S(   N(   t   listt	   itertoolst   chaint   queries(   t   x(   R   (    sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyt   <lambda>1   t    u   sql_queries(
   R   t   DEBUGt   METAt   gett   INTERNAL_IPSt   Truet	   django.dbR   R   R   (   R   t   context_extras(    (   R   sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyt   debug&   s    $
c         C  s8   d d l  m } i t j d 6| j   d 6| j   d 6S(   Ni˙˙˙˙(   t   translationu	   LANGUAGESu   LANGUAGE_CODEu   LANGUAGE_BIDI(   t   django.utilsR   R   t	   LANGUAGESt   get_languaget   get_language_bidi(   R   R   (    (    sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyt   i18n7   s
    
c         C  s!   d d l  m } i | j   d 6S(   Ni˙˙˙˙(   t   timezoneu	   TIME_ZONE(   R   R!   t   get_current_timezone_name(   R   R!   (    (    sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyt   tz@   s    c         C  s   i t  j d 6S(   u?   
    Adds static-related context variables to the context.
    u
   STATIC_URL(   R   t
   STATIC_URL(   R   (    (    sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyt   staticE   s    c         C  s   i t  j d 6S(   u>   
    Adds media-related context variables to the context.
    u	   MEDIA_URL(   R   t	   MEDIA_URL(   R   (    (    sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyt   mediaL   s    c         C  s   i |  d 6S(   Nu   request(    (   R   (    (    sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyR   S   s    (   t   __doc__t
   __future__R    R   t   django.confR   t   django.middleware.csrfR   t   django.utils.encodingR   t   django.utils.functionalR   R   R
   R   R    R#   R%   R'   R   (    (    (    sD   /tmp/pip-unpacked-wheel-BAJOf3/django/template/context_processors.pyt   <module>   s   							