--- a/.hgignore Wed Oct 06 10:50:27 2010 +0200
+++ b/.hgignore Thu Oct 14 12:17:31 2010 +0200
@@ -7,8 +7,12 @@
^web/franceculture/config\.py$
^web/static/media/
^sbin/virtualenv/distribute.*\.tar\.gz$
+^.*\.pyc$
+^.*\.old$
+^.*\.orig$
syntax: regexp
^web/franceculture/modwsgi\.wsgi$
syntax: regexp
-^web/log/log\.txt$
\ No newline at end of file
+^web/log/log\.txt$
+^web/index/.*$
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README Thu Oct 14 12:17:31 2010 +0200
@@ -0,0 +1,119 @@
+==============================
+France Culture - Ubuntu 10.04
+==============================
+
+1 - Database creation
+2 - Virtualenv installation
+3 - Settings
+4 - Database synchronization
+5 - .htaccess files
+6 - WSGI script file
+
+
+1 - Database creation
+======================
+Create a database in Postgres:
+ createdb -U username -W -h 127.0.0.1 d
+
+Access to te database in Postgres:
+ psql -U username -W -h 127.0.0.1 dbname
+
+\d to view the list of all relations
+
+
+2 - Virtualenv installation
+============================
+Run the bootstrap script generator:
+ python create_python_env.py
+
+Run project-boot.py this way:
+ python hg/franceculture/sbin/virtualenv/project-boot.py --no-site-packages --setuptools --unzip-setuptools --type-install=local --ignore-packages=MYSQL path/to/env/Env
+
+To activate the environment:
+ source path/to/env/Env/bin/activate
+
+
+
+3 - Settings
+=============
+Enter the db settings in franceculture/web/franceculture/config.py:
+DATABASES = {
+ 'default': {
+ 'ENGINE': 'django.db.backends.postgresql_psycopg2',
+ 'NAME': 'dbFrC',
+ 'USER': 'iriuser',
+ 'PASSWORD': 'iriuser',
+ 'HOST': 'localhost',
+ 'PORT': '5432',
+ }
+}
+
+Change the URL paths:
+BASE_URL = '/dev/~user/franceculture/'
+WEB_URL = 'http://www.iri.centrepompidou.fr/'
+
+
+In your public_html, create a symbolic link that points to the application:
+ ln -s path/to/project/franceculture franceculture
+
+
+4 - Database synchronization
+=============================
+Synchronize the database, in franceculture/web/franceculture:
+ python manage.py syncdb
+
+
+5 - .htaccess files
+====================
+Write franceculture/web/.htaccess:
+
+# Permanent redirection to franceculture/franculture
+RedirectMatch permanent /~user/franceculture/?$ /~user/franceculture/franceculture
+
+
+Write franceculture/web/franceculture/.htaccess:
+
+# Set environmental variables used in the wsgi file
+SetEnv DJANGO_SETTINGS_MODULE franceculture.settings
+SetEnv PY_USE_XMLPLUS true
+SetEnv PROJECT_PATH /path/to/project/franceculture/web
+SetEnv PYTHON_PATH /path/to/virtual/environment/Env/lib/python2.6/site-packages
+
+Options ExecCGI FollowSymLinks
+SetHandler wsgi-script
+
+RewriteEngine On
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^(.*)$ /path/to/wsgiscript/modwsgi.wsgi/$1 [QSA,PT,L]
+
+# html cache options
+Header set Pragma "no-cache"
+Header set Cache-Control "no-cache"
+Header set Expires "-1"
+
+
+
+6 - WSGI script file
+======================
+
+Write the WSGI file modwsgi.wsgi
+
+import os, sys, site
+
+def application(environ, start_response):
+ os.environ['DJANGO_SETTINGS_MODULE'] = environ['DJANGO_SETTINGS_MODULE']
+ os.environ['PY_USE_XMLPLUS'] = environ['PY_USE_XMLPLUS']
+
+ sys.path.append(environ['PROJECT_PATH'])
+ site.addsitedir(environ['PYTHON_PATH'])
+
+ import django.core.handlers.wsgi
+ _application = django.core.handlers.wsgi.WSGIHandler()
+
+ return _application(environ, start_response)
+
+
+Notes:
+- The 'environ' argument is unrelated to the 'os.environ' argument. It catches the variables that were defined with 'SetEnv' in the .htaccess file.
+- 'sys.path.append' adds the project path to the PYTHONPATH
+- 'site.addsitedir' activates the virtual environment