Last active
December 22, 2015 17:49
-
-
Save darklow/6508370 to your computer and use it in GitHub Desktop.
Django local server deployment with Fabric and virtualenv
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
from fabric.api import lcd, local, path | |
project_dir = '/www/project/sms/' | |
env_bin_dir = project_dir + '../env/bin' | |
def deploy(): | |
with lcd(project_dir): | |
local('pwd') | |
local('git pull origin') | |
local('git checkout -f') | |
with path(env_bin_dir, behavior='prepend'): | |
local('pip freeze') | |
local('pip install -r requirements/staging.txt') | |
local('./manage.py migrate --settings="project.settings.staging"') | |
local('./manage.py collectstatic -cl --noinput -v0') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment