django admin错误 - '字段列表'中的未知列'django_content_type.name' [英] django admin error - Unknown column 'django_content_type.name' in 'field list'

查看:1624
本文介绍了django admin错误 - '字段列表'中的未知列'django_content_type.name'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

My django project had a working admin page, but all of the sudden I started receiving: "Unknown column 'django_content_type.name' in 'field list'" whenever I try to access the admin page. I can still access some portions of the admin, just not the main page.

我很喜欢django和python,所以我不知道在哪里看。

I'm pretty new to django and python, so I have no idea where to look.

以下是完整的错误:

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

html错误发生在第63行: p>

html error occurs on line 63:

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的不同版本有关。我将所有在我的项目上工作的机器更新为django 1.8,使用pip install -U Django,一切都正常。

I had this same issue just now and it was related to different versions of django. I updated all of the machines working on my project to django 1.8 using pip install -U Django and everything worked fine after that.

这篇关于django admin错误 - '字段列表'中的未知列'django_content_type.name'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆