I want to get all apps sql clear code in Django. I can use ./manage.py sqlclear
but I need to specify an appname, so is just for one app.
我想在Django中获取所有应用程序sql clear代码。我可以使用./manage.py sqlclear但我需要指定一个appname,因此只适用于一个应用程序。
Is there a way or command to execute sqlclear
over all installed apps ?
有没有办法或命令在所有已安装的应用程序上执行sqlclear?
2 个解决方案
#1
1
Django extensions has reset_db
command which is handy.
Django扩展有reset_db命令,这很方便。
Sample run:
样品运行:
(junction)➜ junction git:(master) ✗ ./manage.py reset_db
Monkey patching...
You have requested a database reset.
This will IRREVERSIBLY DESTROY
ALL data in the database "/Users/kracekumar/code/junction/db.sqlite3".
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Reset successful.
#2
#1
1
Django extensions has reset_db
command which is handy.
Django扩展有reset_db命令,这很方便。
Sample run:
样品运行:
(junction)➜ junction git:(master) ✗ ./manage.py reset_db
Monkey patching...
You have requested a database reset.
This will IRREVERSIBLY DESTROY
ALL data in the database "/Users/kracekumar/code/junction/db.sqlite3".
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Reset successful.