运行python manage.py runserver时报错:You have 18 unapplied migration(s). Your project may not work proper

运行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.
在这里插入图片描述
实际上Django是把用户表,组表等的模式都写好了,项目实施时,需要先将这些模式导入到数据库中。因此,此时应该先在终端Terminal执行迁移。

python manage.py makemigrations#生成迁移文件
python manage.py migrate#执行迁移文件

然后再执行python manage.py runserver 成功
运行python manage.py runserver时报错:You have 18 unapplied migration(s). Your project may not work proper_第1张图片

你可能感兴趣的:(django,python,后端)