wiki:ThiblopyInstallation

Thiblo.py written in  Python and uses  Django web framework.

Required packages

Assuming you are running Debian or Ubuntu, you will need the following packages installed:

  • python
  • apache2-mpm-prefork
  • libapache2-mod-python
  • python-yaml
  • postgresql
  • python-psycopg2

As of this writing Thiblo.py requires Django features not present in any stable release, so you will need the latest development version from SVN.

svn co http://code.djangoproject.com/svn/django/trunk/ django
cd django
sudo python setup.py install

See  http://www.djangoproject.com/documentation/install/ for further details.

Installation and configuration

Checkout code

svn co svn+ssh://thiblo.com/thiblopy thiblopy

You need to create PostgreSQL database for Thiblo.

Then go to checkout directory and create file .mysettings.py with the following content:

DATABASE_ENGINE = 'postgresql_psycopg2'
DATABASE_NAME = 'thiblo'
DATABASE_USER = 'thiblo'
DATABASE_PASSWORD = 'password'
DATABASE_HOST = '' # leave blank for localhost connection
DATABASE_PORT = '5432'
SECRET_KEY = 'long secret sequence of characters'

Change values as appropriate to your database configuration.

Now, run

./manage.py syncdb

This will create database schema.

Test data stored in YAML format with actual content in separate html files nearby.

Run ./manage.py shell. This will bring up Django interactive console. Type the following:

>>> from serializers.legacy import *
>>> load_file('/path/to/thiblopy/initial-data/base.yaml')

See  http://www.djangoproject.com/documentation/modpython/ for details how to configure mod_python to work with Django. In most cases, you can simply add the following lines to your Apache config:

<VirtualHost *>
   DocumentRoot /path/to/thiblopy
   ServerName thiblo.dev
   ServerAlias www.thiblo.dev

   SetHandler python-program
   PythonHandler django.core.handlers.modpython
   SetEnv DJANGO_SETTINGS_MODULE thiblopy.settings
   PythonDebug On
   PythonPath "['/path/to'] + sys.path" # path without 'thiblopy'

   <Location "/account/gwt">
      SetHandler None
   </Location>

   <Location "/media">
      SetHandler None
   </Location>

   <Directory />
      Order Allow,Deny
      Allow from all
   </Directory>
</VirtualHost>