runserver问题

python 3.8.1 django 3.0.4 创建新工程并运行之后出现第一行报错,有哪位大佬指点一下啊 Watching for file changes with StatReloader Performing system checks...

System check identified no issues (0 silenced).

You have 17 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. March 18, 2020 - 11:06:40 Django version 3.0.4, using settings 'mysite.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CTRL-BREAK.

评论 2

  • 说你有没有应用的数据迁移,让你执行python manage.py migrate,如果还有问题检查一下你要用的app是不是都在settings里面注册了

  • 做完model要用manage.py makemagrations appname让django知道你有model要更新,然后再manage.py magrate提交到数据库