Debian Codegraph @

contrib/virtualenvwrapper/postactivate

raw
1 # postactivate hook for virtualenvwrapper (http://virtualenvwrapper.readthedocs.io/)
2 # Put this file on $WORKON_HOME/<name of the virtual env for this project>/bin/postactivate
3 # This file is sourced after the virtualenv is activated
4
5 PROJECT_DIR=$(cat $VIRTUAL_ENV/$VIRTUALENVWRAPPER_PROJECT_FILENAME)
6
7 cd $PROJECT_DIR
8
9 pip install -r requirements.txt
10
11 mkdir -p $VIRTUAL_ENV/storage/log/webapp $VIRTUAL_ENV/conf
12 touch $VIRTUAL_ENV/conf/carbon.conf $VIRTUAL_ENV/conf/storage-schemas.conf
13 [[ ! -f $VIRTUAL_ENV/conf/graphTemplates.conf ]] && cp conf/graphTemplates.conf.example $VIRTUAL_ENV/conf/graphTemplates.conf
14
15 export GRAPHITE_ROOT=$PROJECT_DIR
16 export GRAPHITE_STORAGE_DIR=$VIRTUAL_ENV/storage/
17 export GRAPHITE_CONF_DIR=$VIRTUAL_ENV/conf/
18
19 unset PROJECT_DIR
20
21 $VIRTUAL_ENV/bin/django-admin.py syncdb --settings=graphite.settings --pythonpath=webapp