[Django]-Django convert Model to sql code

1👍

If you’re looking for the specific pieces of code, have a look at django.db.backends.base.creation to see how the sql is generated, of course there need to be individual implementations for different database types, so for example also see django.db.backends.postgresql_psycopg2.creation!

2👍

👤S.Lott

2👍

I am not exactly sure what you mean, but you can get the SQL for all the tables in an app by running this command:
python manage.py sqlall your_app

👤Ivan P

Leave a comment