Skip to content

Instantly share code, notes, and snippets.

@bradmontgomery
Created October 31, 2011 02:33
Show Gist options
  • Save bradmontgomery/1326783 to your computer and use it in GitHub Desktop.
Save bradmontgomery/1326783 to your computer and use it in GitHub Desktop.
A stab at running remote Django management commands via fabric.
def manage(management_command, args=None):
with cd(REMOTE_PROJECT_DIR):
cmd = "source /path/to/virtualenv/bin/activate && "
cmd += "python manage.py %s %s" % (management_command, args or '')
run(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment