-
-
Save exallium/4228054 to your computer and use it in GitHub Desktop.
ZSH Functions for Django
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
| # Manage | |
| if [[ ! -a manage.py ]] then | |
| print "Your location is bad and you should feel bad." | |
| return | |
| fi | |
| local dir=`find . -name settings_local.py | perl -ne'/\/([A-Za-z0-9_]*)\/settings_local.py/ && print $1'` | |
| if [[ -z dir ]] then | |
| print "Local settings not found!" | |
| fi | |
| python manage.py $@ --settings=$dir.settings_local |
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
| # Runserver | |
| if [[ ! -a manage.py ]] then | |
| print "Your directory is bad and you should feel bad" | |
| return | |
| fi | |
| local dir=`find . -name settings_local.py | perl -ne'/\/([A-Za-z0-9_]*)\/settings_local.py/ && print $1'` | |
| if [[ -z dir ]] then | |
| print "Local settings not found!" | |
| fi | |
| python manage.py runserver --settings=$dir.settings_local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment