我发现了一个更好的错误信息(见下文)。
我在 core/models.py 中有一个名为 App 的模型。尝试访问 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
它发生在 /django/contrib/admin/templates/admin/change_form.html
32 <li><a href="{% url opts|admin_urlname:'history' original.pk|admin_urlquote %}" class="historylink">{% trans "History" %}</a></li>
这是(可能的)相关网址:
/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