我找到了一个更好的错误信息(见下文)。NoReverseMatch:与参数 '(U' ')' 和关键字参数 '{}' 不found.in Django管理
我有一个核心/ models.py称为应用模型。尝试访问django admin中的特定应用程序对象时发生此错误。即使在一个空的数据库(syncdb后)与一个单一的应用程序对象。
似乎core_app_history是Django的产生的东西。任何帮助表示赞赏。
这里是个例外:
NoReverseMatch at /admin/core/app/251/
Reverse for 'core_app_history' with arguments '(u'',)' and keyword arguments '{}' not found.
Request Method: GET
Request URL: http://weblocal:8001/admin/core/app/251/
Django Version: 1.5.4
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'core_app_history' with arguments '(u'',)' and keyword arguments '{}' not found.
Exception Location: /opt/virtenvs/django_slice/local/lib/python2.7/site-packages/django/template/defaulttags.py in render, line 426
Python Executable: /opt/virtenvs/django_slice/bin/python
Python Version: 2.7.3
Python Path:
['/opt/src/slicephone/cloud',
'/opt/virtenvs/django_slice/local/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg',
'/opt/virtenvs/django_slice/local/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg',
'/opt/virtenvs/django_slice/local/lib/python2.7/site-packages/distribute-0.6.35-py2.7.egg',
'/opt/virtenvs/django_slice/lib/python2.7',
'/opt/virtenvs/django_slice/lib/python2.7/plat-linux2',
'/opt/virtenvs/django_slice/lib/python2.7/lib-tk',
'/opt/virtenvs/django_slice/lib/python2.7/lib-old',
'/opt/virtenvs/django_slice/lib/python2.7/lib-dynload',
'/usr/lib/python2.7',
'/usr/lib/python2.7/plat-linux2',
'/usr/lib/python2.7/lib-tk',
'/opt/virtenvs/django_slice/local/lib/python2.7/site-packages']
Server time: Fri, 11 Oct 2013 22:06:43 +0000
它
32 <li><a href="{% url opts|admin_urlname:'history' original.pk|admin_urlquote %}" class="historylink">{% trans "History" %}</a></li>
这里是(可能)相关的URL发生在/django/contrib/admin/templates/admin/change_form.html:
/admin/core/app/ HANDLER: changelist_view
/admin/core/app/add/ HANDLER: add_view
/admin/core/app/(.+)/history/ HANDLER: history_view
/admin/core/app/(.+)/delete/ HANDLER: delete_view
/admin/core/app/(.+)/ HANDLER: change_view
做所有其他意见工作? –
显示你的应用程序的“views”和“urls”。 – sachitad
@AryehLeibTaurog是的,所有其他视图和管理界面工作正常。 – kev