From d499116de117c72a75cd23a3e733db2669d8053a Mon Sep 17 00:00:00 2001 From: Alexander Zolotarev Date: Fri, 3 Feb 2017 11:54:57 +0300 Subject: [PATCH] config db --- fabfile.py | 14 ++++++++------ lms/settings.py | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fabfile.py b/fabfile.py index afce90a..33a884c 100644 --- a/fabfile.py +++ b/fabfile.py @@ -24,7 +24,7 @@ config = { 'manage_py_path' : '', 'settings_path' : 'skillbox', 'repository_type' : 'git', - 'repository_url' : 'git@gitlab.com:django-webapp/skillbox.git', + 'repository_url' : 'git@gitlab.com:skillbox/go.skillbox.ru.git', 'aws_key' : '', 'aws_secret' : '' } @@ -257,8 +257,8 @@ def fetch(): with virtualenv(): #manage('migrate --run-syncdb --noinput') - #manage('migrate --all') - manage("migrate --noinput") + #manage('migrate') + #manage("migrate --noinput") manage("collectstatic -v 0 --noinput") #upload_template_and_reload('django_settings') #upload_template_and_reload('gunicorn') @@ -271,11 +271,13 @@ def create(): """ Stages the application on the server """ - sudo('chown %s /var' % env.user) + sudo('rm -r %s -f' % env.project_path) + sudo('chown %s /var' % 'www-data') with cd('/var'): run('mkdir -p www') with cd('/var/www'): run('%s clone %s %s' %(env.repository_type, env.repository_url, env.project_path)) + sudo('ln -s /var/www/media %s' % env.project_path) with cd(env.project_path): run("virtualenv -p python3 env --distribute") @@ -291,8 +293,8 @@ def create(): upload_template_and_reload('supervisor') with virtualenv(): - manage('migrate --run-syncdb --noinput') - #manage('migrate --all') + #manage('migrate --run-syncdb --noinput') + #manage('migrate --list') #manage("migrate --noinput") manage("collectstatic -v 0 --noinput") diff --git a/lms/settings.py b/lms/settings.py index 6fee0dd..a3461cd 100644 --- a/lms/settings.py +++ b/lms/settings.py @@ -122,7 +122,7 @@ DATABASES = { 'USER': os.environ.get('PG_ENV_POSTGRES_USER', 'team'), 'PASSWORD': os.environ.get('PG_ENV_POSTGRES_PASSWORD', 'nu5Xefise'), 'HOST': os.environ.get('PG_PORT_5432_TCP_ADDR', '192.168.0.2'), - 'PORT': os.environ.get('PG_PORT_5432_TCP_PORT', '5432'), + 'PORT': os.environ.get('PG_PORT_5432_TCP_PORT', ''), }, }