在 Django 中启动本地服务器时,它向我显示“17 个未应用的迁移..”如何在启动服务器时删除此内容?
我正在我的 Windows Server 10 上尝试此操作
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.
July 30, 2019 - 14:53:53
Django version 2.2.3, using settings 'CalcProject.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
[30/Jul/2019 14:53:58] "GET / HTTP/1.1" 200 16348
[30/Jul/2019 14:53:58] "GET /static/admin/css/fonts.css HTTP/1.1" 304 0
[30/Jul/2019 14:53:58] "GET /static/admin/fonts/Roboto-Bold-webfont.woff HTTP/1.1" 304 0
[30/Jul/2019 14:53:58] "GET /static/admin/fonts/Roboto-Regular-webfont.woff HTTP/1.1" 304 0
最佳答案
要应用迁移,请使用命令
python manage.py migrate
要删除迁移,请使用假命令
python manage.py migrate --fake
但是在使用这个命令之前要小心。
关于python - 如何删除或删除 django 中未应用的迁移?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57268994/