Django database table initialization Clear Cache

 

The new django project does not apply app01? ? ?

models also did not UserInfo table? ? ? ?

But it is has been migrate error! ! ! ! !

 

The cause of this phenomenon:

Before the project must be used before the application app01, but also in the models been defined UserInfo table (table inheritance comes through django, will produce a cache)

 

Solution:

(1) delete the current project the following documents:

  

 

(2) clean up django installation module E: \ python36 \ Lib \ site-packages \ django \ contrib \ admin \ migrations in addition to all the files __init__.py accident

   

 

(3) re-execute makemigrations migrate to the current project

 

 

 

 

Guess you like

Origin www.cnblogs.com/open-yang/p/11223458.html