小编kut*_*hue的帖子

迁移期间的Django NodeNotFoundError

error当我尝试runserver使用我的django应用程序时,我得到如下:

django.db.migrations.graph.NodeNotFoundError:迁移tasks.0001_initial依赖项引用不存在的父节点(u'auth',u'0007_alter_validators_add_error_messages')

这是在我遵循这个heroku教程之后发生的:https://devcenter.heroku.com/articles/getting-started-with-django

我修改了设置文件以包含:

import dj_database_url
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
import os
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
STATIC_ROOT = 'staticfiles'
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}

#DATABASES['default'] =  dj_database_url.config()
STATIC_URL = '/static/'

STATICFILES_DIRS = (
    os.path.join(BASE_DIR, 'tasks/static'),
)
Run Code Online (Sandbox Code Playgroud)

我的0001_initial迁移如下:

from __future__ import unicode_literals

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ('auth', '0007_alter_validators_add_error_messages'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]
Run Code Online (Sandbox Code Playgroud)

我迷失了我应该尝试下一步来修复此错误.建议赞赏!谢谢!

python sqlite django heroku database-migration

13
推荐指数
1
解决办法
7045
查看次数

标签 统计

database-migration ×1

django ×1

heroku ×1

python ×1

sqlite ×1