Are there django commands that
A. Delete all tables
B. delete all data in all tables
C. Create all tables as defined in the model?
I cannot find these right now!
And by commands i mean those little things that are like
runserver
etc
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A. Delete all tables
manage.py sqlclearwill print the sql statement to drop all tablesB. delete all data in all tables
manage.py flushreturns the database to the state it was in immediately after syncdb was executedC. Create all tables as defined in the model?
manage.py syncdbCreates the database tables for all apps in INSTALLED_APPS whose tables have not already been created.See this page for a reference of all commands: https://docs.djangoproject.com/en/dev/ref/django-admin/
But you should definitely look into using south as someone already mentioned. It’s the best way to manage your database.
N.B:
syncdbis deprecated in favour of migrate, since Django 1.7.