django数据迁移
1.执行命令
python manage.py startapp App02
2.把App里面的文件 view model,form,拷贝到App02中
删除App文件夹
3.配置setting文件
4.修改路由![在这里插入图片描述]
5.修改配置文件
6.执行python manage.py makemigrations
ERRORS:
App02.User: (auth.E003) ‘User.username’ must be unique because it is named as the ‘USERNAME_FIELD’.
报了个错
挺悲哀的
不过我解决了
7.再次执行:
python manage.py makemigrations
8.执行:python manage.py migrate
9.去数据库里面查看当前的数据库里面是否迁移成功