运行的时候报错了
我将prcharm重新安装了一下换了一个安装目录
ERRORS:
?: (urls.E004) Your URL pattern " # 地址列表\n url(r'^user/address/list/$', views.address_list, name='address_list'),\n # 地址的修改和编辑\n # user/address/edit/add/ user/ad
dress/edit/12/\n url(r'^user/address/edit/(?P<pk>\\S+)/$', views.address_edit, name='address_edit'),\n url(r'^user/address/delete/(?P<pk>\\d+)/$', views.address_delete, name='add
ress_delete')," is invalid. Ensure that urlpatterns is a list of url() instances.
HINT: Try removing the string ' # 地址列表
url(r'^user/address/list/$', views.address_list, name='address_list'),
# 地址的修改和编辑
# user/address/edit/add/ user/address/edit/12/
url(r'^user/address/edit/(?P<pk>\S+)/$', views.address_edit, name='address_edit'),
url(r'^user/address/delete/(?P<pk>\d+)/$', views.address_delete, name='address_delete'),'. The list of urlpatterns should not have a prefix string as the first element.
accounts.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for 'User.groups' or 'User.groups'.
accounts.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'User.user_permissions'.
auth.User.groups: (fields.E304) Reverse accessor for 'User.groups' clashes with reverse accessor for 'User.groups'.
HINT: Add or change a related_name argument to the definition for 'User.groups' or 'User.groups'.
auth.User.user_permissions: (fields.E304) Reverse accessor for 'User.user_permissions' clashes with reverse accessor for 'User.user_permissions'.
HINT: Add or change a related_name argument to the definition for 'User.user_permissions' or 'User.user_permissions'.
System check identified 5 issues (0 silenced).
正在回答 回答被采纳积分+1
1、看下报错的url 所在位置,将urlpatterns=[]改为urlpatterns=()例如:
2、检查数据库是否连接正确,删处数据库中的表,每个模块中的migrations文件夹的文件都删除只留下__init__.py(注意:每个模块的migrations文件夹都只留下__init__.py其余删除)
3、重新迁移数据库
python manage.py makemigrations
python manage.py migrate
4、重新启动项目
python manage.py runserver
如果我的回答解决了你的疑惑,请采纳,祝学习愉快~
- 参与学习 人
- 提交作业 218 份
- 解答问题 3562 个
本阶段带你用Python开发一个网站,学习主流框架Django+Flask是Python Web开发的第一步,在基础知识上实现积分商城的项目开发,体验真实的项目开发流程,提高解决编程问题和效率的能力。
了解课程
恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星