📜  如何在 django faker 中运行脚本来填充数据库 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:11.675000             🧑  作者: Mango

代码示例1
first you need to do python manage.py migrate

and then respectively python manage.py makemigrations

then give some suggestion like that... AccessRecort change to AccessRecord [y/N]? press y

then python mange.py migrate

Operations to perform: Apply all migrations: admin, auth, contenttypes, first_app, sessions Running migrations: Applying first_app.0002_auto_20190731_1445... OK

(MyDjangoEnv) C:\your\file\path\first_project>python populate_first_app.py