Django:使用django-simple-history模块访问admin / auth / user历史记录时出错

时间:2016-05-26 09:35:33

标签: django django-admin

我试图访问admin / App / history:对于用户和组,我收到以下错误。

我正在使用django-simple-history模块。

admin.py我的代码是:

from django.contrib.auth.models import User, Group
from simple_history import register

register(User,inherit=True)
register(Group,inherit=True)

在我的SQL workbench中,创建了历史记录表并成功存储了数据。但是在/admin/auth/user/网站中,我收到以下错误。

例如,我试图访问用户的历史记录并查看:

NoReverseMatch at /admin/auth/user/4/history/
Reverse for 'app_list' with arguments '()' and keyword arguments '{u'app_label': ''}' not found. 1 pattern(s) tried: [u'admin/(?P<app_label>eReg|auth)/$']

Error during template rendering

In template C:\Users\zinwnas\PycharmProjects\project_myTIF_test\static\templates\admin\object_history.html, error at line 7
Reverse for 'app_list' with arguments '()' and keyword arguments '{u'app_label': ''}' not found. 1 pattern(s) tried: [u'admin/(?P<app_label>eReg|auth)/$']
1   {% extends "admin/base_site.html" %}
2   {% load i18n admin_urls %}
3   
4   {% block breadcrumbs %}
5   <div class="breadcrumbs">
6   <a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
7   
      &rsaquo; <a href="
      {% url 'admin:app_list' app_label=app_label %}
      ">{{ app_label|capfirst|escape }}</a>


8   &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ module_name }}</a>
9   &rsaquo; <a href="{% url opts|admin_urlname:'change' object.pk|admin_urlquote %}">{{ object|truncatewords:"18" }}</a>
10  &rsaquo; {% trans 'History' %}
11  </div>
12  {% endblock %}
13  
14  {% block content %}
15  <div id="content-main">
16  <div class="module">
17  

0 个答案:

没有答案