在使用url的时候,有些地方是这样写的:

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

  但是会报错:

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

只需要换种写法即可:

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

  

相关文章:

  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2021-09-06
  • 2022-12-23
  • 2022-12-23
  • 2022-01-26
猜你喜欢
  • 2022-12-23
  • 2022-02-06
  • 2021-04-21
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2021-08-24
相关资源
相似解决方案