Reverse generate models django project file from a database

1. Create a django project

2. Configure the relevant database configured in the project configuration file in settings.py

3. Make sure the associated database table already exists

4. pycharm terminal enters to the root item, the python manage.py inspectdb, you may be introduced to view the related information models of

 

5. Run python manage.py inspectdb> (need to import table app) /models.py, to complete the inverted file generation models

 

 

6. relevant changes into the models file

Guess you like

Origin www.cnblogs.com/le-le666/p/11802632.html