Estou com problemas a função include, de acordo com a documentação do django, a sintaxe é include(module, namespace=None)
,
include(pattern_list)
,include((pattern_list, app_namespace), namespace=None)
.
Código fonte
from django.contrib import admin
from django.urls import path, include
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path('admin/', admin.site.urls),
path('clientes/', include("cliente.urls", namespace="cliente")),
]
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Erro
path('clientes/', include("cliente.urls", namespace="cliente")),
File "/home/phomint/DjangoProjects/Manager/myvenv/lib/python3.5/site-packages/django/urls/conf.py", line 39, in include
'Specifying a namespace in include() without providing an app_name '
django.core.exceptions.ImproperlyConfigured:
Specifying 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.