Question

Is there an easy way to reset a django database (i.e. drop all data/tables, create new tables and create indexes) without loading fixture data afterwords? What I want to have is just an empty database because all data is loaded from another source (a kind of a post-processed backup).

I know that this could be achieved by piping the output of the manage sql... commands to manage dbshell, but this relies on manage dbshelland is kind of hacky...

Are there any other ways to do this?

Edit: manage reset will do it, but is there a command like reset that doesn't need the application names as parameters?

Was it helpful?

Solution

As far as I know, the fixtures (in initial_data file) are automatically loaded after manage.py syndcb and not after reset. So, if you do a manage.py reset yourapp it should not load the fixtures. Hmm?

OTHER TIPS

shouldn't you be able do do this with manage.py's reset option?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top