开发环境:python36,Django2.2
问题描述:
'Specifying a namespace in include() without providing an a
pp_name '
django.core.exceptions.ImproperlyConfigured: Specifying a names
pace in include() without providing an app_name is not supporte
d. Set the app_name attribute in the included module, or pass a
2-tuple containing the list of patterns and app_name instead.
解决方法:
1、保留在根目录下urls.py中的include方法的第二个参数namespace=‘app_name’;
2、请在[app_name]目录下的urls.py中的urlpatterns前面加上app_name=’app_name’, app_name代表你的应用的名称。