Tags

Continuing with Installation…..

Make sure you activate the virtual environment.

$ source ~/virtual_environments/formhub/bin/activate

Note that the prompt starts with ‘(formhub)’, e.g (formhub)xxxxx@ubuntu:

1. Install requirements
Requirements file contains all packages needed to create an environment.It will install all the Bamboo and Django code

NumPy = package for scientific computing with Python Here it is installed first before going ahead with Formhub installation..

pip install numpy  --use-mirrors
pip install -r requirements.pip

Got an error during Install requirements.
“fatal error libxml/xmlversion.h: No such file or directory”
Compilation terminated
error: command ‘gcc’ failed with exit status 1

sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev 

2. Check if Python can find Django by executing the command below

python -c 'import django; print "django is installed"'

Success !!

3. Create local_settings.py

cd formhub 
cp local_settings.py.example local_settings.py

4. continue

$ python manage.py syncdb --noinput
$ python manage.py migrate

5. Configure the Celery daemon; Move daemon to etc/init.d dir

$ sudo cp ~/src/formhub-app/formhub/extras/celeryd/etc/init.d/celeryd /etc/init.d/celeryd
$ sudo cp ~/src/formhub-app/formhub/extras/celeryd/etc/default/celeryd /etc/default/celeryd

6. Test environment and installation

python manage.py test

Error Jpeg decode error

$ sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/
$ sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/
$ pip install -I PIL

This installs python imaging library

7. Run webserver

$ python manage.py runserver

Could not access the webserver from host machine even though the other webserver running apache can be accessed. Ping to the Ubuntu ip address works from host

Solution:
python manage.py runserver has a documented optional argument ipaddr:port. Setting this to Ubuntu IP (instead of the default 127.0.0.1) will fix this or python manage.py runserver 0.0.0.0:8000

8. Access server from host.
http://your ip here:8000/

Advertisements