-
-
- {% trans "home" %} - -
# HG changeset patch # User wakimd # Date 1287139132 -7200 # Node ID 9bae869b2146c41d7d890cff6f397bed8fe59df0 # Parent 9927a619d2b59d8621ba2554fba05dfc3d84bbe7# Parent 0325a0a8b9971f94c0db8e900bd0c62bb08cd75e Merge diff -r 0325a0a8b997 -r 9bae869b2146 .hgignore --- a/.hgignore Fri Oct 15 11:58:37 2010 +0200 +++ b/.hgignore Fri Oct 15 12:38:52 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/.*$ diff -r 0325a0a8b997 -r 9bae869b2146 README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README Fri Oct 15 12:38:52 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 diff -r 0325a0a8b997 -r 9bae869b2146 web/franceculture/.htaccess.mod_python.tmpl --- a/web/franceculture/.htaccess.mod_python.tmpl Fri Oct 15 11:58:37 2010 +0200 +++ b/web/franceculture/.htaccess.mod_python.tmpl Fri Oct 15 12:38:52 2010 +0200 @@ -3,10 +3,10 @@ SetEnv DJANGO_SETTINGS_MODULE franceculture.settings SetEnv PY_USE_XMLPLUS true PythonInterpreter franceculture -PythonOption django.root /~ymh/franceculture/franceculture -PythonOption virtualenv.activate_path /Users/ymh/dev/workspace/franceculture/sbin/virtualenv/env/venv/bin/activate_this.py +PythonOption django.root /~wakimd/franceculture/franceculture +PythonOption virtualenv.activate_path /iridata/users/wakimd/Env/Efculture/bin/activate_this.py PythonDebug on -PythonPath "['/Users/ymh/Sites/franceculture'] + sys.path" +PythonPath "['/iridata/users/wakimd/Env/Efculture/lib/python2.6/sites-packages'] + sys.path" Header set Pragma "no-cache" Header set Cache-Control "no-cache" Header set Expires "-1" diff -r 0325a0a8b997 -r 9bae869b2146 web/franceculture/templates/base.html --- a/web/franceculture/templates/base.html Fri Oct 15 11:58:37 2010 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,87 +0,0 @@ -{% extends "raw_base.html" %} -{% load i18n %} -{% load logintag %} -{% load navigation %} - -{% block js_import %} - {{ block.super }} - - - -{% endblock %} - -{% block css_import %} - {{ block.super }} - - - -{% endblock %} - -{% block body %} - {{ block.super }} -
- {{ embed_rendered.player }}
- {{ embed_rendered.seo_body }}
- {{ embed_rendered.seo_meta }}
-
-
- ![]() |
- ![]() |
- {{ content.title|default:"_" }} | -
![]() |
- ![]() |
- ![]() |
-
- {% ifequal project.state 2 %}
- |
- - {% ifequal project.state 2 %} - {{ project.title }} - {% else %} - {{ project.title }} - {% endifequal %} - | -






{% trans "The operation could not be performed because one or more error(s) occurred.
Please resubmit the content form after making the following changes:" %}
{% trans "The operation could not be performed because one or more error(s) occurred.
Please resubmit the media form after making the following changes:" %}


The operation could not be performed because one or more error(s) occurred.
Please resubmit the form after making the following changes:
The operation could not be performed because one or more error(s) occurred.
Please resubmit the form after making the following changes:
{% trans "The operation could not be performed because one or more error(s) occurred.
Please resubmit the content form after making the following changes:" %}
{% trans "The operation could not be performed because one or more error(s) occurred.
Please resubmit the media form after making the following changes:" %}
+ {{ embed_rendered.player }}
+ {{ embed_rendered.seo_body }}
+ {{ embed_rendered.seo_meta }}
+
+
+