What is the django command to delete all tables?

前端 未结 7 1968
清歌不尽
清歌不尽 2021-01-31 16:47

Are there django commands that

A. Delete all tables

B. delete all data in all tables

C. Create all tables as defined in the model?

相关标签:
7条回答
  • 2021-01-31 17:14

    I recommend using django-south. It allows you to sync your models to your database not just when you add a field, but also when you delete a field/model. I really find it to be an essential component of building a Django site. Once installed, you could run a command like:

    ./manage.py migrate app zero

    You can learn more here: http://south.aeracode.org/docs/about.html

    0 讨论(0)
提交回复
热议问题