20👍
flush will truncate (delete data)
sqlclear will drop (delete table, thus data too)
=> if you have structural modifications in your db, you have to do sqlclear (but better use south)
Update:
South has been deprecated.
From Django 1.7 upwards, migrations are built into the core of Django. If you are running a previous version, you can use South.
5👍
Official docs for
Flush carries out the SQL Drops on the entire db, sqlflush only prints out the SQL that flush would actual run (again on the entire db). sqlclear prints out SQL Drops for a particular app or apps. Both flush and sqlflush/dbshell/syncdb will install fixtures.
- [Django]-Django 2.0 – Not a valid view function or pattern name (Customizing Auth views)
- [Django]-How to use Python type hints with Django QuerySet?
- [Django]-How to access request body when using Django Rest Framework and avoid getting RawPostDataException
Source:stackexchange.com