[英]You have 3 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth
I've just created Django project and ran the server.我刚刚创建了 Django 项目并运行了服务器。 It works fine but showed me warnings like它工作正常,但向我展示了警告,例如
You have 14 unapplied migration(s)...
Then I ran然后我跑了
python manage.py migrate
in the terminal.在终端。 It worked but showed me this它有效,但向我展示了这个
?: (1_7.W001) MIDDLEWARE_CLASSES is not set.
HINT: Django 1.7 changed the global defaults for the MIDDLEWARE_CLASSES.
django.contrib.sessions.middleware.SessionMiddleware, django.contrib.auth.middleware.AuthenticationMiddleware, and django.contrib.messages.middleware.MessageMiddleware were removed from the defaults. If your project needs these middleware then you should configure this setting.
And now I have this warning after starting my server.现在我在启动服务器后收到此警告。
You have 3 unapplied migration(s).
Your project may not work properly until you apply
the migrations for app(s): admin, auth.
So how do I migrate correctly to get rid of this warning?那么如何正确迁移以消除此警告?
I am using PyCharm and tried to create the project via PyCharm and terminal and have the same issue.我正在使用 PyCharm 并尝试通过 PyCharm 和终端创建项目并遇到相同的问题。
~$ python3.5 --version
Python 3.5.2
>>> django.VERSION
(1, 10, 1, 'final', 1)
So my problem was that I used wrong python version for migration.所以我的问题是我使用错误的 python 版本进行迁移。
python3.5 manage.py migrate
solves the problem.解决了这个问题。
You are probably using wrong django version.您可能使用了错误的 Django 版本。 You need django1.10
你需要django1.10
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.