首页 新闻 会员 周边 捐助

django项目 makemigrations时出现django.db.migrations.graph.nodenotfounderror错误。

-1
悬赏园豆:100 [待解决问题]

如题 makemigrations时出现

django.db.migrations.graph.NodeNotFoundError: Migration blog.0001_initial depend
encies reference nonexistent parent node (u'auth', u'0007_alter_validators_add_e
rror_messages')错误   求大家解答!

问题源文件:

# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2016-02-24 10:34
from __future__ import unicode_literals

import blog.models
from django.conf import settings
import django.contrib.auth.models
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):

initial = True

dependencies = [
('tagging', '0001_initial'),
('auth', '0007_alter_validators_add_error_messages'),

]

operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('password', models.CharField(max_length=128, verbose_name='password')),
('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
('username', models.CharField(error_messages={'unique': 'A user with that username already exists.'}, help_text='Required. 30 characters or fewer. Letters, digits and @/./+/-/_ only.', max_length=30, unique=True, validators=[django.core.validators.RegexValidator('^[\\w.@+-]+$', 'Enter a valid username. This value may contain only letters, numbers and @/./+/-/_ characters.')], verbose_name='username')),
('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
('last_name', models.CharField(blank=True, max_length=30, verbose_name='last name')),
('email', models.EmailField(blank=True, max_length=254, verbose_name='email address')),
('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
('name', models.CharField(max_length=12)),
('avatar_path', models.ImageField(default='/static/image/avatar_default.jpg', upload_to='/avatar')),
],
options={
'abstract': False,
'verbose_name': 'user',
'verbose_name_plural': 'users',
},
managers=[
('objects', django.contrib.auth.models.UserManager()),
],
),
migrations.CreateModel(
name='Carousel',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('img', models.ImageField(upload_to='/carousel')),
('create_time', models.DateTimeField(auto_now_add=True)),
],
options={
'ordering': ['-create_time'],
},
),
migrations.CreateModel(
name='Catalogue',
fields=[
('name', models.CharField(max_length=20, primary_key=True, serialize=False)),
],
),
migrations.CreateModel(
name='Comment',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('publish_Time', models.DateTimeField(auto_now_add=True)),
('ip_address', models.GenericIPAddressField()),
('content', models.CharField(max_length=200)),
('isDelete', models.BooleanField(default=False)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
migrations.CreateModel(
name='Editor',
fields=[
('name', models.CharField(max_length=20, primary_key=True, serialize=False)),
('avaliable', models.BooleanField(default=True)),
],
),
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('publish_time', models.DateTimeField(auto_now_add=True)),
('modify_time', models.DateTimeField(auto_now_add=True)),
('content', models.TextField()),
('tag', blog.models.TagField_Mine(blank=True, max_length=255)),
('view_count', models.IntegerField(default=0, editable=False)),
('status', models.SmallIntegerField(choices=[(0, '\u8349\u7a3f'), (1, '\u53d1\u5e03'), (2, '\u5220\u9664')], default=0)),
('author', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
('catalogue', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.Catalogue')),
('editor_choice', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.Editor')),
],
options={
'ordering': ['-modify_time'],
},
),
migrations.CreateModel(
name='Repository',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('title', models.CharField(max_length=100)),
('publish_time', models.DateTimeField(auto_now_add=True)),
('author', models.CharField(max_length=20)),
('content', models.TextField()),
('view_count', models.IntegerField(default=0, editable=False)),
('tag', models.ManyToManyField(blank=True, default='', to='tagging.Tag')),
],
options={
'ordering': ['-publish_time'],
},
),
migrations.AddField(
model_name='comment',
name='post',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.Post'),
),
migrations.AddField(
model_name='carousel',
name='post',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='blog.Post'),
),
migrations.AddField(
model_name='user',
name='editor_choice',
field=models.ForeignKey(blank=True, default='tinyMCE', null=True, on_delete=django.db.models.deletion.CASCADE, to='blog.Editor'),
),
migrations.AddField(
model_name='user',
name='groups',
field=models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups'),
),
migrations.AddField(
model_name='user',
name='user_permissions',
field=models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions'),
),
]

STmiku的主页 STmiku | 初学一级 | 园豆:102
提问于:2017-03-24 13:47
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册