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

Share Tweet

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

$ python sqlclear app_name | python dbshell

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

$ python migrate appname zero

Recreate all the tables:

$ python syncdb


Taken from SO

Share Tweet


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