python- error information and solutions

Question 1:

Models.py modify the contents of the file, ie after using the modified class

python manage.py makemigrations

python manage.py migrate

Display No Changes.

Solution 1:

use

python manage.py makemigrations --empty 应用名

Show your app following the modified file migrations, delete other files in addition to __init__.py away.

Delete the corresponding database table

Call python manage.py makemigrations and python manage.py migrate again.

Solution 2:

There Django_migrations database table, you will need to update the table to delete information.

Create model delete the relevant information migrations class 0001_initial.py table with your update.

Call python manage.py makemigrations and python manage.py migrate again.

 

Published 163 original articles · won praise 471 · views 260 000 +

Guess you like

Origin blog.csdn.net/lady_killer9/article/details/100761331