【Day-02】解决Specifying a namespace in include()withou providing an app_name

 '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.
Performing system checks...

python3 Django 环境下,如果你遇到在根目录下urls.py中的include方法的第二个参数namespace添加之后就出错的问题。请在[app_name]目录下的urls.py中的urlpatterns前面加上app_name='[app_name]', [app_name]代表你的应用的名称。
例如:app_name ='[blog]'
 

被困30min

猜你喜欢

转载自blog.csdn.net/qq_41856814/article/details/89011073