Alex Rivera | Logout

Emptying the database through Django's `manage.py`

Asked 2011-10-26T18:51:36.000
17

I would like to completely empty the entire database, restoring it to the way it was when I just created it, using Django's manage.py. Possible?

Edit
Report

1 Answer

2

Yes, you can use flush.

That will reset and restore everything in your entire database, regardless of which app or project the models are in. If you have a few databases, you can specify a single one in particular by using the --database switch

Examples:

python manage.py flush
python manage.py flush --database mydatabase
answered 2011-10-26T18:55:53.013

Your Answer