Django 6 · Database and migrations

Generate models from an existing database

Print model classes for tables in an existing database.

python manage.py inspectdb > models.py

Official Django 6 documentation

More database and migrations commands

All database and migrations commands · Django 6 cheatsheet

Was this page helpful?