1. Installation instructions.


1. prepare python to work with Google Docs API
Read all instructions here: googledocs for python:

Short version:
Try importing the ElementTree module. If you are using Python 2.5 or higher, enter the following in the interpreter:
from xml.etree import ElementTree
If the import fails, then install ElementTree (

Installing the Google Data Library:

# MySQL support for Python
sudo apt-get install libmysqlclient-dev
sudo pip install MySQL-python

# Solr and django-haystack ( are required. Solr also requires pysolr library.
If you prefer not Solr, but some other search engine, read here:

2. Available commands
# runs all tests test 

# runs an embedded web server runserver

# cleans all database from contact data. This does not clean data enetered by users clearAll

3. Creating a database with mysql
# Connect as root
	mysql -u root
# and create database with utf8 character set:
	create database writetothem character set utf8;

4. After installation

# creates database syncdb

# download lithuanian data from google docs ltGeoDataDownloadDocs

# downloads data from google docs to be ready for import: downloadDocs

# imports initial data, such as data, which changes only every years importInitial

# imports other data, which can be updated quite often (even daily) importAll
# after running these four commands you should have your database ready. just call runserver and use browser :)

# update source code on server. First command will download updates from bitbucket (but wont change anything). Second will update to newest changeset and will discard any uncomitted changes
sudo hg pull
sudo hg update --clean

#runing server with nginx and gunicorn. Do not run python with super user 
python run_gunicorn --daemon
# use this to run server with user parasykjiems
sudo -u parasykjiems python run_gunicorn --daemon

# to kill a running gunicorn instance
ps ax | grep    
# or if "setproctitle" python egg is installed (
ps ax | grep gunicorn
sudo kill (process number)

5. Help and bug fixes
If you have any problems setting up the project, or get unexpected exsceptions, dont hesistate to report everything at

This project is part of initiative

Linux for newbies:
To create an admin group and add it to sudoers

%admin ALL=(ALL) ALL

groupadd admin

Create a new user and add user to group admin
useradd username
passwd username
mkdir /home/username
chown username:users /home/username/
usermod -a -G admin username

When server is installed, add these cronjobs to special dedicated user (for example, wtt)
sudo crontab -u parasykjiems -e
45 * * * * /var/www/
5,15,25,35,45,55 * * * * /var/www/