3

im learning django 1.8.x. In older django(1.4) we can view sql query like

"Begin; 
create table "article_article" ("id" integer NOT NULL PRIMARY KEY,
 ...
 ...
); 
COMMIT"  

for creating model object of an APP called article by running :-

python manage.py sql <appname>

is there a way so that i can view sql query used to create model objects for that app in Django 1.8.9 ? cheers

1 Answer 1

4

You can see the SQL per migration now. So assuming it's the first sync (i.e. syncdb in older Django):

python manage.py sqlmigrate <appname> 0001
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.