📅  最后修改于: 2022-03-11 14:45:03.866000             🧑  作者: Mango
#Auto-generate the models
python manage.py inspectdb
#Save this as a file by using standard Unix output redirection:
python manage.py inspectdb > models.py
#By default, inspectdb creates unmanaged models. That is, managed = False in the model’s Meta class tells Django not to manage each table’s creation, modification, and deletion:
class Person(models.Model):
id = models.IntegerField(primary_key=True)
first_name = models.CharField(max_length=70)
class Meta:
managed = False
db_table = 'CENSUS_PERSONS'