What is the django command to delete all tables?

A. Delete all tables

manage.py sqlclear will print the sql statement to drop all tables

B. delete all data in all tables

manage.py flush returns the database to the state it was in immediately after syncdb was executed

C. Create all tables as defined in the model?

manage.py syncdb Creates 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: syncdb is deprecated in favour of migrate, since Django 1.7.

Leave a Comment