在配置路由时,include方法只传应用的url模块时是能正常运行的
Django配置路由使用include()方法时出现'Specifying a namespace in include() without providing an app_name'的解决方法
但是当想要反向解析,使用namespace参数时,却出现了“ '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. Se
t the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.
”这样的报错。
Django配置路由使用include()方法时出现'Specifying a namespace in include() without providing an app_name'的解决方法
从报错信息能看出是缺少一个app_name的参数,从源码知道如果想要使用namespace,那么第一个参数应该传个数组(urlconf_module, app_name)
Django配置路由使用include()方法时出现'Specifying a namespace in include() without providing an app_name'的解决方法
正确修改传参就能解决问题了
Django配置路由使用include()方法时出现'Specifying a namespace in include() without providing an app_name'的解决方法
Django配置路由使用include()方法时出现'Specifying a namespace in include() without providing an app_name'的解决方法

相关文章:

  • 2021-08-24
  • 2022-12-23
  • 2018-08-27
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-20
  • 2022-02-06
  • 2021-04-21
  • 2022-12-23
  • 2021-06-10
相关资源
相似解决方案