关系" django_admin_log"已经存在

时间:2018-03-05 21:52:42

标签: django

当我尝试运行python manage.py migrate时遇到以下错误 enter image description here

运行python manage.py run migrations后,表示未检测到任何更改。当我运行服务器时,它给了我警告我也有未应用的迁移。我已经在互联网上搜索了两个小时但没有解决方案。知道解决方案的人请分享:)

2 个答案:

答案 0 :(得分:1)

数据库中存储迁移数据以跟踪已应用内容的表已过期。尝试运行python manage.py migrate --fake

答案 1 :(得分:1)

尝试<script type="text/ecmascript" language="ecmascript"> function runCode() { var clientContext = new SP.ClientContext.get_current(); if (clientContext != undefined && clientContext != null) { var web = clientContext.get_web(); var listCollection = web.get_lists(); var list = listCollection.getByTitle("Tasks"); var viewCollection = list.get_views(); var view = viewCollection.getByTitle("All Tasks"); var query = '<OrderBy><FieldRef Name=\'Title\' Ascending=\'False\' /></OrderBy>'; view.set_viewQuery(query); view.update(); clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed)); } } function onQuerySucceeded() { alert('Tasks list ordered in descending alphabetic order.'); } function onQueryFailed(sender, args) { alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace()); } 如果仍然存在,则会检测到更改,然后删除应用程序文件夹中名为python manage.py makemigrations [app name]的文件夹,然后使用此migrations。迁移成功后,执行python manage.py makemigrations [app name]