from fabric.api import run, env, cd, prefix
from tuistudio import config


def deploy():
    env.host_string = config.HOST_STRING
    with cd('/var/www/project'):
        run('git pull')
        run('bower install')
        run('bower update')
        with prefix('source venv/bin/activate'):
            run('pip install -r requirements.txt')
        run('sudo supervisorctl restart project')


def restart():
    env.host_string = config.HOST_STRING
    run('sudo supervisorctl restart project')
@@ -206,16 +206,29 @@
  install
+ --allow-root
 ')%0A     
@@ -247,16 +247,29 @@
 r update
+ --allow-root
 ')%0A     

add --allow-root to bower