Table of Contents
Last modified: October 1, 2012
From github:
git clone git@github.com:mickek/urlannotator.git
<WHATSNEW>
<HOWITWORKS>
- Django>=1.4
- python-memcached
- South
- django-pipeline>=1.2
- ipdb
- ipython
- django-social-auth
- python-odesk
- bootstrap
- docutils
- validictory
- 10clouds/common
- django-celery==3.0.10
- boto
- numpy
- nltk
- django-tastypie
- google-api-python-client
- posix-ipc
- 10clouds/tagasauris-api
- Pillow==1.7.7
- futures
(See deployment/files/requirements/base.txt)
On local machine:
Install easy_install
sudo apt-get install python-setuptools python-dev build-essential rabbitmq-server
Install pip
easy_install pip
Install virtualenv
pip install virtualenv
Pull repository to local filesystem
Create virtualenv
virtualenv .env
Activate virtualenv
source .env/bin/access
Install basic requirements
sudo pip install -r urlannotator/deployment/files/requirements/base.txt
Install PyQt4:
sudo apt-get install python-qt4
Check your python-qt4 version:
sudo apt-cache show python-qt4
If your python-qt4 version is below 4.9.0:
sudo apt-get install python-qt4-dev
sudo apt-get install libqt4-dev
Download and install SIP from http://www.riverbankcomputing.com/software/sip/download via command:
cd /tmp && curl http://www.riverbankcomputing.com/static/Downloads/sip4/sip-4.13.3.tar.gz | tar -zxv && cd /tmp/sip-4.13.3 && python configure.py && sudo make && sudo make install
Download and install python-qt4 from http://www.riverbankcomputing.com/software/pyqt/download via command:
cd /tmp && curl http://www.riverbankcomputing.com/static/Downloads/PyQt4/PyQt-x11-gpl-4.9.4.tar.gz | tar -zxv && cd /tmp/PyQt-x11-gpl-4.9.4 && python configure.py && sudo make && sudo make install
Link PyQt4 and sip.so into your virtual env
ln -s /usr/lib/python2.7/dist-packages/PyQt4 .env/lib/python2.7/site-packages/PyQt4
ln -s /usr/lib/python2.7/dist-packages/sip.so .env/lib/python2.7/site-packages/sip.so
Create database
cd urlannotator
./manage.py syncdb
./manage.py migrate
Create Google Prediction credentials
./manage.py runserver
Install less (>=1.3.0)
sudo apt-get install less
If your distribution's repository has outdated version of less (<1.3.0)
sudo apt-get install npm
- If your distribution's repository has outdated version of npm (<1.0.0), try compiling it npm from sources
Otherwise (npm>=1.0.0)
sudo npm -g install less
Run RabbitMQ if not running
sudo rabbitmq-server -detached
Run celery worker
./manage.py celery worker
On remote machine:
- Follow steps from local machine setup up to the point
Create Google Prediction credentials
Install development requirements
pip install -r urlannotator/deployment/files/requirements/devel.txt
- Configure settings template at deployment/files/django/settings_template.py
- Create local settings file at deployment/files/django/local.py
- Configure deploy configuration at deployment/target_defs
(First time) Setup and deploy to remote host:
cd urlannotator/deployment
fab deploy:conf_file="target_defs/<your_conf_file>.txt",setup_environment=True -H <host> -u <user>
(Consequent deploys) Deploy to remote host:
cd urlannotator/deployment
fab deploy:conf_file="target_defs/<your_conf_file>.txt",requirements=False -H <host> -u <user>
<DB_SETUP>
<CRON_SETUP>
<SUPPORT>