ó
lÁìVc           @   s÷   d  Z  d d l Z d d l Z d d l 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 d l m Z d Z d	 e f d
 „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ d e f d „  ƒ  YZ e ƒ  Z d S(   sù   
Settings and configuration for Django.

Values will be read from the module specified by the DJANGO_SETTINGS_MODULE environment
variable, and then from django.conf.global_settings; see the global settings file for
a list of all possible variables.
iÿÿÿÿN(   t   global_settings(   t   ImproperlyConfigured(   t   RemovedInDjango110Warning(   t
   LazyObjectt   empty(   t   sixt   DJANGO_SETTINGS_MODULEt   LazySettingsc           B   s>   e  Z d  Z d d „ Z d „  Z e d „ Z e d „  ƒ Z	 RS(   sì   
    A lazy proxy for either global Django settings or a custom settings object.
    The user can manually configure settings prior to using them. Otherwise,
    Django uses the settings module pointed to by DJANGO_SETTINGS_MODULE.
    c         C   sZ   t  j j t ƒ } | sG | r( d | n d } t d | t f ƒ ‚ n  t | ƒ |  _ d S(   sÜ   
        Load the settings module pointed to by the environment variable. This
        is used the first time we need any settings at all, if the user has not
        previously configured the settings manually.
        s
   setting %st   settingss™   Requested %s, but settings are not configured. You must either define the environment variable %s or call settings.configure() before accessing settings.N(   t   ost   environt   gett   ENVIRONMENT_VARIABLER   t   Settingst   _wrapped(   t   selft   namet   settings_modulet   desc(    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyt   _setup   s    c         C   s/   |  j  t k r |  j | ƒ n  t |  j  | ƒ S(   N(   R   R   R   t   getattr(   R   R   (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyt   __getattr__.   s    c         K   sd   |  j  t k	 r t d ƒ ‚ n  t | ƒ } x* | j ƒ  D] \ } } t | | | ƒ q7 W| |  _  d S(   sÜ   
        Called to manually configure the settings. The 'default_settings'
        parameter sets where to retrieve any unspecified values from (its
        argument must support attribute access (__getattr__)).
        s   Settings already configured.N(   R   R   t   RuntimeErrort   UserSettingsHoldert   itemst   setattr(   R   t   default_settingst   optionst   holderR   t   value(    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyt	   configure3   s    c         C   s   |  j  t k	 S(   sL   
        Returns True if the settings have already been configured.
        (   R   R   (   R   (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyt
   configured@   s    N(
   t   __name__t
   __module__t   __doc__t   NoneR   R   R    R   t   propertyR   (    (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyR      s
   	t   BaseSettingsc           B   s   e  Z d  Z d „  Z RS(   sK   
    Common logic for settings whether set by a module or by the user.
    c         C   sL   | d k r5 | r5 | j  d ƒ r5 t d | ƒ ‚ n  t j |  | | ƒ d  S(   Nt	   MEDIA_URLt
   STATIC_URLt   /s    If set, %s must end with a slash(   s	   MEDIA_URLs
   STATIC_URL(   t   endswithR   t   objectt   __setattr__(   R   R   R   (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyR+   L   s    "(   R    R!   R"   R+   (    (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyR%   H   s   R   c           B   s   e  Z d  „  Z d „  Z RS(   c         C   sÐ  x< t  t ƒ D]. } | j ƒ  r t |  | t t | ƒ ƒ q q W| |  _ t j |  j ƒ } d } t ƒ  |  _	 xƒ t  | ƒ D]u } | j ƒ  ry t | | ƒ } | | k rË t
 | t j ƒ rË t d | ƒ ‚ n  t |  | | ƒ |  j	 j | ƒ qy qy W|  j s
t d ƒ ‚ n  d |  j k r;d |  j k r;t j d	 t ƒ n  t t d
 ƒ rÌ|  j rÌd } t j j | ƒ r¯t j j t j j | |  j j d ƒ Œ ƒ r¯t d |  j ƒ ‚ n  |  j t j d <t j ƒ  n  d  S(   Nt   ALLOWED_INCLUDE_ROOTSt   INSTALLED_APPSt   TEMPLATE_DIRSt   LOCALE_PATHSs9   The %s setting must be a tuple. Please fix your settings.s)   The SECRET_KEY setting must not be empty.s7   django.contrib.auth.middleware.AuthenticationMiddlewares>   django.contrib.auth.middleware.SessionAuthenticationMiddlewares	  Session verification will become mandatory in Django 1.10. Please add 'django.contrib.auth.middleware.SessionAuthenticationMiddleware' to your MIDDLEWARE_CLASSES setting when you are ready to opt-in after reading the upgrade considerations in the 1.8 release notes.t   tzsets   /usr/share/zoneinfoR(   s   Incorrect timezone setting: %st   TZ(   R,   s   INSTALLED_APPSs   TEMPLATE_DIRSs   LOCALE_PATHS(   t   dirR    t   isupperR   R   t   SETTINGS_MODULEt	   importlibt   import_modulet   sett   _explicit_settingst
   isinstanceR   t   string_typesR   t   addt
   SECRET_KEYt   MIDDLEWARE_CLASSESt   warningst   warnR   t   hasattrt   timet	   TIME_ZONER	   t   patht   existst   joint   splitt
   ValueErrorR
   R0   (   R   R   t   settingt   modt   tuple_settingst   setting_valuet   zoneinfo_root(    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyt   __init__S   sB     	   	
.c         C   s   | |  j  k S(   N(   R8   (   R   RH   (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyt   is_overridden‰   s    (   R    R!   RM   RN   (    (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyR   R   s   	6R   c           B   sJ   e  Z d  Z d Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 RS(   s.   
    Holder for user configured settings.
    c         C   s   t  ƒ  |  j d <| |  _ d S(   s›   
        Requests for configuration variables not in this class are satisfied
        from the module specified in default_settings (if possible).
        t   _deletedN(   R7   t   __dict__R   (   R   R   (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyRM   •   s    c         C   s(   | |  j  k r t ‚ n  t |  j | ƒ S(   N(   RO   t   AttributeErrorR   R   (   R   R   (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyR      s    	c         C   s-   |  j  j | ƒ t t |  ƒ j | | ƒ d  S(   N(   RO   t   discardt   superR   R+   (   R   R   R   (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyR+   ¢   s    c         C   s<   |  j  j | ƒ t |  | ƒ r8 t t |  ƒ j | ƒ n  d  S(   N(   RO   R;   R@   RS   R   t   __delattr__(   R   R   (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyRT   ¦   s    c         C   s   t  |  j ƒ t |  j ƒ S(   N(   t   listRP   R2   R   (   R   (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyt   __dir__«   s    c         C   sL   | |  j  k } | |  j k } t |  j d d „  ƒ | ƒ } | pK | pK | S(   NRN   c         S   s   t  S(   N(   t   False(   t   s(    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyt   <lambda>±   s    (   RO   RP   R   R   (   R   RH   t   deletedt   set_locallyt   set_on_default(    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyRN   ®   s    N(   R    R!   R"   R#   R4   RM   R   R+   RT   RV   RN   (    (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyR      s   					(   R"   R5   R	   RA   R>   t   django.confR    t   django.core.exceptionsR   t   django.utils.deprecationR   t   django.utils.functionalR   R   t   django.utilsR   R   R   R*   R%   R   R   R   (    (    (    sb   /opt/seafile/seafile-server-5.1.3/seahub/thirdpart/Django-1.8.10-py2.7.egg/django/conf/__init__.pyt   <module>   s   1
;'