为了账号安全,请及时绑定邮箱和手机立即绑定

较前一小节更改url运行报错

url('blog/', include('blog.urls',namespace='blog')),

报错如下:

File "D:\Django_test\myblog\myblog\urls.py", line 7, in <module>

    url('blog/', include('blog.urls',namespace='blog')),    # 设置超链接

  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.

其中报错主要信息如第二行;希望能够得到回复,谢谢?


正在回答

1 回答

版本不同 django在3.x中url变为

re_path


0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
django入门与实践
  • 参与学习       65212    人
  • 解答问题       868    个

手把手带你进入Django开发的大门,充分领略Django的魅力

进入课程

较前一小节更改url运行报错

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信