From 8ccdaf23128fbe563658ca0d9d74d2ffd831b68d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 15 Feb 2012 01:34:53 +0100 Subject: Main refactoring vor version 2 - convert doc to rest and use sphinx --- apache/apache-wsgi.conf | 13 ++ apache/django.wsgi | 5 + chimere/default_settings.py | 158 ++++++++++++++ chimere/fixtures/initial_data.json | 53 +++++ chimere/initial_data.json | 53 ----- chimere/settings.py.example | 158 -------------- docs/Makefile | 130 +++++++++++ docs/conf.py | 216 ++++++++++++++++++ docs/en/INSTALL.t2t | 324 --------------------------- docs/en/UPGRADE.t2t | 165 -------------- docs/fr/documentation-utilisateur.t2t | 185 ---------------- docs/generate | 21 -- docs/index.rst | 23 ++ docs/install.rst | 352 ++++++++++++++++++++++++++++++ docs/old/en/INSTALL.t2t | 324 +++++++++++++++++++++++++++ docs/old/en/UPGRADE.t2t | 165 ++++++++++++++ docs/old/fr/documentation-utilisateur.t2t | 185 ++++++++++++++++ docs/old/generate | 21 ++ docs/old/style.css | 67 ++++++ docs/style.css | 67 ------ docs/upgrade.rst | 190 ++++++++++++++++ 21 files changed, 1902 insertions(+), 973 deletions(-) create mode 100644 apache/apache-wsgi.conf create mode 100644 apache/django.wsgi create mode 100644 chimere/default_settings.py create mode 100644 chimere/fixtures/initial_data.json delete mode 100644 chimere/initial_data.json delete mode 100644 chimere/settings.py.example create mode 100644 docs/Makefile create mode 100644 docs/conf.py delete mode 100644 docs/en/INSTALL.t2t delete mode 100644 docs/en/UPGRADE.t2t delete mode 100644 docs/fr/documentation-utilisateur.t2t delete mode 100755 docs/generate create mode 100644 docs/index.rst create mode 100644 docs/install.rst create mode 100644 docs/old/en/INSTALL.t2t create mode 100644 docs/old/en/UPGRADE.t2t create mode 100644 docs/old/fr/documentation-utilisateur.t2t create mode 100755 docs/old/generate create mode 100644 docs/old/style.css delete mode 100644 docs/style.css create mode 100644 docs/upgrade.rst diff --git a/apache/apache-wsgi.conf b/apache/apache-wsgi.conf new file mode 100644 index 0000000..57bd438 --- /dev/null +++ b/apache/apache-wsgi.conf @@ -0,0 +1,13 @@ + + ServerName chimere.example.com + WSGIDaemonProcess chimere processes=2 maximum-requests=500 threads=1 + WSGIProcessGroup chimere + WSGIScriptAlias / /var/local/chimere/chimere/apache/django.wsgi + Alias /static "/var/local/chimere/chimere/static" + Alias /tinymce "/usr/share/tinymce/www" + + ErrorLog ${APACHE_LOG_DIR}/chimere/error.log + LogLevel warn + CustomLog ${APACHE_LOG_DIR}/chimere/access.log combined + + diff --git a/apache/django.wsgi b/apache/django.wsgi new file mode 100644 index 0000000..158f87d --- /dev/null +++ b/apache/django.wsgi @@ -0,0 +1,5 @@ +import os, sys +sys.path.append('/var/local/django/chimere/') +os.environ['DJANGO_SETTINGS_MODULE'] = 'chimere.settings' +import django.core.handlers.wsgi +application = django.core.handlers.wsgi.WSGIHandler() diff --git a/chimere/default_settings.py b/chimere/default_settings.py new file mode 100644 index 0000000..5a1d1fe --- /dev/null +++ b/chimere/default_settings.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +# Django settings for chimere project. +PROJECT_NAME = u'Chimère' + +ROOT_PATH = '/var/local/django/chimere/' + +SERVER_URL = "http://www.peacefrogs.net/" +EXTRA_URL = 'chimere/' +BASE_URL = SERVER_URL + EXTRA_URL +EMAIL_HOST = 'localhost' + +TINYMCE_URL = SERVER_URL + 'tinymce/' +JQUERY_URL = SERVER_URL + 'jquery/jquery-1.4.4.min.js' +GPSBABEL = '/usr/bin/gpsbabel' +GPSBABEL_OPTIONS = 'simplify,crosstrack,error=0.005k' # simplify with an + # error of 5 meters +#GPSBABEL_OPTIONS = 'simplify,count=100' + +## chimere specific ## +# center of the map +DEFAULT_CENTER = (-1.679444, 48.114722) +# projection used by the main map +# most public map providers use spherical mercator : 900913 +EPSG_PROJECTION = 900913 +# projection displayed to the end user by openlayers +# chimere use the same projection to save its data in the database +EPSG_DISPLAY_PROJECTION = 4326 +# to restrict the map to a defined bounding box set it here +# (left, bottom, right, top) +RESTRICTED_EXTENT = None +# dynamic load of categories on the main map +DYNAMIC_CATEGORIES = False +# display of shortcuts for areas +DISPLAY_AREAS = True +# specific css for areas +CSS_AREAS = True +# number of day before an event to display +# if equal to 0: disable event management +# if you change this value from 0 to a value in a production environnement +# don't forget to run the upgrade.py script to create appropriate fields in +# the database +DAYS_BEFORE_EVENT = 30 + +# default id category to check on the map +DEFAULT_CATEGORIES = [1] + +# JS definition of the main map cf. OpenLayers documentation for more details +#MAP_LAYER = '''new OpenLayers.Layer.OSM.CycleMap("Cycle map", { +#displayOutsideMaxExtent: true, wrapDateLine: true})''' # OSM cyclemap +MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')" # OSM mapnik map + +DEBUG = True +TEMPLATE_DEBUG = DEBUG + +ADMINS = ( + # ('Your Name', 'your_email@domain.com'), +) + +MANAGERS = ADMINS + +DATABASES = { + 'default': { + 'NAME': 'ratatouille', + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'HOST': 'localhost', + 'PORT': '5432', + 'USER': 'ratatouille', + 'PASSWORD': 'wiki', + }, +} + +# Local time zone for this installation. Choices can be found here: +# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE +# although not all variations may be possible on all operating systems. +# If running in a Windows environment this must be set to the same as your +# system time zone. +TIME_ZONE = 'Europe/Paris' + +# Language code for this installation. All choices can be found here: +# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes +# http://blogs.law.harvard.edu/tech/stories/storyReader$15 +LANGUAGE_CODE = 'fr-fr' + +SITE_ID = 1 + +# If you set this to False, Django will make some optimizations so as not +# to load the internationalization machinery. +USE_I18N = True +USE_L10N = True + +# Absolute path to the directory that holds media. +# Example: "/home/media/media.lawrence.com/" +MEDIA_ROOT = ROOT_PATH + 'static/' + +# URL that handles the media served from MEDIA_ROOT. +# Example: "http://media.lawrence.com" +MEDIA_URL = '/' + EXTRA_URL + 'static/' + +# share with +SHARE_NETWORKS = ( +("Email", 'mailto:?subject=%(text)s&body=%(url)s', + MEDIA_URL + 'icons/email.png'), +("Facebook", 'http://www.facebook.com/sharer.php?t=%(text)s&u=%(url)s', + MEDIA_URL + 'icons/facebook.png'), +("Twitter", 'http://twitter.com/home?status=%(text)s %(url)s', + MEDIA_URL + 'icons/twitter.png'), +("Identi.ca", 'http://identi.ca/index.php?action=newnotice&status_textarea=%(text)s %(url)s', + MEDIA_URL + 'icons/identica.png'), +) + +# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a +# trailing slash. +# Examples: "http://foo.com/media/", "/media/". +ADMIN_MEDIA_PREFIX = '/' + EXTRA_URL + 'media/' + +# Make this unique, and don't share it with anybody. +SECRET_KEY = 'achanger_!ToChange!' + +# List of callables that know how to import templates from various sources. +TEMPLATE_LOADERS = ( + 'django.template.loaders.filesystem.load_template_source', + 'django.template.loaders.app_directories.load_template_source', +# 'django.template.loaders.eggs.load_template_source', +) + +MIDDLEWARE_CLASSES = ( + 'django.middleware.common.CommonMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.middleware.doc.XViewMiddleware', +) + +ROOT_URLCONF = 'chimere.urls' + +TEMPLATE_DIRS = [ + # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + ROOT_PATH + 'templates', +] + +INSTALLED_APPS = ( + 'django.contrib.auth', + 'django.contrib.admin', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.sites', + 'chimere.main', + # activate it if you want to use migration scripts + 'chimere.scripts', + # activate it if you want to use RSS feeds + 'chimere.rss' +) + +if 'chimere.rss' in INSTALLED_APPS: + TEMPLATE_DIRS.append(ROOT_PATH + 'rss/templates') diff --git a/chimere/fixtures/initial_data.json b/chimere/fixtures/initial_data.json new file mode 100644 index 0000000..f181244 --- /dev/null +++ b/chimere/fixtures/initial_data.json @@ -0,0 +1,53 @@ +[{"pk": 13, "model": "auth.permission", "fields": {"codename": "add_logentry", "name": "Can add log entry", "content_type": 5}}, + {"pk": 14, "model": "auth.permission", "fields": {"codename": "change_logentry", "name": "Can change log entry", "content_type": 5}}, + {"pk": 15, "model": "auth.permission", "fields": {"codename": "delete_logentry", "name": "Can delete log entry", "content_type": 5}}, + {"pk": 4, "model": "auth.permission", "fields": {"codename": "add_group", "name": "Can add group", "content_type": 2}}, + {"pk": 10, "model": "auth.permission", "fields": {"codename": "add_message", "name": "Can add message", "content_type": 4}}, + {"pk": 1, "model": "auth.permission", "fields": {"codename": "add_permission", "name": "Can add permission", "content_type": 1}}, + {"pk": 7, "model": "auth.permission", "fields": {"codename": "add_user", "name": "Can add user", "content_type": 3}}, + {"pk": 5, "model": "auth.permission", "fields": {"codename": "change_group", "name": "Can change group", "content_type": 2}}, + {"pk": 11, "model": "auth.permission", "fields": {"codename": "change_message", "name": "Can change message", "content_type": 4}}, + {"pk": 2, "model": "auth.permission", "fields": {"codename": "change_permission", "name": "Can change permission", "content_type": 1}}, + {"pk": 8, "model": "auth.permission", "fields": {"codename": "change_user", "name": "Can change user", "content_type": 3}}, + {"pk": 6, "model": "auth.permission", "fields": {"codename": "delete_group", "name": "Can delete group", "content_type": 2}}, + {"pk": 12, "model": "auth.permission", "fields": {"codename": "delete_message", "name": "Can delete message", "content_type": 4}}, + {"pk": 3, "model": "auth.permission", "fields": {"codename": "delete_permission", "name": "Can delete permission", "content_type": 1}}, + {"pk": 9, "model": "auth.permission", "fields": {"codename": "delete_user", "name": "Can delete user", "content_type": 3}}, + {"pk": 16, "model": "auth.permission", "fields": {"codename": "add_contenttype", "name": "Can add content type", "content_type": 6}}, + {"pk": 17, "model": "auth.permission", "fields": {"codename": "change_contenttype", "name": "Can change content type", "content_type": 6}}, + {"pk": 18, "model": "auth.permission", "fields": {"codename": "delete_contenttype", "name": "Can delete content type", "content_type": 6}}, + {"pk": 43, "model": "auth.permission", "fields": {"codename": "add_area", "name": "Can add Area", "content_type": 15}}, + {"pk": 28, "model": "auth.permission", "fields": {"codename": "add_category", "name": "Can add Category", "content_type": 10}}, + {"pk": 31, "model": "auth.permission", "fields": {"codename": "add_icon", "name": "Can add Icon", "content_type": 11}}, + {"pk": 37, "model": "auth.permission", "fields": {"codename": "add_marker", "name": "Can add Point of interest", "content_type": 13}}, + {"pk": 25, "model": "auth.permission", "fields": {"codename": "add_news", "name": "Can add News", "content_type": 9}}, + {"pk": 49, "model": "auth.permission", "fields": {"codename": "add_property", "name": "Can add Property", "content_type": 17}}, + {"pk": 46, "model": "auth.permission", "fields": {"codename": "add_propertymodel", "name": "Can add Property model", "content_type": 16}}, + {"pk": 40, "model": "auth.permission", "fields": {"codename": "add_route", "name": "Can add Route", "content_type": 14}}, + {"pk": 34, "model": "auth.permission", "fields": {"codename": "add_subcategory", "name": "Can add Subcategory", "content_type": 12}}, + {"pk": 44, "model": "auth.permission", "fields": {"codename": "change_area", "name": "Can change Area", "content_type": 15}}, + {"pk": 29, "model": "auth.permission", "fields": {"codename": "change_category", "name": "Can change Category", "content_type": 10}}, + {"pk": 32, "model": "auth.permission", "fields": {"codename": "change_icon", "name": "Can change Icon", "content_type": 11}}, + {"pk": 38, "model": "auth.permission", "fields": {"codename": "change_marker", "name": "Can change Point of interest", "content_type": 13}}, + {"pk": 26, "model": "auth.permission", "fields": {"codename": "change_news", "name": "Can change News", "content_type": 9}}, + {"pk": 50, "model": "auth.permission", "fields": {"codename": "change_property", "name": "Can change Property", "content_type": 17}}, + {"pk": 47, "model": "auth.permission", "fields": {"codename": "change_propertymodel", "name": "Can change Property model", "content_type": 16}}, + {"pk": 41, "model": "auth.permission", "fields": {"codename": "change_route", "name": "Can change Route", "content_type": 14}}, + {"pk": 35, "model": "auth.permission", "fields": {"codename": "change_subcategory", "name": "Can change Subcategory", "content_type": 12}}, + {"pk": 45, "model": "auth.permission", "fields": {"codename": "delete_area", "name": "Can delete Area", "content_type": 15}}, + {"pk": 30, "model": "auth.permission", "fields": {"codename": "delete_category", "name": "Can delete Category", "content_type": 10}}, + {"pk": 33, "model": "auth.permission", "fields": {"codename": "delete_icon", "name": "Can delete Icon", "content_type": 11}}, + {"pk": 39, "model": "auth.permission", "fields": {"codename": "delete_marker", "name": "Can delete Point of interest", "content_type": 13}}, + {"pk": 27, "model": "auth.permission", "fields": {"codename": "delete_news", "name": "Can delete News", "content_type": 9}}, + {"pk": 51, "model": "auth.permission", "fields": {"codename": "delete_property", "name": "Can delete Property", "content_type": 17}}, + {"pk": 48, "model": "auth.permission", "fields": {"codename": "delete_propertymodel", "name": "Can delete Property model", "content_type": 16}}, + {"pk": 42, "model": "auth.permission", "fields": {"codename": "delete_route", "name": "Can delete Route", "content_type": 14}}, + {"pk": 36, "model": "auth.permission", "fields": {"codename": "delete_subcategory", "name": "Can delete Subcategory", "content_type": 12}}, + {"pk": 19, "model": "auth.permission", "fields": {"codename": "add_session", "name": "Can add session", "content_type": 7}}, + {"pk": 20, "model": "auth.permission", "fields": {"codename": "change_session", "name": "Can change session", "content_type": 7}}, + {"pk": 21, "model": "auth.permission", "fields": {"codename": "delete_session", "name": "Can delete session", "content_type": 7}}, + {"pk": 22, "model": "auth.permission", "fields": {"codename": "add_site", "name": "Can add site", "content_type": 8}}, + {"pk": 23, "model": "auth.permission", "fields": {"codename": "change_site", "name": "Can change site", "content_type": 8}}, + {"pk": 24, "model": "auth.permission", "fields": {"codename": "delete_site", "name": "Can delete site", "content_type": 8}}, + {"pk": 1, "model": "auth.group", "fields": {"name": "Moderator", "permissions": [37, 40, 38, 41, 39, 42, 49, 50, 51]}}, + {"pk": 2, "model": "auth.group", "fields": {"name": "Application administrator", "permissions": [49, 50, 51, 43, 28, 31, 37, 25, 40, 34, 44, 29, 32, 38, 26, 41, 35, 45, 30, 33, 39, 27, 42, 36]}}] diff --git a/chimere/initial_data.json b/chimere/initial_data.json deleted file mode 100644 index f181244..0000000 --- a/chimere/initial_data.json +++ /dev/null @@ -1,53 +0,0 @@ -[{"pk": 13, "model": "auth.permission", "fields": {"codename": "add_logentry", "name": "Can add log entry", "content_type": 5}}, - {"pk": 14, "model": "auth.permission", "fields": {"codename": "change_logentry", "name": "Can change log entry", "content_type": 5}}, - {"pk": 15, "model": "auth.permission", "fields": {"codename": "delete_logentry", "name": "Can delete log entry", "content_type": 5}}, - {"pk": 4, "model": "auth.permission", "fields": {"codename": "add_group", "name": "Can add group", "content_type": 2}}, - {"pk": 10, "model": "auth.permission", "fields": {"codename": "add_message", "name": "Can add message", "content_type": 4}}, - {"pk": 1, "model": "auth.permission", "fields": {"codename": "add_permission", "name": "Can add permission", "content_type": 1}}, - {"pk": 7, "model": "auth.permission", "fields": {"codename": "add_user", "name": "Can add user", "content_type": 3}}, - {"pk": 5, "model": "auth.permission", "fields": {"codename": "change_group", "name": "Can change group", "content_type": 2}}, - {"pk": 11, "model": "auth.permission", "fields": {"codename": "change_message", "name": "Can change message", "content_type": 4}}, - {"pk": 2, "model": "auth.permission", "fields": {"codename": "change_permission", "name": "Can change permission", "content_type": 1}}, - {"pk": 8, "model": "auth.permission", "fields": {"codename": "change_user", "name": "Can change user", "content_type": 3}}, - {"pk": 6, "model": "auth.permission", "fields": {"codename": "delete_group", "name": "Can delete group", "content_type": 2}}, - {"pk": 12, "model": "auth.permission", "fields": {"codename": "delete_message", "name": "Can delete message", "content_type": 4}}, - {"pk": 3, "model": "auth.permission", "fields": {"codename": "delete_permission", "name": "Can delete permission", "content_type": 1}}, - {"pk": 9, "model": "auth.permission", "fields": {"codename": "delete_user", "name": "Can delete user", "content_type": 3}}, - {"pk": 16, "model": "auth.permission", "fields": {"codename": "add_contenttype", "name": "Can add content type", "content_type": 6}}, - {"pk": 17, "model": "auth.permission", "fields": {"codename": "change_contenttype", "name": "Can change content type", "content_type": 6}}, - {"pk": 18, "model": "auth.permission", "fields": {"codename": "delete_contenttype", "name": "Can delete content type", "content_type": 6}}, - {"pk": 43, "model": "auth.permission", "fields": {"codename": "add_area", "name": "Can add Area", "content_type": 15}}, - {"pk": 28, "model": "auth.permission", "fields": {"codename": "add_category", "name": "Can add Category", "content_type": 10}}, - {"pk": 31, "model": "auth.permission", "fields": {"codename": "add_icon", "name": "Can add Icon", "content_type": 11}}, - {"pk": 37, "model": "auth.permission", "fields": {"codename": "add_marker", "name": "Can add Point of interest", "content_type": 13}}, - {"pk": 25, "model": "auth.permission", "fields": {"codename": "add_news", "name": "Can add News", "content_type": 9}}, - {"pk": 49, "model": "auth.permission", "fields": {"codename": "add_property", "name": "Can add Property", "content_type": 17}}, - {"pk": 46, "model": "auth.permission", "fields": {"codename": "add_propertymodel", "name": "Can add Property model", "content_type": 16}}, - {"pk": 40, "model": "auth.permission", "fields": {"codename": "add_route", "name": "Can add Route", "content_type": 14}}, - {"pk": 34, "model": "auth.permission", "fields": {"codename": "add_subcategory", "name": "Can add Subcategory", "content_type": 12}}, - {"pk": 44, "model": "auth.permission", "fields": {"codename": "change_area", "name": "Can change Area", "content_type": 15}}, - {"pk": 29, "model": "auth.permission", "fields": {"codename": "change_category", "name": "Can change Category", "content_type": 10}}, - {"pk": 32, "model": "auth.permission", "fields": {"codename": "change_icon", "name": "Can change Icon", "content_type": 11}}, - {"pk": 38, "model": "auth.permission", "fields": {"codename": "change_marker", "name": "Can change Point of interest", "content_type": 13}}, - {"pk": 26, "model": "auth.permission", "fields": {"codename": "change_news", "name": "Can change News", "content_type": 9}}, - {"pk": 50, "model": "auth.permission", "fields": {"codename": "change_property", "name": "Can change Property", "content_type": 17}}, - {"pk": 47, "model": "auth.permission", "fields": {"codename": "change_propertymodel", "name": "Can change Property model", "content_type": 16}}, - {"pk": 41, "model": "auth.permission", "fields": {"codename": "change_route", "name": "Can change Route", "content_type": 14}}, - {"pk": 35, "model": "auth.permission", "fields": {"codename": "change_subcategory", "name": "Can change Subcategory", "content_type": 12}}, - {"pk": 45, "model": "auth.permission", "fields": {"codename": "delete_area", "name": "Can delete Area", "content_type": 15}}, - {"pk": 30, "model": "auth.permission", "fields": {"codename": "delete_category", "name": "Can delete Category", "content_type": 10}}, - {"pk": 33, "model": "auth.permission", "fields": {"codename": "delete_icon", "name": "Can delete Icon", "content_type": 11}}, - {"pk": 39, "model": "auth.permission", "fields": {"codename": "delete_marker", "name": "Can delete Point of interest", "content_type": 13}}, - {"pk": 27, "model": "auth.permission", "fields": {"codename": "delete_news", "name": "Can delete News", "content_type": 9}}, - {"pk": 51, "model": "auth.permission", "fields": {"codename": "delete_property", "name": "Can delete Property", "content_type": 17}}, - {"pk": 48, "model": "auth.permission", "fields": {"codename": "delete_propertymodel", "name": "Can delete Property model", "content_type": 16}}, - {"pk": 42, "model": "auth.permission", "fields": {"codename": "delete_route", "name": "Can delete Route", "content_type": 14}}, - {"pk": 36, "model": "auth.permission", "fields": {"codename": "delete_subcategory", "name": "Can delete Subcategory", "content_type": 12}}, - {"pk": 19, "model": "auth.permission", "fields": {"codename": "add_session", "name": "Can add session", "content_type": 7}}, - {"pk": 20, "model": "auth.permission", "fields": {"codename": "change_session", "name": "Can change session", "content_type": 7}}, - {"pk": 21, "model": "auth.permission", "fields": {"codename": "delete_session", "name": "Can delete session", "content_type": 7}}, - {"pk": 22, "model": "auth.permission", "fields": {"codename": "add_site", "name": "Can add site", "content_type": 8}}, - {"pk": 23, "model": "auth.permission", "fields": {"codename": "change_site", "name": "Can change site", "content_type": 8}}, - {"pk": 24, "model": "auth.permission", "fields": {"codename": "delete_site", "name": "Can delete site", "content_type": 8}}, - {"pk": 1, "model": "auth.group", "fields": {"name": "Moderator", "permissions": [37, 40, 38, 41, 39, 42, 49, 50, 51]}}, - {"pk": 2, "model": "auth.group", "fields": {"name": "Application administrator", "permissions": [49, 50, 51, 43, 28, 31, 37, 25, 40, 34, 44, 29, 32, 38, 26, 41, 35, 45, 30, 33, 39, 27, 42, 36]}}] diff --git a/chimere/settings.py.example b/chimere/settings.py.example deleted file mode 100644 index 5a1d1fe..0000000 --- a/chimere/settings.py.example +++ /dev/null @@ -1,158 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -# Django settings for chimere project. -PROJECT_NAME = u'Chimère' - -ROOT_PATH = '/var/local/django/chimere/' - -SERVER_URL = "http://www.peacefrogs.net/" -EXTRA_URL = 'chimere/' -BASE_URL = SERVER_URL + EXTRA_URL -EMAIL_HOST = 'localhost' - -TINYMCE_URL = SERVER_URL + 'tinymce/' -JQUERY_URL = SERVER_URL + 'jquery/jquery-1.4.4.min.js' -GPSBABEL = '/usr/bin/gpsbabel' -GPSBABEL_OPTIONS = 'simplify,crosstrack,error=0.005k' # simplify with an - # error of 5 meters -#GPSBABEL_OPTIONS = 'simplify,count=100' - -## chimere specific ## -# center of the map -DEFAULT_CENTER = (-1.679444, 48.114722) -# projection used by the main map -# most public map providers use spherical mercator : 900913 -EPSG_PROJECTION = 900913 -# projection displayed to the end user by openlayers -# chimere use the same projection to save its data in the database -EPSG_DISPLAY_PROJECTION = 4326 -# to restrict the map to a defined bounding box set it here -# (left, bottom, right, top) -RESTRICTED_EXTENT = None -# dynamic load of categories on the main map -DYNAMIC_CATEGORIES = False -# display of shortcuts for areas -DISPLAY_AREAS = True -# specific css for areas -CSS_AREAS = True -# number of day before an event to display -# if equal to 0: disable event management -# if you change this value from 0 to a value in a production environnement -# don't forget to run the upgrade.py script to create appropriate fields in -# the database -DAYS_BEFORE_EVENT = 30 - -# default id category to check on the map -DEFAULT_CATEGORIES = [1] - -# JS definition of the main map cf. OpenLayers documentation for more details -#MAP_LAYER = '''new OpenLayers.Layer.OSM.CycleMap("Cycle map", { -#displayOutsideMaxExtent: true, wrapDateLine: true})''' # OSM cyclemap -MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')" # OSM mapnik map - -DEBUG = True -TEMPLATE_DEBUG = DEBUG - -ADMINS = ( - # ('Your Name', 'your_email@domain.com'), -) - -MANAGERS = ADMINS - -DATABASES = { - 'default': { - 'NAME': 'ratatouille', - 'ENGINE': 'django.contrib.gis.db.backends.postgis', - 'HOST': 'localhost', - 'PORT': '5432', - 'USER': 'ratatouille', - 'PASSWORD': 'wiki', - }, -} - -# Local time zone for this installation. Choices can be found here: -# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE -# although not all variations may be possible on all operating systems. -# If running in a Windows environment this must be set to the same as your -# system time zone. -TIME_ZONE = 'Europe/Paris' - -# Language code for this installation. All choices can be found here: -# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes -# http://blogs.law.harvard.edu/tech/stories/storyReader$15 -LANGUAGE_CODE = 'fr-fr' - -SITE_ID = 1 - -# If you set this to False, Django will make some optimizations so as not -# to load the internationalization machinery. -USE_I18N = True -USE_L10N = True - -# Absolute path to the directory that holds media. -# Example: "/home/media/media.lawrence.com/" -MEDIA_ROOT = ROOT_PATH + 'static/' - -# URL that handles the media served from MEDIA_ROOT. -# Example: "http://media.lawrence.com" -MEDIA_URL = '/' + EXTRA_URL + 'static/' - -# share with -SHARE_NETWORKS = ( -("Email", 'mailto:?subject=%(text)s&body=%(url)s', - MEDIA_URL + 'icons/email.png'), -("Facebook", 'http://www.facebook.com/sharer.php?t=%(text)s&u=%(url)s', - MEDIA_URL + 'icons/facebook.png'), -("Twitter", 'http://twitter.com/home?status=%(text)s %(url)s', - MEDIA_URL + 'icons/twitter.png'), -("Identi.ca", 'http://identi.ca/index.php?action=newnotice&status_textarea=%(text)s %(url)s', - MEDIA_URL + 'icons/identica.png'), -) - -# URL prefix for admin media -- CSS, JavaScript and images. Make sure to use a -# trailing slash. -# Examples: "http://foo.com/media/", "/media/". -ADMIN_MEDIA_PREFIX = '/' + EXTRA_URL + 'media/' - -# Make this unique, and don't share it with anybody. -SECRET_KEY = 'achanger_!ToChange!' - -# List of callables that know how to import templates from various sources. -TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', -# 'django.template.loaders.eggs.load_template_source', -) - -MIDDLEWARE_CLASSES = ( - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'django.contrib.auth.middleware.AuthenticationMiddleware', - 'django.middleware.doc.XViewMiddleware', -) - -ROOT_URLCONF = 'chimere.urls' - -TEMPLATE_DIRS = [ - # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - ROOT_PATH + 'templates', -] - -INSTALLED_APPS = ( - 'django.contrib.auth', - 'django.contrib.admin', - 'django.contrib.contenttypes', - 'django.contrib.sessions', - 'django.contrib.sites', - 'chimere.main', - # activate it if you want to use migration scripts - 'chimere.scripts', - # activate it if you want to use RSS feeds - 'chimere.rss' -) - -if 'chimere.rss' in INSTALLED_APPS: - TEMPLATE_DIRS.append(ROOT_PATH + 'rss/templates') diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000..dc549a6 --- /dev/null +++ b/docs/Makefile @@ -0,0 +1,130 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + +clean: + -rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Chimre.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Chimre.qhc" + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/Chimre" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Chimre" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..9221eb1 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,216 @@ +# -*- coding: utf-8 -*- +# +# Chimère documentation build configuration file, created by +# sphinx-quickstart on Wed Feb 15 00:42:28 2012. +# +# This file is execfile()d with the current directory set to its containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. + +import sys, os + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +#sys.path.insert(0, os.path.abspath('.')) + +# -- General configuration ----------------------------------------------------- + +# If your documentation needs a minimal Sphinx version, state it here. +#needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be extensions +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix of source filenames. +source_suffix = '.rst' + +# The encoding of source files. +#source_encoding = 'utf-8-sig' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'Chimère' +copyright = u'2012, Étienne Loks' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '2.0' +# The full version, including alpha/beta/rc tags. +release = '2.0' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +#language = None + +# There are two options for replacing |today|: either, you set today to some +# non-false value, then it is used: +#today = '' +# Else, today_fmt is used as the format for a strftime call. +#today_fmt = '%B %d, %Y' + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The reST default role (used for this markup: `text`) to use for all documents. +#default_role = None + +# If true, '()' will be appended to :func: etc. cross-reference text. +#add_function_parentheses = True + +# If true, the current module name will be prepended to all description +# unit titles (such as .. function::). +#add_module_names = True + +# If true, sectionauthor and moduleauthor directives will be shown in the +# output. They are ignored by default. +#show_authors = False + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# A list of ignored prefixes for module index sorting. +#modindex_common_prefix = [] + + +# -- Options for HTML output --------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +#html_theme_options = {} + +# Add any paths that contain custom themes here, relative to this directory. +#html_theme_path = [] + +# The name for this set of Sphinx documents. If None, it defaults to +# " v documentation". +#html_title = None + +# A shorter title for the navigation bar. Default is the same as html_title. +#html_short_title = None + +# The name of an image file (relative to this directory) to place at the top +# of the sidebar. +#html_logo = None + +# The name of an image file (within the static path) to use as favicon of the +# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# pixels large. +#html_favicon = None + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, +# using the given strftime format. +#html_last_updated_fmt = '%b %d, %Y' + +# If true, SmartyPants will be used to convert quotes and dashes to +# typographically correct entities. +#html_use_smartypants = True + +# Custom sidebar templates, maps document names to template names. +#html_sidebars = {} + +# Additional templates that should be rendered to pages, maps page names to +# template names. +#html_additional_pages = {} + +# If false, no module index is generated. +#html_domain_indices = True + +# If false, no index is generated. +#html_use_index = True + +# If true, the index is split into individual pages for each letter. +#html_split_index = False + +# If true, links to the reST sources are added to the pages. +#html_show_sourcelink = True + +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. +#html_show_sphinx = True + +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. +#html_show_copyright = True + +# If true, an OpenSearch description file will be output, and all pages will +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' + +# This is the file name suffix for HTML files (e.g. ".xhtml"). +#html_file_suffix = None + +# Output file base name for HTML help builder. +htmlhelp_basename = 'Chimredoc' + + +# -- Options for LaTeX output -------------------------------------------------- + +# The paper size ('letter' or 'a4'). +#latex_paper_size = 'letter' + +# The font size ('10pt', '11pt' or '12pt'). +#latex_font_size = '10pt' + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, author, documentclass [howto/manual]). +latex_documents = [ + ('index', 'Chimre.tex', u'Chimère Documentation', + u'Étienne Loks', 'manual'), +] + +# The name of an image file (relative to this directory) to place at the top of +# the title page. +#latex_logo = None + +# For "manual" documents, if this is true, then toplevel headings are parts, +# not chapters. +#latex_use_parts = False + +# If true, show page references after internal links. +#latex_show_pagerefs = False + +# If true, show URL addresses after external links. +#latex_show_urls = False + +# Additional stuff for the LaTeX preamble. +#latex_preamble = '' + +# Documents to append as an appendix to all manuals. +#latex_appendices = [] + +# If false, no module index is generated. +#latex_domain_indices = True + + +# -- Options for manual page output -------------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + ('index', 'chimre', u'Chimère Documentation', + [u'Étienne Loks'], 1) +] diff --git a/docs/en/INSTALL.t2t b/docs/en/INSTALL.t2t deleted file mode 100644 index 2279e37..0000000 --- a/docs/en/INSTALL.t2t +++ /dev/null @@ -1,324 +0,0 @@ -Chimère installation -Étienne Loks -Last update: %%date(%m-%d-%Y) - -+ Base installation + - -++ Installation ++ - -+++ Prerequisites +++ - -- [apache http://www.apache.org/] version 2.x with [mod_python http://www.modpython.org/] 3.x -- [python http://www.python.org/] versions 2.6 or 2.7 -- [geodjango http://www.djangoproject.com/] version 1.0 -- [postgres http://www.postgresql.org/] version 8.x -- [gettext http://www.gnu.org/software/gettext/] -- [psycopg2 http://freshmeat.net/projects/psycopg/] -- [Python Imaging Library http://www.pythonware.com/products/pil/] -- [Beautiful Soup http://www.crummy.com/software/BeautifulSoup/] -- [lxml http://lxml.de/] - -geodjango is a part of django version 1.0 but it has some specific (geographically related) additionnal dependencies: - - - [geos http://trac.osgeo.org/geos/] 3.0.x - - [proj.4 http://trac.osgeo.org/proj/] 4.4 to 4.6 - - [posgis http://postgis.refractions.net/] versions 1.2.1 or 1.3.x - - [gdal http://www.gdal.org/] - - -Optionaly (but recommanded): - - - [tinymce http://tinymce.moxiecode.com/] - - [gpsbabel http://www.gpsbabel.org/] - - -The simpliest way to obtain these packages is to get them from your favorite Linux distribution repositories (for instance python, python-django, python-beautifulsoup, tinymce, apache2, libgeos-3.2.0, proj, gdal-bin, python-gdal, python-lxml, python-psycopg2, python-imaging, gettext, postgresql-8.4 and postgresql-8.4-postgis packages for Debian Squeeze). If these packages do not exist in your distribution's repository, please refer to the applications' websites. - -+++ Database configuration +++ - -Now that postgres and postgis are installed, you need to create a new user for chimere: - -``` -createuser --echo --adduser --createdb --encrypted --pwprompt chimere-user -``` - -Then, you have to create the database, and initialize the geographic types (adapt the paths accordingly to your needs): - -``` -createdb --echo --owner chimere-user --encoding UNICODE chimere "My Chimère database" -createlang plpgsql chimere -psql -d chimere -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql -psql -d chimere -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql -``` - -+++ Getting the sources +++ - -The last "stable" version is available in this [directory http://www.peacefrogs.net/download/]. - -Another solution is to get the last git version: - -``` -git clone git://www.peacefrogs.net/git/chimere -git tag -l # list tagged versions -git checkout v1.0.0 # checkout the desired version -``` - -+++ Install the sources +++ - -Unpack and move the files in an apache user (www-data for Debian) readable directory - -``` -sudo mkdir /var/local/django -cd /var/local/django -sudo tar xvjf /home/etienne/chimere-last.tar.bz2 -sudo chown -R etienne:www-data chimere -``` - -In your chimere application directory create settings.py to fit to your configuration. -A base template is provided (settings.py.example): - -``` -cd chimere/chimere/ -cp settings.py.example settings.py -vim settings.py -#### -PROJECT_NAME = u'Chimère' - -ROOT_PATH = '/var/local/django/chimere/chimere/' # path to the installation of Chimère - -SERVER_URL = "http://www.peacefrogs.net/" # root of the web address of Chimère -EXTRA_URL = 'chimere/' # suffix to the web address of Chimère -BASE_URL = SERVER_URL + EXTRA_URL -EMAIL_HOST = 'localhost' # smtp of an email server to send emails - -TINYMCE_URL = SERVER_URL + 'tinymce/' - -# chimere specific -DEFAULT_CENTER = (-1.679444, 48.114722) # default center of the map -EPSG_PROJECTION = 900913 # projection used for data exchange (JSON flow) -EPSG_DISPLAY_PROJECTION = 4326 # projection used to display on the map - -# default id category to check on the map -DEFAULT_CATEGORIES = [1] # list of default category ids checked on the map - -# JS definition of the main map cf. OpenLayers documentation for more details -# to begin you can leave the default OpenStreetMap map rendered with Mapnik -MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')" - -# setting the appropriate language code for your site -LANGUAGE_CODE = 'en-gb' - -# database configuration -DATABASE_ENGINE = 'postgresql_psycopg2' # leave it to 'postgresql_psycopg2' -DATABASE_NAME = 'chimere' # database name -DATABASE_USER = 'chimere-user' # database user -DATABASE_PASSWORD = 'mypassword' # database password -DATABASE_HOST = '' # set to empty string for localhost - -DATABASE_PORT = '' # set to empty string for default - -#### -``` - -If you want to use tinymce don't forget to make it available to Chimère. - -In this same chimere directory, make a symbolic link to django's basic styles (do not forget to change the path according to your configuration, it is the last time I will recall it to you. Next time, you are on your own !): - -``` -ln -s /usr/share/pyshared/django/contrib/admin/media/ . -``` - -+++ Compiling languages +++ - -If your language is available in the locale directory of chimere, you will just need to get it compiled. Still being in the chimere directory, this can be done with (here, "de" stands for german. Replace it with the appropriate language code) : - -``` -django-admin compilemessages -l de -``` - -If your language is not available, feel free to create the default po files and to submit it, contributions are well appreciated. Procedure is as follows : - -You first need to create the default po file (of course, replace "de" according to the language you chose to create) : - -``` -django-admin makemessages -l de -``` - -There should now be a django.po file in locale/de/LC_MESSAGES. Complete it with your translation. - -Now that the translation file is completed, just compile it the same way you would have if the language file was already available. - -+++ Database initialisation +++ - -Create the appropriate tables (still being in chimère application directory): - -``` -./manage.py syncdb -``` - -You will be prompted for the creation of an administrator account (administration can be found at: http://where_is_chimere/admin). -The database is set, congratulations! - -+++ Webserver configuration +++ - -++++ Apache configuration with mod_wsgi ++++ - -Install mod_wsgi for apache - -``` -sudo apt-get install libapache2-mod-wsgi -``` - -Create and edit a configuration for Chimère. - -``` -sudo mkdir /var/local/django/chimere/apache -sudo cp /var/local/django/chimere/docs/conf/django.wsgi /var/local/django/chimere/apache/django.wsgi -sudo cp /var/local/django/chimere/docs/conf/apache-wsgi.conf /etc/apache2/sites-available/chimere -``` - -Adapt the files django.wsgi (with the correct sys path) and chimere. - -To activate the website reload apache. - -``` -sudo a2ensite chimere -sudo /etc/init.d/apache2 reload -``` - -++++ Apache configuration with mod_python ++++ - -Install mod_python for apache - -``` -apt-get install libapache2-mod-python -``` - -Create and edit a configuration file for Chimère. - -``` -sudo vim /etc/apache2/sites-available/chimere -``` - -Insert Apache directives for your installation. - -``` -# part of the address after the root of your site - -# directory path to the father of the installation of Chimère -PythonPath "['/var/local/django/'] + sys.path" -SetHandler python-program -PythonHandler django.core.handlers.modpython -SetEnv DJANGO_SETTINGS_MODULE chimere.settings -# set it to on or off if in test or production environment -PythonDebug On -# put differents interpreter names if you deploy several Chimère -PythonInterpreter chimere - -``` - -To activate the website reload apache. - -``` -sudo a2ensite chimere -sudo /etc/init.d/apache2 reload -``` - -Now that you have gone through ALL this configuration procedure (which was not that hard after all) you can configure the site. - -+ Base configuration + - -When you have installed the application there is a few simple steps to follow to configure *your* Chimère. - -Most of theses steps are done in the administration pages accessible at : http://where_is_chimere/admin -To access theses pages you have to identify you with login and password provided at the initialization of the database. - -++ Creating users ++ - -If you are not the only administrator of this Chimère installation you have to create account for the other users. -Currently the process has to be done manualy. - -Simply click on the Add button near Users. Give a name and a default password (the user can change it on in own later). -Then complete the other pieces of information. -Check the case: Member of the staff (or this user will not be able to log to this administration site). -To simply give this user correct rights don't add permission manualy but make this user member of a group. -Two default group are proposed: application administrator and moderator. - -Detail of rights for default user/groups: - -|| Task | Application owner | Application administrator | Moderator | -| User add/modify/delete | yes | no | no | -| Group add/modify/delete | yes | no | no | -| Property model add/modify/delete | yes | no | no | -| News add/modify/delete | yes | yes | no | -| Area add/modify/delete | yes | yes | no | -| Icon add/modify/delete | yes | yes | no | -| Category/Subcategory add/modify/delete | yes | yes | no | -| Point Of Interest add/modify/delete | yes | yes | yes | -| Route add/modify/delete | yes | yes | yes | - -++ Setting the welcome page ++ - -The message has to be set by updating the file templates/welcome.html. -You only have to change the message at the begin of #detail_content. - -++ Creating property models ++ - -A basic installation of Chimère only permit to associate a name, a category and (for the point of interest) a picture for each point of interest and each route. You may want to add more fields like phone number or opening hours. For that all you have to do is to add a new property model. -The administration ask you for name, order (to order between other properties), availability for the user and type (only text field and long text field are available for the moment). -Then to make this property available it is necessary to restart your application (and then probably to reload Apache). -All forms are then automaticaly updated with this new field. - -++ Updating the detail window ++ - -When clicking on a POI a window appear with the details. -Particulary if you have set some new property models you may want to customize this window. -Each property is in a paragraph with id: property_i_j (i is the order and j is the model property id - the first model property is id 1 then 2...). -You can simply adapt the CSS file (static/styles.css) to match the desired presentation. -If you want to really change the whole presentation you can change the template file templates/detail.html (go to the Django template documentation for details). - -++ Updating the design ++ - -You can of course customize Chimère with your own CSS. To do that just edit the file static/styles.css. - -After this basic configuration done the harder is done. You can do now application administration tasks. - -+ Site administration + - -The explanation are to create new elements. To modify these elements it is the same if only some fields are already filled. - -++ Creating news ++ - -A news system is available. -All you have to to do is to click on the Add button near News. -For each news you have to provided a name and a content. The content can contain HTML tags. -The avaibility is set with a checkbox. - -++ Creating categories/subcategories ++ - -Before adding categories you have to set some icons. Theses icons appears on the map and in the categories' box on the main map. -Be careful to resize correctly your icons. Indeed the icon will be presented at their real size on the map. -To add icons: the Add button near Icons. - -Categories are in fact only containers for subcategories. You'll have to provide only a name and an order. -To add categories: the Add button near categories (quite clear now, isn't it?) - -Fields of subcategories are: an associated category, a name, an icon, an order, a color and an element type. -Theses fields are mainly quite self-explainatory. -The color is used to draw routes (if this subcategory contains routes). If it a basic color it can be set with the english name (for instance: "red", "blue", "yellow" or "purple") otherwise you can put the HTML RVB code (for instance "#9227c9"). -The element type is the type of element the subcategory can contain: POI, route or both. - -++ Creating areas ++ - -Areas are useful to provide a quick access to a particular town, a district, etc. -To define an area fill a name and move/zoom to the choosed location. Submit it and that's all. - -+ Moderation + - -The moderation step is quite simple. It works the same with POIs and routes. -The moderator can access to all POIs (or routes) by clicking on the Modify button. -A search field is available to search by name but the more interesting is to filter POIs (or route) by state and by subcategory. -Then to modify an item you have to click on his name. -The submission can now freely modified. Compared to the main submission interface there is only on field add: the state field. To be publish in the main site the item must have the state: Available. -If an item is not revelant the Delete button permit to remove it. - diff --git a/docs/en/UPGRADE.t2t b/docs/en/UPGRADE.t2t deleted file mode 100644 index 7d248ee..0000000 --- a/docs/en/UPGRADE.t2t +++ /dev/null @@ -1,165 +0,0 @@ -Chimère upgrade -Étienne Loks -Last update: %%date(%m-%d-%Y) -%! Encoding: utf-8 - -+ Get new version of dependencies + - -++ From version prior to 1.1 to 1.1 ++ - -Upgrade Django to the 1.2 version. -Install the [Beautiful Soup http://www.crummy.com/software/BeautifulSoup/] library. - -+ Get the new version + - -First of all get the new version of the code source. - -++ Download archive from the download site ++ - -Versions are available at this [address http://www.peacefrogs.net/download/chimere/]. -Take care of getting the last version in the desired X.Y branch (for instance -the last version for the 1.0 branch is version 1.0.2 as the time of writing of -this document). -Extract it to the desired destination path. - -``` -# wget http://www.peacefrogs.net/download/chimere -q -O -| html2text -(...) -[[ ]] chimere-1.0.0.tar.bz2 17-Nov-2010 16:51 53K -[[ ]] chimere-1.0.1.tar.bz2 17-Nov-2010 16:51 53K -[[ ]] chimere-1.0.2.tar.bz2 17-Nov-2010 16:51 53K -(...) - -# wget http://www.peacefrogs.net/download/chimere/chimere-1.0.2.tar.bz2 -# mv chimere-1.0.2.tar.bz2 /var/local/django -# cd /var/local/django -# tar xvjf chimere-1.0.2.tar.bz2 -# cd chimere-1.0.2 -``` -++ Get from the Git repository ++ - -Clone the Git repository, checkout the desired version and copy it to the -desired destination path. - -``` -# git clone git://www.peacefrogs.net/git/chimere -# cd chimere -# git tag -l -(...) -v1.0.0 -v1.0.1 -v1.0.2 -# git checkout v1.0.2 -# cd .. -# mv chimere /var/local/dgango/chimere-1.0 -# cd /var/local/dgango/chimere-1.0 -``` - -+ Copy files from your old installation + - -From your old installation at least copy "settings.py" and the content of -"static/icons/" and "static/upload/" to the new installation. -You have probably customised some styles and templates (for instance -"styles.css", "welcome.html" and "base_user.html") don't forget to copy them and -eventualy adapt them (if you have old vanilla version of this file comparing -with the new one provided is easier). - -+ Adapt settings.py + - -The format of settings.py could have evolved, the easiest way to complete your -settings.py is to compare your old settings.py.example and the new one provided. - -++ Specific to upgrade from version 1.0 to version 1.1 ++ - -Version 1.1 of Chimère uses Django 1.2 and with it the manner to define database -has changed. - -Old way to define your database is: - -``` -DATABASE_ENGINE = 'postgresql_psycopg2' -DATABASE_NAME = 'chimere' -DATABASE_USER = 'chimere-user' -DATABASE_PASSWORD = 'password' -DATABASE_HOST = 'localhost' -DATABASE_PORT = '' -``` - -The new one looks like: - -``` -DATABASES = { - 'default': { - 'NAME': 'ratatouille', - 'ENGINE': 'django.contrib.gis.db.backends.postgis', - 'HOST': 'localhost', - 'PORT': '5432', - 'USER': 'chimere-user', - 'PASSWORD': 'password', - }, -} -``` - -Be careful to adapt properly your settings.py - -+ Run migration scripts + - -Migration scripts test your installation before making changes so you probably -won't have any lost but by precaution before running theses scripts don't forget -to backup your database. -You can also make a copy of your current database into a new database and make -the new installation to this new database. - -The gdal binding for python is necessary to run the upgrade scripts (available -in the python-gdal package in Debian). - -If you run the migration scripts in a production environnement stop the old -instance of Chimère before executing the migration script. Perhaps prepare the -web server to point to the new installation before doing the database upgrade -(cf. next paragraph). - -In "settings.py" verify that "chimere.scripts" is in the INSTALLED_APPS. - -After that in the chimere directory just execute the script: - -``` -$ python ./scripts/upgrade -``` - -+ Point to the new installation + - -Most of the job is done. You'll just have to configure your web server to serve -the new version. -For instance for Apache the directive is changed from: -``` -PythonPath "['/var/local/django/chimere/'] + sys.path" -``` -To: -``` -PythonPath "['/var/local/django/chimere-1.0.2/'] + sys.path" -``` - -Restart your web server and apart from web browser cache issues this should work. - -+ Force the upgrade of visitor's web browser cache + - -If major changes in the javascript has be done between version, many of your -users could experience problems. There are many tricks to force the refresh -of their cache. One of them is to change the location of statics files. To do -that edit your settings.py and change: -``` -MEDIA_ROOT = ROOT_PATH + 'static/' -MEDIA_URL = '/' + EXTRA_URL + 'static/' -``` -To: -``` -MEDIA_ROOT = ROOT_PATH + 'static/v1.0.2/' -MEDIA_URL = '/' + EXTRA_URL + 'static/v1.0.2/' -``` -Then in the static directory: -``` -$ ln -s `pwd` v1.0.2 -``` - -Restart the web server to apply changes. - diff --git a/docs/fr/documentation-utilisateur.t2t b/docs/fr/documentation-utilisateur.t2t deleted file mode 100644 index d4ff0e1..0000000 --- a/docs/fr/documentation-utilisateur.t2t +++ /dev/null @@ -1,185 +0,0 @@ -Documentation administrateur de Chimère -Étienne Loks -Last update: %%date(%m-%d-%Y) - -= Généralités = - -Trois rôles sont disponibles en administration : - -- modérateur de l'application ; -- administrateur de l'application ; -- administrateur technique. - - -Le modérateur peut valider/modifier/ajouter les points d'intérêts et les -trajets. Le paragraphe « Modération dans Chimère » décrit les fonctionnalités -disponibles pour ce rôle. - -L'administrateur de l'application peut en plus administrer les catégories, les -sous-catégories, les icônes, les nouvelles, les thèmes de couleur et les zones. -Le paragraphe « Administration de l'application dans Chimère » décrit les -fonctionnalités disponibles pour ce rôle. - -L'administrateur technique a en plus accès à la création d'utilisateurs. - -Pour accéder aux pages d'administration, il suffit de s'identifier sur la page -accessible à l'adresse de base du site, suffixée par « /admin ». Bien sûr, il -faut préalablement que l'on ait créé un compte pour vous (ou que vous soyez -l'installateur de l'application). - -Attention, si une installation couvrant plusieurs zones a été faite, il faut -retirer le suffixe de zone dans l'adresse. - -//ex// : depuis une URL d'accès classique http://www.carte-ouverte.org/ avec une -zone d'accès http://www.carte-ouverte.org/rennes l'URL d'accès à -l'administration reste http://www.carte-ouverte.org/admin - -= Modération dans Chimère = - -Une fois identifié, un utilisateur ayant les droits de modération dispose des -éléments suivants : - -- Points d'intérêts -- Trajets - - -Si certains éléments ne sont pas disponibles, c'est que le compte ne bénéficie -pas de droits suffisants pour la modération. - -== Modification des points d'intérêts/des trajets == - -Le modérateur peut accéder à tous les points d'intérêts et tous les trajets -validés ou non. -Une recherche par nom parmi les éléments est possible. De même, ces éléments -peuvent être filtrés par état ou par sous-catégorie. - -La modification/l'ajout d'élément est assez similaire à l'interface publique de -création. Seul le champ État est ajouté. -Celui-ci a trois valeurs : - - - Soumis, un élément a été proposé depuis l'interface publique ; - - Disponible, l'élément a été validé en modération ; - - Désactivé, l'élément a été mis de coté. - - -Il est possible de supprimer complètement un élément de la base. Cette opération -est non réversible mais une confirmation est demandée. - -= Administration de l'application dans Chimère = - -Une fois identifié, un utilisateur ayant les droits d'administration de -l'application dispose des éléments suivants : - -- Catégories -- Icônes -- Nouvelles -- Points d'intérêts -- Sous-catégories -- Thème de couleurs -- Trajets -- Zones - - -Si certains éléments ne sont pas disponibles, c'est que le compte ne bénéficie -pas de droits suffisants pour la modération. - -La gestion des Points d'intérêts et des Trajets est décrite dans la section sur -la modération. - -== Création des zones == - -Les zones permettent de découper la carte en plusieurs parties. À chaque partie -peut être associé un suffixe spécifique pour accéder directement à cette zone -depuis une URL spécifique. - -//ex// : depuis une URL d'accès classique http://www.carte-ouverte.org/, il est -possible de définir un accès direct sur la zone de Rennes par l'URL -http://www.carte-ouverte.org/rennes - -Chaque partie peut être configurée pour accéder à seulement un sous-ensemble des -catégories disponibles (les utilisateurs finaux ne pourront proposer que des -éléments dans ces catégories sur cette zone). - -Pour chaque zone, les champs suivants sont disponibles : - -- Nom : le nom de la zone en question ; -- Urn : le suffixe associé à la zone, attention il doit respecter les règles de -nommage des URLs (pas d'accent, pas d'espace, etc.). Ce champ est optionnel, si -il est non défini il n'y a pas de raccourci ; -- Ordre : ordre d'affichage dans la liste de raccourcis (si cette liste est -visible) ; -- Disponible : pour rendre disponible ou non la zone ; -- Sous-catégories : un sous-ensemble de catégories à sélectionner pour limiter -les propositions utilisateurs. Ce champ est optionnel, si aucune sous-catégorie -n'est sélectionnée, toutes les sous-catégories sont disponibles ; -- Zone : la zone en question. Celle-ci correspond à ce qui est visible sur la -carte. - - -== Création d'icônes == - -À chaque sous-catégorie doit être associée une icône. Cette icône apparait sur -la légende de la carte et pour chaque point d'intérêt de la sous-catégorie. Une -même icône peut éventuellement être utilisée pour plusieurs sous-catégories -(même si cela est généralement une mauvaise idée). Pour une harmonie sur la -carte, il est préférable de se tenir à une taille fixe d'icône carrée (par -exemple 32 par 32 pixels). L'icône ne sera pas redimensionnée sur la carte. Les -formats jpg, gif et png sont acceptés mais le png est à privilégier. En effet, -pour de petits formats comme ceux-ci la compression jpg est peu efficace, de -plus elle ne gère pas la transparence (utile pour des icônes ne prenant pas tout -le carré). Le gif est aussi à déconseiller car ce format est maintenant obsolète -(notamment il ne prend en charge que 256 couleurs). - -== Création des thèmes de couleurs == - -Les thèmes de couleur sont utilisés par les trajets. Un thème de couleur est un -ensemble de couleurs qui coloreront aléatoirement les trajets d'une -sous-catégorie donnée. Pour faciliter la compréhension de la carte, il peut être -pertinent d'utiliser des couleurs approchantes pour un même thème de couleur -(par exemple des déclinaisons de bleu). - -Pour chaque thème de couleur, un nom est donné et une ou plusieurs couleurs sont -définies. Les couleurs sont définies en notation HTML RVB avec 6 chiffres -hexadécimaux (sans le #). Cf. une [liste de couleurs http://fr.wikipedia.org/wiki/Liste_de_couleurs]. - -== Création des catégories == - -Les catégories sont de simple conteneurs pour les sous-catégories. Elles -permettent d'organiser logiquement ces dernières et apparaissent comme nœuds -au niveau de la légende de la carte. - -Les catégories disposent des champs suivants : - -- Nom : le nom ; -- Disponible : l'affichage de la catégorie, si une catégorie est indisponible -aucune des sous-catégories sous celle-ci ne sera affichée ; -- Ordre : l'ordre d'apparition dans la légende ; -- Description : texte optionnel permettant de mettre à disposition une -description dans une rubrique « en savoir plus » de la catégorie. - - -== Création des sous-catégories == - -Les trajets et les points d'intérêts sont rangés dans des sous-catégories. -Les sous-catégories disposent des champs suivants : - -- Catégorie : la catégorie associée ; -- Nom : le nom de la sous-catégorie ; -- Disponible : l'affichage de la sous-catégorie ; -- Icône : l'icône associée à la sous-catégorie ; -- Thème de couleur : thème de couleur associé, ce champ est nécessaire pour -les sous-catégories de type trajet ou mixte ; -- Ordre : l'ordre d'apparition dans la légende ; -- Type d'élément : le type d'élément associé à la sous-catégorie : Point -d'intérêt, Trajet ou Mixte (Point d'intérêt et Trajet) ; -- Zones : les zones pour lesquelles cette sous-catégorie est disponible. Si -aucune zone n'est sélectionnée, cette sous-catégorie est disponible pour toutes -les zones. - - -== Création de nouvelles == - -Un système de nouvelles est disponible. -Pour chaque nouvelle, un nom et un contenu doit être renseigné. La disponibilité -est paramétrable. Le système de nouvelles est transversal à tous les sites. - diff --git a/docs/generate b/docs/generate deleted file mode 100755 index c01cb57..0000000 --- a/docs/generate +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash -LANGUAGE="en" -if [ $1 ] - then LANGUAGE=$1; -fi - -if ! [ -d $LANGUAGE ] - then echo $LANGUAGE" is not an appropriate locale."; exit; -fi - -echo "Generate documentation for "$LANGUAGE"." - -cd $LANGUAGE - -for file in `ls *.t2t` -do - name=${file:0:${#file}-4} - txt2tags -q --encoding utf-8 --css-sugar --style style.css --toc -t xhtml -o ../$name".html" $file - txt2tags -q --encoding utf-8 --toc -t txt -o ../$name $file -done - diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..dfeab7f --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,23 @@ +.. Chimère documentation master file, created by + sphinx-quickstart on Wed Feb 15 00:42:28 2012. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. + +Welcome to Chimère's documentation! +=================================== + +Contents: + +.. toctree:: + :maxdepth: 2 + + install + upgrade + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` + diff --git a/docs/install.rst b/docs/install.rst new file mode 100644 index 0000000..b31ac25 --- /dev/null +++ b/docs/install.rst @@ -0,0 +1,352 @@ +.. -*- coding: utf-8 -*- + +==================== +Chimère installation +==================== + +:Author: Étienne Loks +:date: 2012-02-15 +:Copyright: CC-BY 3.0 + +This documents presents the installation of Chimère. + +----------------- +Base installation +----------------- + +Installation +------------ + +Prerequisites +************* + + - `apache `_ version 2.x with [mod_python http://www.modpython.org/] 3.x + + - `python `_ versions 2.6 or 2.7 + + - `geodjango `_ version 1.0 + + - `postgres `_ version 8.x + + - `gettext `_ + + - `psycopg2 `_ + + - `Python Imaging Library `_ + + - `Beautiful Soup `_ + + - `lxml `_ + +geodjango is a part of django version 1.0 but it has some specific (geographically related) additionnal dependencies: + + - `geos `_ 3.0.x + + - `proj.4 `_ 4.4 to 4.6 + + - `posgis `_ versions 1.2.1 or 1.3.x + + - `gdal `_ + + +Optionaly (but recommanded): + + - `tinymce `_ + + - `gpsbabel `_ + + +The simpliest way to obtain these packages is to get them from your favorite Linux distribution repositories (for instance python, python-django, python-beautifulsoup, tinymce, apache2, libgeos-3.2.0, proj, gdal-bin, python-gdal, python-lxml, python-psycopg2, python-imaging, gettext, postgresql-8.4 and postgresql-8.4-postgis packages for Debian Squeeze). If these packages do not exist in your distribution's repository, please refer to the applications' websites. + +Database configuration +********************** + +Now that postgres and postgis are installed, you need to create a new user for chimere:: + + createuser --echo --adduser --createdb --encrypted --pwprompt chimere-user + +Then, you have to create the database, and initialize the geographic types (adapt the paths accordingly to your needs):: + + createdb --echo --owner chimere-user --encoding UNICODE chimere "My Chimère database" + createlang plpgsql chimere + psql -d chimere -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql + psql -d chimere -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql + +Getting the sources +******************* + +The last "stable" version is available in this `directory `_. + +Another solution is to get the last git version:: + + git clone git://www.peacefrogs.net/git/chimere + git tag -l # list tagged versions + git checkout v1.0.0 # checkout the desired version + + +Install the sources +******************* + +Unpack and move the files in an apache user (www-data for Debian) readable directory:: + + sudo mkdir /var/local/django + cd /var/local/django + sudo tar xvjf /home/etienne/chimere-last.tar.bz2 + sudo chown -R etienne:www-data chimere + +In your chimere application directory create settings.py to fit to your configuration. +A base template is provided (settings.py.example):: + + cd chimere/chimere/ + cp settings.py.example settings.py + vim settings.py + #### + PROJECT_NAME = u'Chimère' + + ROOT_PATH = '/var/local/django/chimere/chimere/' # path to the installation of Chimère + + SERVER_URL = "http://www.peacefrogs.net/" # root of the web address of Chimère + EXTRA_URL = 'chimere/' # suffix to the web address of Chimère + BASE_URL = SERVER_URL + EXTRA_URL + EMAIL_HOST = 'localhost' # smtp of an email server to send emails + + TINYMCE_URL = SERVER_URL + 'tinymce/' + + # chimere specific + DEFAULT_CENTER = (-1.679444, 48.114722) # default center of the map + EPSG_PROJECTION = 900913 # projection used for data exchange (JSON flow) + EPSG_DISPLAY_PROJECTION = 4326 # projection used to display on the map + + # default id category to check on the map + DEFAULT_CATEGORIES = [1] # list of default category ids checked on the map + + # JS definition of the main map cf. OpenLayers documentation for more details + # to begin you can leave the default OpenStreetMap map rendered with Mapnik + MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')" + + # setting the appropriate language code for your site + LANGUAGE_CODE = 'en-gb' + + # database configuration + DATABASE_ENGINE = 'postgresql_psycopg2' # leave it to 'postgresql_psycopg2' + DATABASE_NAME = 'chimere' # database name + DATABASE_USER = 'chimere-user' # database user + DATABASE_PASSWORD = 'mypassword' # database password + DATABASE_HOST = '' # set to empty string for localhost + + DATABASE_PORT = '' # set to empty string for default + + #### + +If you want to use tinymce don't forget to make it available to Chimère. + +In this same chimere directory, make a symbolic link to django's basic styles (do not forget to change the path according to your configuration, it is the last time I will recall it to you. Next time, you are on your own!):: + + ln -s /usr/share/pyshared/django/contrib/admin/media/ . + +Compiling languages +******************* + +If your language is available in the locale directory of chimere, you will just need to get it compiled. Still being in the chimere directory, this can be done with (here, "de" stands for german. Replace it with the appropriate language code):: + + django-admin compilemessages -l de + +If your language is not available, feel free to create the default po files and to submit it, contributions are well appreciated. Procedure is as follows : + +You first need to create the default po file (of course, replace "de" according to the language you chose to create):: + + django-admin makemessages -l de + +There should now be a django.po file in locale/de/LC_MESSAGES. Complete it with your translation. + +Now that the translation file is completed, just compile it the same way you would have if the language file was already available. + +Database initialisation +*********************** + +Create the appropriate tables (still being in chimère application directory):: + + ./manage.py syncdb + +You will be prompted for the creation of an administrator account (administration can be found at: http://where_is_chimere/admin). +The database is set, congratulations! + +Webserver configuration +*********************** + +Apache configuration with mod_wsgi +++++++++++++++++++++++++++++++++++ + +Install mod_wsgi for apache:: + + sudo apt-get install libapache2-mod-wsgi + + +Create and edit a configuration for Chimère:: + + sudo mkdir /var/local/django/chimere/apache + sudo cp /var/local/django/chimere/docs/conf/django.wsgi /var/local/django/chimere/apache/django.wsgi + sudo cp /var/local/django/chimere/docs/conf/apache-wsgi.conf /etc/apache2/sites-available/chimere + +Adapt the files django.wsgi (with the correct sys path) and chimere. + +To activate the website reload apache:: + + sudo a2ensite chimere + sudo /etc/init.d/apache2 reload + +Apache configuration with mod_python +++++++++++++++++++++++++++++++++++++ + +Install mod_python for apache:: + + apt-get install libapache2-mod-python + +Create and edit a configuration file for Chimère:: + + sudo vim /etc/apache2/sites-available/chimere + +Insert Apache directives for your installation:: + + # part of the address after the root of your site + + # directory path to the father of the installation of Chimère + PythonPath "['/var/local/django/'] + sys.path" + SetHandler python-program + PythonHandler django.core.handlers.modpython + SetEnv DJANGO_SETTINGS_MODULE chimere.settings + # set it to on or off if in test or production environment + PythonDebug On + # put differents interpreter names if you deploy several Chimère + PythonInterpreter chimere + + +To activate the website reload apache:: + + sudo a2ensite chimere + sudo /etc/init.d/apache2 reload + + +Now that you have gone through ALL this configuration procedure (which was not that hard after all) you can configure the site. + +------------------ +Base configuration +------------------ + +When you have installed the application there is a few simple steps to follow to configure *your* Chimère. + +Most of theses steps are done in the administration pages accessible at : http://where_is_chimere/admin +To access theses pages you have to identify you with login and password provided at the initialization of the database. + +Creating users +-------------- + +If you are not the only administrator of this Chimère installation you have to create account for the other users. +Currently the process has to be done manualy. + +Simply click on the Add button near Users. Give a name and a default password (the user can change it on in own later). +Then complete the other pieces of information. +Check the case: Member of the staff (or this user will not be able to log to this administration site). +To simply give this user correct rights don't add permission manualy but make this user member of a group. +Two default group are proposed: application administrator and moderator. + +Detail of rights for default user/groups: + ++-----------------------------------------+-------------------+---------------------------+-----------+ +| Task | Application owner | Application administrator | Moderator | ++=========================================+===================+===========================+===========+ +| User add/modify/delete | yes | no | no | ++-----------------------------------------+-------------------+---------------------------+-----------+ +| Group add/modify/delete | yes | no | no | ++-----------------------------------------+-------------------+---------------------------+-----------+ +| Property model add/modify/delete | yes | no | no | ++-----------------------------------------+-------------------+---------------------------+-----------+ +| News add/modify/delete | yes | yes | no | ++-----------------------------------------+-------------------+---------------------------+-----------+ +| Area add/modify/delete | yes | yes | no | ++-----------------------------------------+-------------------+---------------------------+-----------+ +| Icon add/modify/delete | yes | yes | no | ++-----------------------------------------+-------------------+---------------------------+-----------+ +| Category/Subcategory add/modify/delete | yes | yes | no | ++-----------------------------------------+-------------------+---------------------------+-----------+ +| Point Of Interest add/modify/delete | yes | yes | yes | ++-----------------------------------------+-------------------+---------------------------+-----------+ +| Route add/modify/delete | yes | yes | yes | ++-----------------------------------------+-------------------+---------------------------+-----------+ + +Setting the welcome page +------------------------ + +The message has to be set by updating the file templates/welcome.html. +You only have to change the message at the begin of #detail_content. + +Creating property models +------------------------ + +A basic installation of Chimère only permit to associate a name, a category and (for the point of interest) a picture for each point of interest and each route. You may want to add more fields like phone number or opening hours. For that all you have to do is to add a new property model. +The administration ask you for name, order (to order between other properties), availability for the user and type (only text field and long text field are available for the moment). +Then to make this property available it is necessary to restart your application (and then probably to reload Apache). +All forms are then automaticaly updated with this new field. + +Updating the detail window +-------------------------- + +When clicking on a POI a window appear with the details. +Particulary if you have set some new property models you may want to customize this window. +Each property is in a paragraph with id: property_i_j (i is the order and j is the model property id - the first model property is id 1 then 2...). +You can simply adapt the CSS file (static/styles.css) to match the desired presentation. +If you want to really change the whole presentation you can change the template file templates/detail.html (go to the Django template documentation for details). + +Updating the design +------------------- + +You can of course customize Chimère with your own CSS. To do that just edit the file static/styles.css. + +After this basic configuration done the harder is done. You can do now application administration tasks. + +------------------- +Site administration +------------------- + +The explanation are to create new elements. To modify these elements it is the same if only some fields are already filled. + +Creating news +------------- + +A news system is available. +All you have to to do is to click on the Add button near News. +For each news you have to provided a name and a content. The content can contain HTML tags. +The avaibility is set with a checkbox. + +Creating categories/subcategories +--------------------------------- + +Before adding categories you have to set some icons. Theses icons appears on the map and in the categories' box on the main map. +Be careful to resize correctly your icons. Indeed the icon will be presented at their real size on the map. +To add icons: the Add button near Icons. + +Categories are in fact only containers for subcategories. You'll have to provide only a name and an order. +To add categories: the Add button near categories (quite clear now, isn't it?) + +Fields of subcategories are: an associated category, a name, an icon, an order, a color and an element type. +Theses fields are mainly quite self-explainatory. +The color is used to draw routes (if this subcategory contains routes). If it a basic color it can be set with the english name (for instance: "red", "blue", "yellow" or "purple") otherwise you can put the HTML RVB code (for instance "#9227c9"). +The element type is the type of element the subcategory can contain: POI, route or both. + +Creating areas +-------------- + +Areas are useful to provide a quick access to a particular town, a district, etc. +To define an area fill a name and move/zoom to the choosed location. Submit it and that's all. + +---------- +Moderation +---------- + +The moderation step is quite simple. It works the same with POIs and routes. +The moderator can access to all POIs (or routes) by clicking on the Modify button. +A search field is available to search by name but the more interesting is to filter POIs (or route) by state and by subcategory. +Then to modify an item you have to click on his name. +The submission can now freely modified. Compared to the main submission interface there is only on field add: the state field. To be publish in the main site the item must have the state: Available. +If an item is not revelant the Delete button permit to remove it. + diff --git a/docs/old/en/INSTALL.t2t b/docs/old/en/INSTALL.t2t new file mode 100644 index 0000000..2279e37 --- /dev/null +++ b/docs/old/en/INSTALL.t2t @@ -0,0 +1,324 @@ +Chimère installation +Étienne Loks +Last update: %%date(%m-%d-%Y) + ++ Base installation + + +++ Installation ++ + ++++ Prerequisites +++ + +- [apache http://www.apache.org/] version 2.x with [mod_python http://www.modpython.org/] 3.x +- [python http://www.python.org/] versions 2.6 or 2.7 +- [geodjango http://www.djangoproject.com/] version 1.0 +- [postgres http://www.postgresql.org/] version 8.x +- [gettext http://www.gnu.org/software/gettext/] +- [psycopg2 http://freshmeat.net/projects/psycopg/] +- [Python Imaging Library http://www.pythonware.com/products/pil/] +- [Beautiful Soup http://www.crummy.com/software/BeautifulSoup/] +- [lxml http://lxml.de/] + +geodjango is a part of django version 1.0 but it has some specific (geographically related) additionnal dependencies: + + - [geos http://trac.osgeo.org/geos/] 3.0.x + - [proj.4 http://trac.osgeo.org/proj/] 4.4 to 4.6 + - [posgis http://postgis.refractions.net/] versions 1.2.1 or 1.3.x + - [gdal http://www.gdal.org/] + + +Optionaly (but recommanded): + + - [tinymce http://tinymce.moxiecode.com/] + - [gpsbabel http://www.gpsbabel.org/] + + +The simpliest way to obtain these packages is to get them from your favorite Linux distribution repositories (for instance python, python-django, python-beautifulsoup, tinymce, apache2, libgeos-3.2.0, proj, gdal-bin, python-gdal, python-lxml, python-psycopg2, python-imaging, gettext, postgresql-8.4 and postgresql-8.4-postgis packages for Debian Squeeze). If these packages do not exist in your distribution's repository, please refer to the applications' websites. + ++++ Database configuration +++ + +Now that postgres and postgis are installed, you need to create a new user for chimere: + +``` +createuser --echo --adduser --createdb --encrypted --pwprompt chimere-user +``` + +Then, you have to create the database, and initialize the geographic types (adapt the paths accordingly to your needs): + +``` +createdb --echo --owner chimere-user --encoding UNICODE chimere "My Chimère database" +createlang plpgsql chimere +psql -d chimere -f /usr/share/postgresql-8.3-postgis/lwpostgis.sql +psql -d chimere -f /usr/share/postgresql-8.3-postgis/spatial_ref_sys.sql +``` + ++++ Getting the sources +++ + +The last "stable" version is available in this [directory http://www.peacefrogs.net/download/]. + +Another solution is to get the last git version: + +``` +git clone git://www.peacefrogs.net/git/chimere +git tag -l # list tagged versions +git checkout v1.0.0 # checkout the desired version +``` + ++++ Install the sources +++ + +Unpack and move the files in an apache user (www-data for Debian) readable directory + +``` +sudo mkdir /var/local/django +cd /var/local/django +sudo tar xvjf /home/etienne/chimere-last.tar.bz2 +sudo chown -R etienne:www-data chimere +``` + +In your chimere application directory create settings.py to fit to your configuration. +A base template is provided (settings.py.example): + +``` +cd chimere/chimere/ +cp settings.py.example settings.py +vim settings.py +#### +PROJECT_NAME = u'Chimère' + +ROOT_PATH = '/var/local/django/chimere/chimere/' # path to the installation of Chimère + +SERVER_URL = "http://www.peacefrogs.net/" # root of the web address of Chimère +EXTRA_URL = 'chimere/' # suffix to the web address of Chimère +BASE_URL = SERVER_URL + EXTRA_URL +EMAIL_HOST = 'localhost' # smtp of an email server to send emails + +TINYMCE_URL = SERVER_URL + 'tinymce/' + +# chimere specific +DEFAULT_CENTER = (-1.679444, 48.114722) # default center of the map +EPSG_PROJECTION = 900913 # projection used for data exchange (JSON flow) +EPSG_DISPLAY_PROJECTION = 4326 # projection used to display on the map + +# default id category to check on the map +DEFAULT_CATEGORIES = [1] # list of default category ids checked on the map + +# JS definition of the main map cf. OpenLayers documentation for more details +# to begin you can leave the default OpenStreetMap map rendered with Mapnik +MAP_LAYER = "new OpenLayers.Layer.OSM.Mapnik('Mapnik')" + +# setting the appropriate language code for your site +LANGUAGE_CODE = 'en-gb' + +# database configuration +DATABASE_ENGINE = 'postgresql_psycopg2' # leave it to 'postgresql_psycopg2' +DATABASE_NAME = 'chimere' # database name +DATABASE_USER = 'chimere-user' # database user +DATABASE_PASSWORD = 'mypassword' # database password +DATABASE_HOST = '' # set to empty string for localhost + +DATABASE_PORT = '' # set to empty string for default + +#### +``` + +If you want to use tinymce don't forget to make it available to Chimère. + +In this same chimere directory, make a symbolic link to django's basic styles (do not forget to change the path according to your configuration, it is the last time I will recall it to you. Next time, you are on your own !): + +``` +ln -s /usr/share/pyshared/django/contrib/admin/media/ . +``` + ++++ Compiling languages +++ + +If your language is available in the locale directory of chimere, you will just need to get it compiled. Still being in the chimere directory, this can be done with (here, "de" stands for german. Replace it with the appropriate language code) : + +``` +django-admin compilemessages -l de +``` + +If your language is not available, feel free to create the default po files and to submit it, contributions are well appreciated. Procedure is as follows : + +You first need to create the default po file (of course, replace "de" according to the language you chose to create) : + +``` +django-admin makemessages -l de +``` + +There should now be a django.po file in locale/de/LC_MESSAGES. Complete it with your translation. + +Now that the translation file is completed, just compile it the same way you would have if the language file was already available. + ++++ Database initialisation +++ + +Create the appropriate tables (still being in chimère application directory): + +``` +./manage.py syncdb +``` + +You will be prompted for the creation of an administrator account (administration can be found at: http://where_is_chimere/admin). +The database is set, congratulations! + ++++ Webserver configuration +++ + +++++ Apache configuration with mod_wsgi ++++ + +Install mod_wsgi for apache + +``` +sudo apt-get install libapache2-mod-wsgi +``` + +Create and edit a configuration for Chimère. + +``` +sudo mkdir /var/local/django/chimere/apache +sudo cp /var/local/django/chimere/docs/conf/django.wsgi /var/local/django/chimere/apache/django.wsgi +sudo cp /var/local/django/chimere/docs/conf/apache-wsgi.conf /etc/apache2/sites-available/chimere +``` + +Adapt the files django.wsgi (with the correct sys path) and chimere. + +To activate the website reload apache. + +``` +sudo a2ensite chimere +sudo /etc/init.d/apache2 reload +``` + +++++ Apache configuration with mod_python ++++ + +Install mod_python for apache + +``` +apt-get install libapache2-mod-python +``` + +Create and edit a configuration file for Chimère. + +``` +sudo vim /etc/apache2/sites-available/chimere +``` + +Insert Apache directives for your installation. + +``` +# part of the address after the root of your site + +# directory path to the father of the installation of Chimère +PythonPath "['/var/local/django/'] + sys.path" +SetHandler python-program +PythonHandler django.core.handlers.modpython +SetEnv DJANGO_SETTINGS_MODULE chimere.settings +# set it to on or off if in test or production environment +PythonDebug On +# put differents interpreter names if you deploy several Chimère +PythonInterpreter chimere + +``` + +To activate the website reload apache. + +``` +sudo a2ensite chimere +sudo /etc/init.d/apache2 reload +``` + +Now that you have gone through ALL this configuration procedure (which was not that hard after all) you can configure the site. + ++ Base configuration + + +When you have installed the application there is a few simple steps to follow to configure *your* Chimère. + +Most of theses steps are done in the administration pages accessible at : http://where_is_chimere/admin +To access theses pages you have to identify you with login and password provided at the initialization of the database. + +++ Creating users ++ + +If you are not the only administrator of this Chimère installation you have to create account for the other users. +Currently the process has to be done manualy. + +Simply click on the Add button near Users. Give a name and a default password (the user can change it on in own later). +Then complete the other pieces of information. +Check the case: Member of the staff (or this user will not be able to log to this administration site). +To simply give this user correct rights don't add permission manualy but make this user member of a group. +Two default group are proposed: application administrator and moderator. + +Detail of rights for default user/groups: + +|| Task | Application owner | Application administrator | Moderator | +| User add/modify/delete | yes | no | no | +| Group add/modify/delete | yes | no | no | +| Property model add/modify/delete | yes | no | no | +| News add/modify/delete | yes | yes | no | +| Area add/modify/delete | yes | yes | no | +| Icon add/modify/delete | yes | yes | no | +| Category/Subcategory add/modify/delete | yes | yes | no | +| Point Of Interest add/modify/delete | yes | yes | yes | +| Route add/modify/delete | yes | yes | yes | + +++ Setting the welcome page ++ + +The message has to be set by updating the file templates/welcome.html. +You only have to change the message at the begin of #detail_content. + +++ Creating property models ++ + +A basic installation of Chimère only permit to associate a name, a category and (for the point of interest) a picture for each point of interest and each route. You may want to add more fields like phone number or opening hours. For that all you have to do is to add a new property model. +The administration ask you for name, order (to order between other properties), availability for the user and type (only text field and long text field are available for the moment). +Then to make this property available it is necessary to restart your application (and then probably to reload Apache). +All forms are then automaticaly updated with this new field. + +++ Updating the detail window ++ + +When clicking on a POI a window appear with the details. +Particulary if you have set some new property models you may want to customize this window. +Each property is in a paragraph with id: property_i_j (i is the order and j is the model property id - the first model property is id 1 then 2...). +You can simply adapt the CSS file (static/styles.css) to match the desired presentation. +If you want to really change the whole presentation you can change the template file templates/detail.html (go to the Django template documentation for details). + +++ Updating the design ++ + +You can of course customize Chimère with your own CSS. To do that just edit the file static/styles.css. + +After this basic configuration done the harder is done. You can do now application administration tasks. + ++ Site administration + + +The explanation are to create new elements. To modify these elements it is the same if only some fields are already filled. + +++ Creating news ++ + +A news system is available. +All you have to to do is to click on the Add button near News. +For each news you have to provided a name and a content. The content can contain HTML tags. +The avaibility is set with a checkbox. + +++ Creating categories/subcategories ++ + +Before adding categories you have to set some icons. Theses icons appears on the map and in the categories' box on the main map. +Be careful to resize correctly your icons. Indeed the icon will be presented at their real size on the map. +To add icons: the Add button near Icons. + +Categories are in fact only containers for subcategories. You'll have to provide only a name and an order. +To add categories: the Add button near categories (quite clear now, isn't it?) + +Fields of subcategories are: an associated category, a name, an icon, an order, a color and an element type. +Theses fields are mainly quite self-explainatory. +The color is used to draw routes (if this subcategory contains routes). If it a basic color it can be set with the english name (for instance: "red", "blue", "yellow" or "purple") otherwise you can put the HTML RVB code (for instance "#9227c9"). +The element type is the type of element the subcategory can contain: POI, route or both. + +++ Creating areas ++ + +Areas are useful to provide a quick access to a particular town, a district, etc. +To define an area fill a name and move/zoom to the choosed location. Submit it and that's all. + ++ Moderation + + +The moderation step is quite simple. It works the same with POIs and routes. +The moderator can access to all POIs (or routes) by clicking on the Modify button. +A search field is available to search by name but the more interesting is to filter POIs (or route) by state and by subcategory. +Then to modify an item you have to click on his name. +The submission can now freely modified. Compared to the main submission interface there is only on field add: the state field. To be publish in the main site the item must have the state: Available. +If an item is not revelant the Delete button permit to remove it. + diff --git a/docs/old/en/UPGRADE.t2t b/docs/old/en/UPGRADE.t2t new file mode 100644 index 0000000..7d248ee --- /dev/null +++ b/docs/old/en/UPGRADE.t2t @@ -0,0 +1,165 @@ +Chimère upgrade +Étienne Loks +Last update: %%date(%m-%d-%Y) +%! Encoding: utf-8 + ++ Get new version of dependencies + + +++ From version prior to 1.1 to 1.1 ++ + +Upgrade Django to the 1.2 version. +Install the [Beautiful Soup http://www.crummy.com/software/BeautifulSoup/] library. + ++ Get the new version + + +First of all get the new version of the code source. + +++ Download archive from the download site ++ + +Versions are available at this [address http://www.peacefrogs.net/download/chimere/]. +Take care of getting the last version in the desired X.Y branch (for instance +the last version for the 1.0 branch is version 1.0.2 as the time of writing of +this document). +Extract it to the desired destination path. + +``` +# wget http://www.peacefrogs.net/download/chimere -q -O -| html2text +(...) +[[ ]] chimere-1.0.0.tar.bz2 17-Nov-2010 16:51 53K +[[ ]] chimere-1.0.1.tar.bz2 17-Nov-2010 16:51 53K +[[ ]] chimere-1.0.2.tar.bz2 17-Nov-2010 16:51 53K +(...) + +# wget http://www.peacefrogs.net/download/chimere/chimere-1.0.2.tar.bz2 +# mv chimere-1.0.2.tar.bz2 /var/local/django +# cd /var/local/django +# tar xvjf chimere-1.0.2.tar.bz2 +# cd chimere-1.0.2 +``` +++ Get from the Git repository ++ + +Clone the Git repository, checkout the desired version and copy it to the +desired destination path. + +``` +# git clone git://www.peacefrogs.net/git/chimere +# cd chimere +# git tag -l +(...) +v1.0.0 +v1.0.1 +v1.0.2 +# git checkout v1.0.2 +# cd .. +# mv chimere /var/local/dgango/chimere-1.0 +# cd /var/local/dgango/chimere-1.0 +``` + ++ Copy files from your old installation + + +From your old installation at least copy "settings.py" and the content of +"static/icons/" and "static/upload/" to the new installation. +You have probably customised some styles and templates (for instance +"styles.css", "welcome.html" and "base_user.html") don't forget to copy them and +eventualy adapt them (if you have old vanilla version of this file comparing +with the new one provided is easier). + ++ Adapt settings.py + + +The format of settings.py could have evolved, the easiest way to complete your +settings.py is to compare your old settings.py.example and the new one provided. + +++ Specific to upgrade from version 1.0 to version 1.1 ++ + +Version 1.1 of Chimère uses Django 1.2 and with it the manner to define database +has changed. + +Old way to define your database is: + +``` +DATABASE_ENGINE = 'postgresql_psycopg2' +DATABASE_NAME = 'chimere' +DATABASE_USER = 'chimere-user' +DATABASE_PASSWORD = 'password' +DATABASE_HOST = 'localhost' +DATABASE_PORT = '' +``` + +The new one looks like: + +``` +DATABASES = { + 'default': { + 'NAME': 'ratatouille', + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'HOST': 'localhost', + 'PORT': '5432', + 'USER': 'chimere-user', + 'PASSWORD': 'password', + }, +} +``` + +Be careful to adapt properly your settings.py + ++ Run migration scripts + + +Migration scripts test your installation before making changes so you probably +won't have any lost but by precaution before running theses scripts don't forget +to backup your database. +You can also make a copy of your current database into a new database and make +the new installation to this new database. + +The gdal binding for python is necessary to run the upgrade scripts (available +in the python-gdal package in Debian). + +If you run the migration scripts in a production environnement stop the old +instance of Chimère before executing the migration script. Perhaps prepare the +web server to point to the new installation before doing the database upgrade +(cf. next paragraph). + +In "settings.py" verify that "chimere.scripts" is in the INSTALLED_APPS. + +After that in the chimere directory just execute the script: + +``` +$ python ./scripts/upgrade +``` + ++ Point to the new installation + + +Most of the job is done. You'll just have to configure your web server to serve +the new version. +For instance for Apache the directive is changed from: +``` +PythonPath "['/var/local/django/chimere/'] + sys.path" +``` +To: +``` +PythonPath "['/var/local/django/chimere-1.0.2/'] + sys.path" +``` + +Restart your web server and apart from web browser cache issues this should work. + ++ Force the upgrade of visitor's web browser cache + + +If major changes in the javascript has be done between version, many of your +users could experience problems. There are many tricks to force the refresh +of their cache. One of them is to change the location of statics files. To do +that edit your settings.py and change: +``` +MEDIA_ROOT = ROOT_PATH + 'static/' +MEDIA_URL = '/' + EXTRA_URL + 'static/' +``` +To: +``` +MEDIA_ROOT = ROOT_PATH + 'static/v1.0.2/' +MEDIA_URL = '/' + EXTRA_URL + 'static/v1.0.2/' +``` +Then in the static directory: +``` +$ ln -s `pwd` v1.0.2 +``` + +Restart the web server to apply changes. + diff --git a/docs/old/fr/documentation-utilisateur.t2t b/docs/old/fr/documentation-utilisateur.t2t new file mode 100644 index 0000000..d4ff0e1 --- /dev/null +++ b/docs/old/fr/documentation-utilisateur.t2t @@ -0,0 +1,185 @@ +Documentation administrateur de Chimère +Étienne Loks +Last update: %%date(%m-%d-%Y) + += Généralités = + +Trois rôles sont disponibles en administration : + +- modérateur de l'application ; +- administrateur de l'application ; +- administrateur technique. + + +Le modérateur peut valider/modifier/ajouter les points d'intérêts et les +trajets. Le paragraphe « Modération dans Chimère » décrit les fonctionnalités +disponibles pour ce rôle. + +L'administrateur de l'application peut en plus administrer les catégories, les +sous-catégories, les icônes, les nouvelles, les thèmes de couleur et les zones. +Le paragraphe « Administration de l'application dans Chimère » décrit les +fonctionnalités disponibles pour ce rôle. + +L'administrateur technique a en plus accès à la création d'utilisateurs. + +Pour accéder aux pages d'administration, il suffit de s'identifier sur la page +accessible à l'adresse de base du site, suffixée par « /admin ». Bien sûr, il +faut préalablement que l'on ait créé un compte pour vous (ou que vous soyez +l'installateur de l'application). + +Attention, si une installation couvrant plusieurs zones a été faite, il faut +retirer le suffixe de zone dans l'adresse. + +//ex// : depuis une URL d'accès classique http://www.carte-ouverte.org/ avec une +zone d'accès http://www.carte-ouverte.org/rennes l'URL d'accès à +l'administration reste http://www.carte-ouverte.org/admin + += Modération dans Chimère = + +Une fois identifié, un utilisateur ayant les droits de modération dispose des +éléments suivants : + +- Points d'intérêts +- Trajets + + +Si certains éléments ne sont pas disponibles, c'est que le compte ne bénéficie +pas de droits suffisants pour la modération. + +== Modification des points d'intérêts/des trajets == + +Le modérateur peut accéder à tous les points d'intérêts et tous les trajets +validés ou non. +Une recherche par nom parmi les éléments est possible. De même, ces éléments +peuvent être filtrés par état ou par sous-catégorie. + +La modification/l'ajout d'élément est assez similaire à l'interface publique de +création. Seul le champ État est ajouté. +Celui-ci a trois valeurs : + + - Soumis, un élément a été proposé depuis l'interface publique ; + - Disponible, l'élément a été validé en modération ; + - Désactivé, l'élément a été mis de coté. + + +Il est possible de supprimer complètement un élément de la base. Cette opération +est non réversible mais une confirmation est demandée. + += Administration de l'application dans Chimère = + +Une fois identifié, un utilisateur ayant les droits d'administration de +l'application dispose des éléments suivants : + +- Catégories +- Icônes +- Nouvelles +- Points d'intérêts +- Sous-catégories +- Thème de couleurs +- Trajets +- Zones + + +Si certains éléments ne sont pas disponibles, c'est que le compte ne bénéficie +pas de droits suffisants pour la modération. + +La gestion des Points d'intérêts et des Trajets est décrite dans la section sur +la modération. + +== Création des zones == + +Les zones permettent de découper la carte en plusieurs parties. À chaque partie +peut être associé un suffixe spécifique pour accéder directement à cette zone +depuis une URL spécifique. + +//ex// : depuis une URL d'accès classique http://www.carte-ouverte.org/, il est +possible de définir un accès direct sur la zone de Rennes par l'URL +http://www.carte-ouverte.org/rennes + +Chaque partie peut être configurée pour accéder à seulement un sous-ensemble des +catégories disponibles (les utilisateurs finaux ne pourront proposer que des +éléments dans ces catégories sur cette zone). + +Pour chaque zone, les champs suivants sont disponibles : + +- Nom : le nom de la zone en question ; +- Urn : le suffixe associé à la zone, attention il doit respecter les règles de +nommage des URLs (pas d'accent, pas d'espace, etc.). Ce champ est optionnel, si +il est non défini il n'y a pas de raccourci ; +- Ordre : ordre d'affichage dans la liste de raccourcis (si cette liste est +visible) ; +- Disponible : pour rendre disponible ou non la zone ; +- Sous-catégories : un sous-ensemble de catégories à sélectionner pour limiter +les propositions utilisateurs. Ce champ est optionnel, si aucune sous-catégorie +n'est sélectionnée, toutes les sous-catégories sont disponibles ; +- Zone : la zone en question. Celle-ci correspond à ce qui est visible sur la +carte. + + +== Création d'icônes == + +À chaque sous-catégorie doit être associée une icône. Cette icône apparait sur +la légende de la carte et pour chaque point d'intérêt de la sous-catégorie. Une +même icône peut éventuellement être utilisée pour plusieurs sous-catégories +(même si cela est généralement une mauvaise idée). Pour une harmonie sur la +carte, il est préférable de se tenir à une taille fixe d'icône carrée (par +exemple 32 par 32 pixels). L'icône ne sera pas redimensionnée sur la carte. Les +formats jpg, gif et png sont acceptés mais le png est à privilégier. En effet, +pour de petits formats comme ceux-ci la compression jpg est peu efficace, de +plus elle ne gère pas la transparence (utile pour des icônes ne prenant pas tout +le carré). Le gif est aussi à déconseiller car ce format est maintenant obsolète +(notamment il ne prend en charge que 256 couleurs). + +== Création des thèmes de couleurs == + +Les thèmes de couleur sont utilisés par les trajets. Un thème de couleur est un +ensemble de couleurs qui coloreront aléatoirement les trajets d'une +sous-catégorie donnée. Pour faciliter la compréhension de la carte, il peut être +pertinent d'utiliser des couleurs approchantes pour un même thème de couleur +(par exemple des déclinaisons de bleu). + +Pour chaque thème de couleur, un nom est donné et une ou plusieurs couleurs sont +définies. Les couleurs sont définies en notation HTML RVB avec 6 chiffres +hexadécimaux (sans le #). Cf. une [liste de couleurs http://fr.wikipedia.org/wiki/Liste_de_couleurs]. + +== Création des catégories == + +Les catégories sont de simple conteneurs pour les sous-catégories. Elles +permettent d'organiser logiquement ces dernières et apparaissent comme nœuds +au niveau de la légende de la carte. + +Les catégories disposent des champs suivants : + +- Nom : le nom ; +- Disponible : l'affichage de la catégorie, si une catégorie est indisponible +aucune des sous-catégories sous celle-ci ne sera affichée ; +- Ordre : l'ordre d'apparition dans la légende ; +- Description : texte optionnel permettant de mettre à disposition une +description dans une rubrique « en savoir plus » de la catégorie. + + +== Création des sous-catégories == + +Les trajets et les points d'intérêts sont rangés dans des sous-catégories. +Les sous-catégories disposent des champs suivants : + +- Catégorie : la catégorie associée ; +- Nom : le nom de la sous-catégorie ; +- Disponible : l'affichage de la sous-catégorie ; +- Icône : l'icône associée à la sous-catégorie ; +- Thème de couleur : thème de couleur associé, ce champ est nécessaire pour +les sous-catégories de type trajet ou mixte ; +- Ordre : l'ordre d'apparition dans la légende ; +- Type d'élément : le type d'élément associé à la sous-catégorie : Point +d'intérêt, Trajet ou Mixte (Point d'intérêt et Trajet) ; +- Zones : les zones pour lesquelles cette sous-catégorie est disponible. Si +aucune zone n'est sélectionnée, cette sous-catégorie est disponible pour toutes +les zones. + + +== Création de nouvelles == + +Un système de nouvelles est disponible. +Pour chaque nouvelle, un nom et un contenu doit être renseigné. La disponibilité +est paramétrable. Le système de nouvelles est transversal à tous les sites. + diff --git a/docs/old/generate b/docs/old/generate new file mode 100755 index 0000000..c01cb57 --- /dev/null +++ b/docs/old/generate @@ -0,0 +1,21 @@ +#!/bin/bash +LANGUAGE="en" +if [ $1 ] + then LANGUAGE=$1; +fi + +if ! [ -d $LANGUAGE ] + then echo $LANGUAGE" is not an appropriate locale."; exit; +fi + +echo "Generate documentation for "$LANGUAGE"." + +cd $LANGUAGE + +for file in `ls *.t2t` +do + name=${file:0:${#file}-4} + txt2tags -q --encoding utf-8 --css-sugar --style style.css --toc -t xhtml -o ../$name".html" $file + txt2tags -q --encoding utf-8 --toc -t txt -o ../$name $file +done + diff --git a/docs/old/style.css b/docs/old/style.css new file mode 100644 index 0000000..5ba1a2f --- /dev/null +++ b/docs/old/style.css @@ -0,0 +1,67 @@ +html{ +background-color:#dfcbff; +font-family:arial; +font-size:80%; +} + +body{ +padding:20px; +background-color:white; +} + +a{ +color:#b400ff; +} + +h1{ +font-size:22px; +margin-left:auto; +margin-right:auto; +margin-bottom:10px; +padding-left:20px; +color:white; +background-color:#b488ff; +} + +h2{ +font-size:18px; +padding-left:20px; +color:#b400ff; +} + +h3{ +padding-left:20px; +font-weight:normal; +font-style:italic; +color:#b400ff; +} + +pre{ +background-color:#dfcbff; +padding:10px 6px; +} + +table{ +border-spacing:0px; +border:1px solid; +border-right:None; +} + +td, th, tr{ +border:None; +margin:0; +padding:0; +border-spacing:0px; +border-right:1px solid; +} + +td{ +padding:4px 8px; +} + +th{ +background-color:#dfcbff; +padding:8px; +border-bottom:1px solid; +} + diff --git a/docs/style.css b/docs/style.css deleted file mode 100644 index 5ba1a2f..0000000 --- a/docs/style.css +++ /dev/null @@ -1,67 +0,0 @@ -html{ -background-color:#dfcbff; -font-family:arial; -font-size:80%; -} - -body{ -padding:20px; -background-color:white; -} - -a{ -color:#b400ff; -} - -h1{ -font-size:22px; -margin-left:auto; -margin-right:auto; -margin-bottom:10px; -padding-left:20px; -color:white; -background-color:#b488ff; -} - -h2{ -font-size:18px; -padding-left:20px; -color:#b400ff; -} - -h3{ -padding-left:20px; -font-weight:normal; -font-style:italic; -color:#b400ff; -} - -pre{ -background-color:#dfcbff; -padding:10px 6px; -} - -table{ -border-spacing:0px; -border:1px solid; -border-right:None; -} - -td, th, tr{ -border:None; -margin:0; -padding:0; -border-spacing:0px; -border-right:1px solid; -} - -td{ -padding:4px 8px; -} - -th{ -background-color:#dfcbff; -padding:8px; -border-bottom:1px solid; -} - diff --git a/docs/upgrade.rst b/docs/upgrade.rst new file mode 100644 index 0000000..10548d7 --- /dev/null +++ b/docs/upgrade.rst @@ -0,0 +1,190 @@ +.. -*- coding: utf-8 -*- + +=============== +Chimère upgrade +=============== + +:Author: Étienne Loks +:date: 2012-02-15 +:Copyright: CC-BY 3.0 + +Get new version of dependencies +------------------------------- + +From version 1.2 to 2.x +*********************** + +Install `Django South `_. + +From version prior to 1.1 to 1.1 +******************************** + +Upgrade Django to the 1.2 version. +Install the `Beautiful Soup `_ library. + +Get the new version +------------------- + +First of all get the new version of the code source. You have two choices from +the archive or from the Git repository. + +Download archive from the download site +*************************************** + +Versions are available at this `address `_. +Take care of getting the last version in the desired X.Y branch (for instance +the last version for the 1.0 branch is version 1.0.2 as the time of writing of +this document). +Extract it to the desired destination path:: + + wget http://www.peacefrogs.net/download/chimere -q -O -| html2text + (...) + [[ ]] chimere-1.0.0.tar.bz2 17-Nov-2010 16:51 53K + [[ ]] chimere-1.0.1.tar.bz2 17-Nov-2010 16:51 53K + [[ ]] chimere-1.0.2.tar.bz2 17-Nov-2010 16:51 53K + (...) + + wget http://www.peacefrogs.net/download/chimere/chimere-1.0.2.tar.bz2 + mv chimere-1.0.2.tar.bz2 /var/local/django + cd /var/local/django + tar xvjf chimere-1.0.2.tar.bz2 + cd chimere-1.0.2 + +Get from the Git repository +*************************** + +Clone the Git repository, checkout the desired version and copy it to the +desired destination path:: + + git clone git://www.peacefrogs.net/git/chimere + cd chimere + git tag -l + (...) + v1.0.0 + v1.0.1 + v1.0.2 + git checkout v1.0.2 + cd .. + mv chimere /var/local/dgango/chimere-1.0 + cd /var/local/dgango/chimere-1.0 + +Copy files from your old installation +------------------------------------- + +From your old installation at least copy "settings.py" and the content of +"static/icons/" and "static/upload/" to the new installation. +You have probably customised some styles and templates (for instance +"styles.css", "welcome.html" and "base_user.html") don't forget to copy them and +eventualy adapt them (if you have old vanilla version of this file comparing +with the new one provided is easier). + +Adapt settings.py +----------------- + +The format of settings.py could have evolved, the easiest way to complete your +settings.py is to compare your old settings.py.example and the new one provided. + +Specific upgrade from version 1.0 to version 1.1 +*************************************************** + +Version 1.1 of Chimère uses Django 1.2 and with it the way to define database +has changed. + +Old way to define your database is:: + + DATABASE_ENGINE = 'postgresql_psycopg2' + DATABASE_NAME = 'chimere' + DATABASE_USER = 'chimere-user' + DATABASE_PASSWORD = 'password' + DATABASE_HOST = 'localhost' + DATABASE_PORT = '' + +The new one looks like:: + + DATABASES = { + 'default': { + 'NAME': 'ratatouille', + 'ENGINE': 'django.contrib.gis.db.backends.postgis', + 'HOST': 'localhost', + 'PORT': '5432', + 'USER': 'chimere-user', + 'PASSWORD': 'password', + }, + } + +Be careful to adapt properly your settings.py + +Migrate database +---------------- + +From 1.2 to 2.x +*************** + +Django South is now used to manage database migrations. Add 'south' to your +INSTALLED_APPS list in settings.py and run:: + + ./manage.py syncdb + ./manage.py migrate main 0001 --fake + ./manage.py migrate main + + +From version prior to 1.2 to 1.2 +******************************** + +Migration scripts test your installation before making changes so you probably +won't have any lost but by precaution before running theses scripts don't forget +to backup your database. +You can also make a copy of your current database into a new database and make +the new installation to this new database. + +The gdal binding for python is necessary to run the upgrade scripts (available +in the python-gdal package in Debian). + +If you run the migration scripts in a production environnement stop the old +instance of Chimère before executing the migration script. Perhaps prepare the +web server to point to the new installation before doing the database upgrade +(cf. next paragraph). + +In "settings.py" verify that "chimere.scripts" is in the INSTALLED_APPS. + +After that in the chimere directory just execute the script:: + + python ./scripts/upgrade + +Point to the new installation +----------------------------- + +Most of the job is done. You'll just have to configure your web server to serve +the new version. +For instance for Apache the directive is changed from:: + + PythonPath "['/var/local/django/chimere/'] + sys.path" + +To:: + + PythonPath "['/var/local/django/chimere-1.0.2/'] + sys.path" + +Restart your web server and apart from web browser cache issues this should work. + +Force the upgrade of visitor's web browser cache +------------------------------------------------ + +If major changes in the javascript has be done between version, many of your +users could experience problems. There are many tricks to force the refresh +of their cache. One of them is to change the location of statics files. To do +that edit your settings.py and change:: + + MEDIA_ROOT = ROOT_PATH + 'static/' + MEDIA_URL = '/' + EXTRA_URL + 'static/' + +To:: + + MEDIA_ROOT = ROOT_PATH + 'static/v1.0.2/' + MEDIA_URL = '/' + EXTRA_URL + 'static/v1.0.2/' + +Then in the static directory:: + + ln -s `pwd` v1.0.2 + +Restart the web server to apply changes. + -- cgit v1.2.3