how to check sql statement generated for model and reverse generation model of existing table in django

created at 07-16-2021 views: 2

from model to sql statement

Django 1.9 and below versions:

python sqlall <app_name>

Django version 1.9 and later

python sqlmigrate app_label migration_name

# example
python sqlmigrate app 0001_initial
python sqlmigrate app 0001

python sqlmigrate app 0002_initial

reverse generation from table to models

python inspectdb
created at:07-16-2021
edited at: 07-16-2021: