1.把项目的所有migrations的迁移文件删除,保留init.py
2.删除虚拟环境中django的admin和auth的migrations的迁移文件删除,保留init.py
3.makemigrations项目中继承AbstractUser的model表
python manage.py makemigrations userProfile
4.执行迁移文件
python manage.py migrate userProfile
微信扫一扫
1.把项目的所有migrations的迁移文件删除,保留init.py
2.删除虚拟环境中django的admin和auth的migrations的迁移文件删除,保留init.py
3.makemigrations项目中继承AbstractUser的model表
python manage.py makemigrations userProfile
4.执行迁移文件
python manage.py migrate userProfile
相关推荐