î

_ÝVð  ã               @   sØ   d  d l  Z  d  d l m Z d  d l m Z d  d l m Z m Z m Z d  d l	 m
 Z
 d  d l m Z m Z d d d	 d
 d d d g Z d Z d Z d Z d Z d d d d „ Z d d „  Z d d d d d „ Z d S)é    N)Úimport_module)ÚImproperlyConfigured)ÚLocaleRegexURLResolverÚRegexURLPatternÚRegexURLResolver)Úsix)ÚRemovedInDjango20WarningÚRemovedInDjango110WarningÚ
handler400Ú
handler403Ú
handler404Ú
handler500ÚincludeÚpatternsÚurlz!django.views.defaults.bad_requestz'django.views.defaults.permission_deniedz$django.views.defaults.page_not_foundz"django.views.defaults.server_errorc             C   s}  | r | r t  d ƒ ‚ n  | r; t j d t d d ƒn  t |  t ƒ r¬ y |  \ } } Wq² t  k
 r¨ | r t d ƒ ‚ n  t j d t d d ƒ|  \ } } } Yq² Xn |  } t | t j ƒ rÓ t	 | ƒ } n  t
 | d | ƒ } t
 | d | ƒ } | r| rt j d	 t d d ƒn  | p&| } t | t t f ƒ rpx/ | D]$ } t | t ƒ rEt d
 ƒ ‚ qEqEWn  | | | f S)Nz0Must specify a namespace if specifying app_name.ztThe app_name argument to django.conf.urls.include() is deprecated. Set the app_name in the included URLconf instead.Ú
stacklevelé   zLCannot override the namespace for a dynamic module that provides a namespacez´Passing a 3-tuple to django.conf.urls.include() is deprecated. Pass a 2-tuple containing the list of patterns and app_name, and provide the namespace argument to include() instead.ZurlpatternsÚapp_namezÜSpecifying a namespace in django.conf.urls.include() without providing an app_name is deprecated. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.z:Using i18n_patterns in an included URLconf is not allowed.)Ú
ValueErrorÚwarningsÚwarnr   Ú
isinstanceÚtupler   r   Ústring_typesr   ÚgetattrÚlistr   )ÚargÚ	namespacer   Úurlconf_moduler   Zurl_pattern© r   ú;/tmp/pip-build-ghmbqnp_/Django/django/conf/urls/__init__.pyr      sB    c             G   s‡   t  j d t d d ƒg  } xd | D]\ } t | t t f ƒ rS t d |  | Œ } n t | t ƒ rr | j |  ƒ n  | j	 | ƒ q# W| S)NzŸdjango.conf.urls.patterns() is deprecated and will be removed in Django 1.10. Update your urlpatterns to be a list of django.conf.urls.url() instances instead.r   r   Úprefix)
r   r   r	   r   r   r   r   r   Z
add_prefixÚappend)r!   ÚargsZpattern_listÚtr   r   r    r   O   s    Ú c             C   s¶   t  | t t f ƒ r@ | \ } } } t |  | | d | d | ƒSt  | t j ƒ rŸ t j d | t d d ƒ| s… t	 d |  ƒ ‚ n  | rŸ | d | } qŸ n  t
 |  | | | ƒ Sd  S)Nr   r   z€Support for string view arguments to url() is deprecated and will be removed in Django 1.10 (got %s). Pass the callable instead.r   r   z:Empty URL pattern view name not permitted (for pattern %r)Ú.)r   r   r   r   r   r   r   r   r	   r   r   )ÚregexZviewÚkwargsÚnamer!   r   r   r   r   r   r    r   `   s    )r   Ú	importlibr   Zdjango.core.exceptionsr   Zdjango.core.urlresolversr   r   r   Zdjango.utilsr   Zdjango.utils.deprecationr   r	   Ú__all__r
   r   r   r   r   r   r   r   r   r   r    Ú<module>   s   :