Yev*_*ych 10 python django pycharm python-3.x
我刚刚创建了Django项目并运行了服务器.它工作正常,但向我展示了警告
You have 14 unapplied migration(s)...
Run Code Online (Sandbox Code Playgroud)
然后我跑了
python manage.py migrate
Run Code Online (Sandbox Code Playgroud)
在终端.它工作但向我展示了这一点
?: (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.
Run Code Online (Sandbox Code Playgroud)
现在我在启动服务器后收到此警告.
You have 3 unapplied migration(s).
Your project may not work properly until you apply
the migrations for app(s): admin, auth.
Run Code Online (Sandbox Code Playgroud)
那么如何正确迁移以消除此警告?
我正在使用PyCharm并尝试通过PyCharm和终端创建项目并遇到同样的问题.
~$ python3.5 --version
Python 3.5.2
>>> django.VERSION
(1, 10, 1, 'final', 1)
Run Code Online (Sandbox Code Playgroud)
Yev*_*ych 10
所以我的问题是我使用了错误的python版本进行迁移.
python3.5 manage.py migrate
Run Code Online (Sandbox Code Playgroud)
解决了这个问题.
| 归档时间: |
|
| 查看次数: |
10564 次 |
| 最近记录: |