GÜNGÖR BUDAK

Bioinformatics Analyst at Seven Bridges & PhD Student at METU

How to Clear (or Drop) DB Table of A Django App

Let’s say you created a Django app and ran python manage.py syncdb and created its table. Everytime you make a change in the table, you’ll need to drop that table and run python manage.py syncdb again to update. And how you drop a table of a Django app:

$ python manage.py sqlclear app_name | python manage.py dbshell

Drop tables of an app with migrations (Django >= 1.8):

$ python manage.py migrate appname zero

Recreate all the tables:

$ python manage.py syncdb

Easy!

Taken from SO