出现NoReverseMatch at /org/list/错误
来源:7-7 modelform提交我要学习咨询1
慕粉2224471126
2017-10-08
根据视频的操作配置:
# 课程机构配置 url(r'^org/', include('organization.urls',namespace="org")), # 课程机构列表页 url(r'^list/$', OrgView.as_view(), name="org_list"), 会显示以下错误: NoReverseMatch at /org/list/ Reverse for 'org_list' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] Request Method:GET Request URL:http://127.0.0.1:8000/org/list/ Django Version:1.9.13 Exception Type:NoReverseMatch Exception Value:Reverse for 'org_list' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] Exception Location:D:\venv27\lib\site-packages\django\core\urlresolvers.py in _reverse_with_prefix, line 508 Python Executable:D:\venv27\Scripts\python.exe Python Version:2.7.14 Python Path:['D:\\Demo\\MxOnline\\apps', 'D:\\Demo\\MxOnline\\extra_apps', 'D:\\Demo\\MxOnline', 'D:\\Demo\\MxOnline', 'D:\\Demo\\MxOnline\\apps', 'D:\\Demo\\MxOnline\\extra_apps', 'D:\\venv27\\Scripts\\python27.zip', 'D:\\venv27\\DLLs', 'D:\\venv27\\lib', 'D:\\venv27\\lib\\plat-win', 'D:\\venv27\\lib\\lib-tk', 'D:\\venv27\\Scripts', 'd:\\program files\\python27\\Lib', 'd:\\program files\\python27\\DLLs', 'd:\\program files\\python27\\Lib\\lib-tk', 'D:\\venv27', 'D:\\venv27\\lib\\site-packages', 'D:\\venv27\\lib\\site-packages\\django_reversion-2.0.10-py2.7.egg', 'd:\\venv27\\lib\\site-packages'] Server time:星期日, 8 十月 2017 21:29:49 +0800 但是去掉namespace="org"后可以正常显示页面。
写回答
1回答
-
HTML文件中原来用 "{% url 'org_list' %}" 要替换成 "{% url 'org:org_list' %}",你试试
212017-10-09
相似问题