localsettings_dst_path (optional): path indicating
where to copy the localsettings file, relative
to django_root_path (defaults to project_name/localsettings.py)
localsettings_dst_path (optional): path indicating
where to copy the localsettings file, relative
to django_root_path (defaults to project_name/localsettings.py)
"""
from os.path import abspath, dirname, exists, join
from django.utils.crypto import get_random_string
"""
from os.path import abspath, dirname, exists, join
from django.utils.crypto import get_random_string
if not files.exists(env.app_path):
run('mkdir -p %(app_path)s' % env, pty=True)
with cd(env.app_path):
if not files.exists(env.app_path):
run('mkdir -p %(app_path)s' % env, pty=True)
with cd(env.app_path):
- for subdir in 'releases', 'packages', 'log':
+ for subdir in 'releases', 'packages', 'log', 'samples':
if not files.exists(subdir):
run('mkdir -p %s' % subdir, pty=True)
with cd('%(app_path)s/releases' % env):
if not files.exists(subdir):
run('mkdir -p %s' % subdir, pty=True)
with cd('%(app_path)s/releases' % env):
def upload_localsettings_sample():
"Fill out localsettings template and upload as a sample."
env.secret_key = get_random_string(50)
def upload_localsettings_sample():
"Fill out localsettings template and upload as a sample."
env.secret_key = get_random_string(50)
require('app_path', 'project_name')
with cd(get_django_root_path('current')):
run('%(app_path)s/ve/bin/python manage.py collectstatic --noinput' % env, pty=True)
require('app_path', 'project_name')
with cd(get_django_root_path('current')):
run('%(app_path)s/ve/bin/python manage.py collectstatic --noinput' % env, pty=True)
path = '%(app_path)s/releases/%(release)s' % dict(app_path = env['app_path'], release = release)
if 'django_root_path' in env:
path = join(path, env['django_root_path'])
path = '%(app_path)s/releases/%(release)s' % dict(app_path = env['app_path'], release = release)
if 'django_root_path' in env:
path = join(path, env['django_root_path'])