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

标签 python django python-3.x pycharm

我刚刚创建了 Django 项目并运行了服务器。 它工作正常,但向我显示了类似的警告

You have 14 unapplied migration(s)...

然后我跑了

python manage.py migrate

在终端中。它有效,但向我展示了这个

?: (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.

现在我在启动服务器后收到此警告。

You have 3 unapplied migration(s). 
Your project may not work properly until you apply
the migrations for app(s): admin, auth.

那么我该如何正确迁移才能摆脱这个警告呢?

我正在使用 PyCharm 并尝试通过 PyCharm 和终端创建项目,但遇到了同样的问题。

~$ python3.5 --version
Python 3.5.2

>>> django.VERSION
(1, 10, 1, 'final', 1)

最佳答案

所以我的问题是我使用了错误的 python 版本进行迁移。

python3.5 manage.py migrate

解决问题。

关于python - 您有 3 个未应用的迁移。在您为应用程序 : admin, auth 应用迁移之前,您的项目可能无法正常工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39469409/

相关文章:

python - 如何在进程之间共享多个字典

python - 如何简单地为 numpy 直方图设置替代的不等式条件?

python - 使用 OpenCV 从谷歌街景检测路灯

python - 搜索正则表达式时忽略子节点

Django 管理员更改错误消息 ("Please correct the errors below.")

python - Django DetailView - 如何在 get_context_data 中使用 'request'

python - 为什么我不断收到位置参数错误?

python - libsvm 预测方法困惑

python - 无法从 pandas 转到 dask 数据帧,内存错误

python - 我怎样才能将每个对象与每个对象进行比较?