Last active
August 10, 2016 05:04
-
-
Save burhan/2704588 to your computer and use it in GitHub Desktop.
django "one liner" to delete all tables installed and reset the db
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo 'from django.conf import settings; print settings.INSTALLED_APPS; quit();' | \ | |
python manage.py shell --plain 2>&1 | \ | |
tail -n1 | sed -r "s|^.*\((.*)\).*$|\1|; s|[',]| |g; s|django\.contrib\.||g" | \ | |
xargs python manage.py sqlclear | \ | |
python manage.py dbshell && python manage.py migrate --run-syncdb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment