Beispiel #1
0
def runserver():
    with virtualenv():
        run(
            'python manage.py runserver [::]:8000 --settings={}'.format(
                env.settings_file
            )
        )
Beispiel #2
0
def createsuperuser():
    with virtualenv():
        run(
            'python manage.py createsuperuser --settings={}'.format(
                env.settings_file
            )
        )
Beispiel #3
0
def syncdb():
    with virtualenv():
        run(
            'python manage.py syncdb --noinput --settings={}'.format(
                env.settings_file
            )
        )
Beispiel #4
0
def collectstatic():
    with virtualenv():
        run(
            'python manage.py collectstatic --settings={}'.format(
                env.settings_file
            )
        )
Beispiel #5
0
def schemamigration():
    initial = ''
    _verify_migration_app_is_set()
    _verify_migration_initial_is_set()
    app = env.schemamigration_app
    initial = '--initial' if env.schemamigration_initial == 'y' else ''
    with virtualenv():
        run('python manage.py schemamigration {initial} {app} --settings={settings}'.format(initial=initial,
                                                                                            app=app, settings=env.settings_file))
Beispiel #6
0
def migrate():
    # if app == '', south will look for all migrations in all apps
    verify_migration_app_is_set()
    with virtualenv():
        run(
            'python manage.py migrate {} --settings={}'.format(
                env.schemamigration_app,
                env.settings_file,
            )
        )
Beispiel #7
0
def schemamigration():
    initial = ''
    verify_migration_app_is_set()
    verify_migration_initial_is_set()
    app = env.schemamigration_app
    initial = '--initial' if env.schemamigration_initial == 'y' else '--auto'
    with virtualenv():
        run(
            'python manage.py schemamigration {} {} --settings={}'.format(
                initial,
                app,
                env.settings_file
            )
        )
Beispiel #8
0
def start():
    with virtualenv():
        run("celery -A {} worker -l info".format(env.name))
Beispiel #9
0
def restart_celery():
    with virtualenv():
        sudo('{}/bin/supervisorctl restart celery'.format(env.virtualenv))
Beispiel #10
0
def collectstatic():
    _verify_aws_keys_are_set()
    require('aws_access_key_id', 'aws_secret_access_key')
    with virtualenv():
        run('python manage.py collectstatic --settings={}'.format(env.settings_file))
Beispiel #11
0
def django_shell():
    with virtualenv():
        run('python manage.py shell --settings={}'.format(env.settings_file))
Beispiel #12
0
def startwsgi():
    with virtualenv():
        args = '-w 9 -k gevent --max-requests 250 --preload --pid={}'.format(
            PID_PATH
        )
        run('python manage.py run_gunicorn 0.0.0.0:8000 --settings={} {}'.format(env.settings_file, args))