Django db reset without loading fixtures
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 manag开发者_运维知识库e sql...
commands to manage dbshell
, but this relies on manage dbshell
and 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?
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?
shouldn't you be able do do this with manage.py's reset option?
精彩评论