o 3a @stdZddlmZddlmZddlmZddlmZm Z m Z m Z m Z d dd Z dd d Zeee d Zeee d ZdS)zFunctions for use in URLsconfs.)partial) import_module)ImproperlyConfigured)LocalePrefixPattern RegexPattern RoutePattern URLPattern URLResolverNcCsd}t|tr#z|\}}Wnty"|rtdtdt|w|}t|tr.t|}t|d|}t|d|}|rB|sBtd|pE|}t|ttfra|D]}t|dd}t|t r`tdqO|||fS)NzMCannot override the namespace for a dynamic module that provides a namespace.zPassing a %d-tuple to include() is not supported. Pass a 2-tuple containing the list of patterns and app_name, and provide the namespace argument to include() instead. urlpatternsapp_namezSpecifying a namespace in include() without providing an app_name is not supported. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.patternz:Using i18n_patterns in an included URLconf is not allowed.) isinstancetuple ValueErrorrlenstrrgetattrlistr)arg namespacer urlconf_modulepatterns url_patternr r2/usr/lib/python3/dist-packages/django/urls/conf.pyinclude sD         rc Csbt|ttfr||dd}|\}}}t|||||dSt|r-|||dd}t||||Std)NF) is_endpoint)r rT)namerzAview must be a callable or a list/tuple in the case of include().)rrrr callabler TypeError) routeviewkwargsrPatternr rr rrrr_path9s  r%)r$)N)NNN)__doc__ functoolsr importlibrdjango.core.exceptionsr resolversrrrr r rr%pathre_pathrrrrs     -