Güngör Budak's Blog

Bioinformatics, web programming, coding in general

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

Share Tweet

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


Taken from SO

Share Tweet


Please start a discussion down below or send me an email!