summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@peacefrogs.net>2012-07-11 16:14:38 +0200
committerÉtienne Loks <etienne.loks@peacefrogs.net>2012-07-11 16:14:38 +0200
commit23f3c9a1909033448c2d0e7756363e2d454e799d (patch)
treede738a06f0b94e337f51118ce1b28c13a261e8bd
parentaab7af8332bc96e6f8c68d669b3ec2b1a6d502e0 (diff)
downloadChimère-23f3c9a1909033448c2d0e7756363e2d454e799d.tar.bz2
Chimère-23f3c9a1909033448c2d0e7756363e2d454e799d.zip
Update doc - minor fix on description where no area is provided
-rw-r--r--apache/django.wsgi2
-rw-r--r--chimere/views.py3
-rw-r--r--docs/install.rst46
-rw-r--r--example_project/local_settings.py.sample29
-rw-r--r--example_project/settings.py1
5 files changed, 63 insertions, 18 deletions
diff --git a/apache/django.wsgi b/apache/django.wsgi
index 158f87d..dc3d9f4 100644
--- a/apache/django.wsgi
+++ b/apache/django.wsgi
@@ -1,5 +1,5 @@
import os, sys
sys.path.append('/var/local/django/chimere/')
-os.environ['DJANGO_SETTINGS_MODULE'] = 'chimere.settings'
+os.environ['DJANGO_SETTINGS_MODULE'] = 'example_project.settings'
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
diff --git a/chimere/views.py b/chimere/views.py
index 2c50e2a..0decb87 100644
--- a/chimere/views.py
+++ b/chimere/views.py
@@ -584,7 +584,8 @@ def getTinyfiedUrl(request, parameters, area_name=''):
response_dct, redir = get_base_response(area_name)
if redir:
return redir
- url = reverse('chimere:tiny', args=[response_dct['area_name'] + '/', urn])
+ url = reverse('chimere:tiny', args=[response_dct['area_name'] \
+ if response_dct['area_name'] else '' + '/', urn])
if not url.startswith('http'):
url = get_base_uri(request) + url
text = settings.PROJECT_NAME
diff --git a/docs/install.rst b/docs/install.rst
index 426b62d..c1bc5eb 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -29,6 +29,7 @@ Prerequisites
- `psycopg2 <http://freshmeat.net/projects/psycopg/>`_
- `Python Imaging Library <http://www.pythonware.com/products/pil/>`_
- `Beautiful Soup <http://www.crummy.com/software/BeautifulSoup/>`_
+ - python-simplejson
- `lxml <http://lxml.de/>`_
- `jquery <http://jquery.com/>`_ version 1.7.1 or better
- `jquery-ui <http://jqueryui.com/>`_
@@ -46,15 +47,17 @@ Optionaly (but recommanded):
- `tinymce <http://tinymce.moxiecode.com/>`_
- `gpsbabel <http://www.gpsbabel.org/>`_
+ - django-celery if you want to manage import
The simpliest way to obtain these packages is to get them from your favorite
Linux distribution repositories. For instance on Debian Wheezy::
apt-get install python python-django python-django-south \
- python-beautifulsoup tinymce apache2 libgeos-3.3.1 proj gdal-bin \
+ python-beautifulsoup tinymce apache2 libgeos-3.3.3 proj-bin gdal-bin \
python-gdal python-lxml python-psycopg2 python-imaging gettext \
- postgresql-9.1 postgresql-9.1-postgis libjs-jquery libjs-jquery-ui
+ postgresql-9.1 postgresql-9.1-postgis libjs-jquery libjs-jquery-ui \
+ python-django-celery python-simplejson
If these packages do not exist in your distribution's repository, please refer
to the applications' websites.
@@ -72,7 +75,6 @@ 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/9.1/contrib/postgis-1.5/postgis.sql
psql -d chimere -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
@@ -81,8 +83,8 @@ Install the sources
Choose a path to install your Chimère::
- sudo mkdir /var/local/django
INSTALL_PATH=/var/local/django
+ sudo mkdir $INSTALL_PATH
From an archive
+++++++++++++++
@@ -105,7 +107,7 @@ Another solution is to get the last git version::
git clone git://www.peacefrogs.net/git/chimere
cd chimere
git tag -l # list tagged versions
- git checkout v2.0.0 # checkout the desired version
+ git checkout v2.0 # checkout the desired version
Base configuration
@@ -117,21 +119,23 @@ get another project based on Chimere)::
cd $INSTALL_PATH/chimere
cp -r example_project mychimere_project
-In your chimere application directory create settings.py to fit to your
+In your chimere application directory create local_settings.py to fit to your
configuration.
-A base template is provided (settings.py.example) and short descriptions of
-the more relevant fields are given below (at least check them)::
+A base template is provided (local_settings.py.example) and short descriptions of
+the more relevant fields are given below (at least check them). Most of theses
+settings are initialized in settings.py. ::
cd $INSTALL_PATH/chimere/mychimere_project
- cp settings.py.example settings.py
- vim settings.py
+ cp local_settings.py.sample local_settings.py
+ vim local_settings.py
:Fields:
+ * DATABASES: parameters for the database
* PROJECT_NAME: name of the project
+ * ROOT_URLCONF: url configuration for your project something like:
+ 'mychimere_project.urls'
* ROOT_PATH: path to the installation of Chimère
- * SERVER_URL: root of the web address of Chimère
- * EXTRA_URL: suffix to the web address of Chimère
* EMAIL_HOST: smtp of an email server to send emails
* TINYMCE_URL: url to tinymce path (default is appropriate
for a Debian installation with tinymce activated)
@@ -145,11 +149,8 @@ the more relevant fields are given below (at least check them)::
* CHIMERE_DEFAULT_CENTER: center of the map
* CHIMERE_DYNAMIC_CATEGORIES: dynamic load of categories on the main map
* CHIMERE_DISPLAY_AREAS: display area's shortcuts
- * DATABASES: parameters for the database
* TIME_ZONE: local time zone for this installation
* LANGUAGE_CODE: language code for this installation
- * ROOT_URLCONF: url configuration for your project something like:
- 'mychimere_project.urls'
Manage media path permission::
@@ -157,11 +158,23 @@ Manage media path permission::
sudo chown -R user:www-data media
sudo chmod -R g+w media
+Create log file::
+
+ mkdir /var/log/django
+ touch /var/log/django/chimere.log
+ sudo chown -R root:www-data /var/log/django/
+ sudo chmod -R g+w /var/log/django/
+
Regroup static files in one path::
cd $INSTALL_PATH/chimere/mychimere_project
./manage.py collectstatic
+Removing celery configuration
++++++++++++++++++++++++++++++
+
+TODO
+
Compiling languages
*******************
@@ -213,11 +226,14 @@ Install mod_wsgi for apache::
sudo apt-get install libapache2-mod-wsgi
+TODO: adapt apache-wsgi.conf
Create and edit a configuration for Chimère::
sudo vim $INSTALL_PATH/chimere/apache/django.wsgi
sudo vim $INSTALL_PATH/chimere/apache/apache-wsgi.conf
sudo cp $INSTALL_PATH/chimere/apache/apache-wsgi.conf /etc/apache2/sites-available/chimere
+ # create log dir
+ sudo mkdir /var/log/apache2/chimere/
Adapt the files django.wsgi (with the correct sys path) and chimere.
diff --git a/example_project/local_settings.py.sample b/example_project/local_settings.py.sample
new file mode 100644
index 0000000..9ccd41d
--- /dev/null
+++ b/example_project/local_settings.py.sample
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# rename this file to local_settings.py and overload settings in this file
+
+import os
+
+CHIMERE_OSM_API_URL = 'api06.dev.openstreetmap.org' # test URL
+CHIMERE_OSM_USER = 'osm_user'
+CHIMERE_OSM_PASSWORD = 'osm_pass'
+
+ADMINS = (
+ # ('Your Name', 'your_email@domain.com'),
+)
+
+MANAGERS = ADMINS
+
+DATABASES = {
+ 'default': {
+ 'NAME': 'chimere',
+ 'ENGINE': 'django.contrib.gis.db.backends.postgis',
+ 'HOST': 'localhost',
+ 'PORT': '5432',
+ 'USER': 'postgres',
+ 'PASSWORD': '',
+ },
+}
+
+ROOT_URLCONF = 'example_project.urls'
diff --git a/example_project/settings.py b/example_project/settings.py
index 69a3fbf..0164673 100644
--- a/example_project/settings.py
+++ b/example_project/settings.py
@@ -12,7 +12,6 @@ TEMPLATE_DEBUG = DEBUG
PROJECT_NAME = u'Chimère'
ROOT_PATH = os.path.realpath(os.path.dirname(__file__)) + "/"
-SERVER_URL = 'http://www.mydomain.com/'
EMAIL_HOST = 'localhost'
STATIC_URL = '/static/'
STATIC_ROOT = ROOT_PATH + 'static/'