較前一小節(jié)更改url運(yùn)行報(bào)錯
url('blog/',?include('blog.urls',namespace='blog')),
報(bào)錯如下:
File "D:\Django_test\myblog\myblog\urls.py", line 7, in <module>
? ? url('blog/', include('blog.urls',namespace='blog')),? ? # 設(shè)置超鏈接
? File "D:\anaconda3\lib\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.
其中報(bào)錯主要信息如第二行;希望能夠得到回復(fù),謝謝?
2020-04-15
版本不同 django在3.x中url變?yōu)?/p>