简体   繁体   English

您有 3 个未应用的迁移。 在您为应用程序应用迁移之前,您的项目可能无法正常工作:admin、auth

[英]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.

相关问题 在您为应用程序应用迁移之前,项目可能无法正常工作,但迁移不起作用 - project may not work properly until you apply the migrations for app(s) but migrations doesn't work 如何解决应用程序的 29 个未应用的迁移:admin、api、auth、authtoken、contenttypes、sessions、social_django - How can I solve the 29 unapplied migration(s) for app(s): admin, api, auth, authtoken, contenttypes, sessions, social_django Django:没有迁移适用,但我有未应用的迁移 - Django: no migrations apply, but I have unapplied migrations toomanyrequests:您已达到拉取率限制。 您可以通过身份验证和升级来增加限制 - toomanyrequests: You have reached your pull rate limit. You may increase the limit by authenticating and upgrading FLASK-第1行的'%(site_id)s'附近的SQL语法错误 - FLASK - You have an error in your SQL syntax near '%(site_id)s' at line 1 1064SQL语法有错误。 以便在第1行的'%s'附近使用正确的语法”) - 1064, “You have an error in your SQL syntax; for the right syntax to use near '%s' at line 1”) 错误 1064 (42000):您的 SQL 语法中存在错误,接近使用 %s - error 1064 (42000) : You have an error in your SQL syntax near to use %s 您可能没有将相关的 model 包含在您的 API 中,或者在该字段上错误地配置了 `lookup_field` 属性 - You may have failed to include the related model in your API, or incorrectly configured the `lookup_field` attribute on this field 外部脚本和未应用的迁移 - External script and unapplied migrations Selenium Python:取消Chrome浏览器的“您要离开此网站吗? 您所做的更改可能不会保存”弹出窗口 - Selenium Python: suppress Chrome's “Do you want to leave this site? Changes you made may not be saved” popup
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM