Created
May 23, 2018 03:17
-
-
Save vubon/51fbe7d6e65366d1f439b4803e897555 to your computer and use it in GitHub Desktop.
Reset Database by bash script
This file contains hidden or 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
#!/usr/bin/env bash | |
DEFAULT_USER="admin" | |
DEFAULT_EMAIL="[email protected]" | |
DEFAULT_PASS="nothing1234" | |
######### MAIN CLEAN ######### | |
rm 'db.sqlite3' | |
readonly virtual='/home/vubon/personal/upwork_env/bin/activate' | |
source ${virtual} | |
python manage.py makemigrations | |
python manage.py migrate | |
echo "from django.contrib.auth.models import User; User.objects.create_superuser('$DEFAULT_USER', '$DEFAULT_EMAIL', '$DEFAULT_PASS')" | python manage.py shell --plain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment