报错过程:
1、执行命令:python manage.py runserver时报错:
You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.
2、按提示ctrl+c结束后,执行命令:python manage.py migrate又报另一个错:
django.db.utils.OperationalError: (1050, "Table 'django_content_type' already exists")
解决步骤:
1、进入数据库删除‘myapp’的迁移记录:
delete from django_migrations where app='myapp';
2、执行命令:
python manage.py makemigrations
3、执行命令:
python manage.py migrate --fake