Skip to content

Instantly share code, notes, and snippets.

@exallium
Created December 6, 2012 20:29
Show Gist options
  • Select an option

  • Save exallium/4228054 to your computer and use it in GitHub Desktop.

Select an option

Save exallium/4228054 to your computer and use it in GitHub Desktop.
ZSH Functions for Django
# 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
# 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