<commit_before><commit_msg>psycopg2 install notes.<commit_after># Studlan #

## README.postgres ##

Install notes if you want to use Postgresql when deploying Studlan. 

## Basic for any install ##

1. apt-get build-dep python-psycopg2 (non Debian/Ubuntu need to fix headers for psycopg2 python bindings and postgresql themself!)

2. source virtualenv (which is a «virtualenv --no-site-packages»)

3. pip install egenix-mx-base (fixes: django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 module: can't import mx.DateTime module for Django version < 1.4. Not bad to have for latest django either ...)

## Django 1.4>= ##

4. pip install psycopg2 

## Django Django1.3 or less ##

TODO: Figure out how to pass "-I/virtualenv/full/path/site-packages/mx" so psycopg2 builds postgres python adapter with bindings from egenix-mx-base (mx.DateTime) in our virtualenv.
WARNING: Wont work before TODO fixed for Django1.3... be free to figure it out or just be a good boy and use lateast Django 1.4!
DOH: Shouldn't really care about this issue as it is Django 1.2 in Debian Squeeze (current stable) and Debian Wheezy which is next stable will have Django 1.4 anyway!

4. pip install psycopg2==2.4.1
{'fraction_non_alphanumeric': 0.08554817275747509, 'fraction_numerical': 0.02408637873754153, 'mean_word_length': 4.171673819742489, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1411031', 'n_tokens_mistral': 393, 'n_tokens_neox': 365, 'n_words': 162}