python - django 管理错误 - 'django_content_type.name' 中的未知列 'field list'

标签 python django

我的 django 项目有一个工作管理页面,但突然间我开始收到: “'字段列表'中的未知列'django_content_type.name'” 每当我尝试访问管理页面时。我仍然可以访问管理的某些部分,但不能访问主页。

我是 django 和 python 的新手,所以我不知道去哪里找。

这是完整的错误:

InternalError at /admin/
(1054, u"Unknown column 'django_content_type.name' in 'field list'")
Request Method: GET
Request URL:    http://127.0.0.1:8000/admin/
Django Version: 1.7.7
Exception Type: InternalError
Exception Value:    
(1054, u"Unknown column 'django_content_type.name' in 'field list'")
Exception Location: c:\Python27\lib\site-packages\pymysql\err.py in _check_mysql_exception, line 115
Python Executable:  c:\Python27\python.exe
Python Version: 2.7.9
Python Path:    
['c:\\users\\dhysong\\Documents\\School\\CS6310\\Project4\\CS6310',
 'C:\\Windows\\system32\\python27.zip',
 'c:\\Python27\\DLLs',
 'c:\\Python27\\lib',
 'c:\\Python27\\lib\\plat-win',
 'c:\\Python27\\lib\\lib-tk',
 'c:\\Python27',
 'c:\\Python27\\lib\\site-packages']
Server time:    Thu, 9 Apr 2015 08:17:05 -0400

第63行出现html错误:

In template c:\Python27\lib\site-packages\django\contrib\admin\templates\admin\index.html, error at line 63
1054
53  <div id="content-related">
54      <div class="module" id="recent-actions-module">
55          <h2>{% trans 'Recent Actions' %}</h2>
56          <h3>{% trans 'My Actions' %}</h3>
57              {% load log %}
58              {% get_admin_log 10 as admin_log for_user user %}
59              {% if not admin_log %}
60              <p>{% trans 'None available' %}</p>
61              {% else %}
62              <ul class="actionlist">
63              {% for entry in admin_log %}
64              <li class="{% if entry.is_addition %}addlink{% endif %}{% if entry.is_change %}changelink{% endif %}{% if entry.is_deletion %}deletelink{% endif %}">
65                  {% if entry.is_deletion or not entry.get_admin_url %}
66                      {{ entry.object_repr }}
67                  {% else %}
68                      <a href="{{ entry.get_admin_url }}">{{ entry.object_repr }}</a>
69                  {% endif %}
70                  <br/>
71                  {% if entry.content_type %}
72                      <span class="mini quiet">{% filter capfirst %}{% trans entry.content_type.name %}{% endfilter %}</span>
73                  {% else %}

最佳答案

我刚才遇到了同样的问题,它与不同版本的django有关。我使用 pip install -U Django 将所有在我的项目上工作的机器更新为 django 1.8,之后一切正常。

关于python - django 管理错误 - 'django_content_type.name' 中的未知列 'field list',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29538388/

相关文章:

python - URL 查询参数中的下划线是否有效?

python - matplotlib:使用颜色图为表格单元格背景着色

python - 获取要在 Qt 小部件中显示的子进程的标准输出

python - 从 raw_input() 读取输入而不会被 Python 中的其他线程覆盖提示

Python re.sub、re.split 无法分割长段落中的单词

django - 在 openshift 上重新启动 python 应用程序不会重新加载环境变量

Django - 覆盖 get_form 以根据请求自定义管理表单

python - 您有 3 个未应用的迁移。在您为应用程序 : admin, auth 应用迁移之前,您的项目可能无法正常工作

python - ValueError 精确查找的 QuerySet 值必须限制为使用 django View 上的切片的一个结果

Django 列 wagtailcore_page.draft_title 不存在