有時咱們須要根據已存在的數據庫進行django開發時,手寫model.py是不現實的python
先執行下面的語句,在命令行終端會輸出全部表的類數據庫
python .\manage.py inspectdb
python manage.py inspectdb > models.py