遇到的错误

  1. NoReverseMatch at /
    'blog' is not a registered namespace
    解决方法:
    app应用的urls中没有添加应用名
    app_name = 'blog'
raise ImproperlyConfigured('mysqlclient 1.3.13 or newer is required; you have %s.' % Database.__version__)

解决方法:

找到Python安装路劲下的Python36-32\Lib\site-packages\django\db\backends\mysql\base.py文件 将文件中的如下代码注释 if version < (1, 3, 3): raise ImproperlyConfigured("mysqlclient 1.3.3 or newer is required; you have %s" % Database.__version__)

2.'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.'查找错误出处,为conf.py文件

解决如下:

path('order/',include('order.urls,namespace='order'),#订单模块,改为

path('order/',include(('order.urls','order'),namespace='order')),#订单模块

猜你喜欢

转载自www.cnblogs.com/venvive/p/12014334.html