'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.
报这个错误:
app_name = ‘booktest’ #需要在前面加上一句这个
urlpatterns = [
url(r’^index1$’,views.index,name=‘index’),]
urlpatterns = [
path(‘admin/’, admin.site.urls),
url(r’^’,include(‘booktest.urls’,namespace=‘booktest’)),
]