summaryrefslogtreecommitdiff
path: root/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'settings.py')
-rw-r--r--settings.py88
1 files changed, 82 insertions, 6 deletions
diff --git a/settings.py b/settings.py
index 677cf83..0d7009c 100644
--- a/settings.py
+++ b/settings.py
@@ -19,19 +19,20 @@ CONTACT_EMAIL = ''
STATIC_URL = '/static/'
STATIC_ROOT = ROOT_PATH + 'static/'
-STATICFILES_DIRS = (ROOT_PATH + 'project_static',)
+STATICFILES_DIRS = (
+ os.path.join(ROOT_PATH, "chimere_example_static"),
+)
TINYMCE_URL = '/tinymce/'
JQUERY_JS_URLS = ('/javascript/jquery/jquery.js',
'/javascript/jquery-ui/jquery-ui.js',)
JQUERY_CSS_URLS = ('/javascript/jquery-ui/css/smoothness/jquery-ui.css',
'/javascript/jquery-ui-themes/base/jquery.ui.all.css')
-
OSM_CSS_URLS = ["http://www.openlayers.org/api/theme/default/style.css"]
GPSBABEL = '/usr/bin/gpsbabel'
GPSBABEL_OPTIONS = 'simplify,crosstrack,error=0.005k' # simplify with an
- # error of 5 meters
+ # error of 5 meters
#GPSBABEL_OPTIONS = 'simplify,count=100'
## chimere specific ##
@@ -80,7 +81,10 @@ CHIMERE_SHAPEFILE_ENCODING = 'ISO-8859-1'
# it could be a good idea to hide it to an admin who could'nt do that
CHIMERE_HIDE_PROPERTYMODEL = False
-# enable routing in Chimère
+# clustering of markers
+CHIMERE_ENABLE_CLUSTERING = False
+
+# enable routing in Chimere
CHIMERE_ENABLE_ROUTING = False
CHIMERE_ROUTING_TRANSPORT = (('foot', _(u"Foot")),
@@ -102,18 +106,40 @@ CHIMERE_ROUTING_ENGINE = {
}
CHIMERE_ROUTING_FAIL_MESSAGE = u"""<h3 class='warn'>Attention</h3>
-<p>Le moteur de routage a échoué dans sa recherche de trajet. Les points de
-départ ou d'arrivée sont peut-être trop loin d'une voie existante ou le trajet
+<p>Le moteur de routage a echoue dans sa recherche de trajet. Les points de
+depart ou d'arrivee sont peut-etre trop loin d'une voie existante ou le trajet
est trop dangereux.</p>"""
NOMINATIM_URL = 'http://nominatim.openstreetmap.org/search'
+# Fields used to geolocate with nominatim (http://wiki.openstreetmap.org/wiki/Nominatim#Search)
+# from external sources. Key must be a valid parameters for Nominatim. If given
+# value are property slugs use the corresponding value otherwise use it as a
+# fixed value
+# e.g : {'street':'address', 'city':'city', 'country':u'France'}
+CHIMERE_NOMINATIM_FIELDS = {'street':'address', 'city':'city',
+ 'country':u'France'}
+MOBILE_TEST = False
+MOBILE_DOMAINS = []
+
# thumbnail
CHIMERE_THUMBS_SCALE_HEIGHT=250
CHIMERE_THUMBS_SCALE_WIDTH=None
+# search engine
+CHIMERE_SEARCH_ENGINE = False
+HAYSTACK_CONNECTIONS = {
+ 'default': {
+ 'ENGINE': 'haystack.backends.solr_backend.SolrEngine',
+ 'URL': 'http://127.0.0.1:8080/solr',
+ 'INCLUDE_SPELLING': True,
+ },
+}
+
CHIMERE_CSV_ENCODING = 'ISO-8859-1'
+CHIMERE_DEFAULT_ACTIONS = ['view', 'contribute']
+CHIMERE_DEFAULT_ACTION_LABEL = [u"Cartes", u"Ajouter un element"]
# generic contact email
CONTACT_EMAIL = ''
@@ -227,11 +253,17 @@ INSTALLED_APPS += [
LOG_PATH = '/var/log/django/'
+CHIMERE_VIEW_RENDERER = 'openlayers' # 'openlayers' or 'leaflet'
+CHIMERE_EDIT_RENDERER = 'openlayers' # 'openlayers'
+
try:
from local_settings import *
except ImportError, e:
print 'Unable to load local_settings.py:', e
+if CHIMERE_SEARCH_ENGINE:
+ INSTALLED_APPS.insert(INSTALLED_APPS.index('south'), 'haystack')
+
if 'LOGGING' not in globals():
global LOGGING
LOGGING = {'version': 1,
@@ -290,6 +322,50 @@ if 'CHIMERE_SHARE_NETWORKS' not in globals():
STATIC_URL + 'chimere/img/identica.png'),
)
+if 'MAP_JS_URLS' not in globals():
+ global MAP_JS_URLS
+ MAP_JS_URLS = {
+ 'openlayers':[
+ STATIC_URL + "openlayers/OpenLayers.js",
+ STATIC_URL + "openlayers/SimplePanZoom.js",
+ "http://www.openstreetmap.org/openlayers/OpenStreetMap.js",
+ STATIC_URL + "chimere/js/jquery.chimere-ol.js"
+ ],
+ 'leaflet':[
+ STATIC_URL + "leaflet/leaflet.js",
+ STATIC_URL + "chimere/js/jquery.chimere-leaflet.js",
+ "http://maps.stamen.com/js/tile.stamen.js?v1.2.1"
+ ]
+ }
+ if DEBUG:
+ MAP_JS_URLS['leaflet'][0] = STATIC_URL + "leaflet/leaflet-src.js"
+ if CHIMERE_ENABLE_CLUSTERING:
+ MAP_JS_URLS['leaflet'] += [
+ STATIC_URL + "leaflet-markercluster/leaflet.markercluster.js"
+ ]
+if 'MAP_CSS_URLS' not in globals():
+ global MAP_CSS_URLS
+ MAP_CSS_URLS = {
+ 'openlayers':["http://www.openlayers.org/api/theme/default/style.css"],
+ 'leaflet':[STATIC_URL + "leaflet/leaflet.css",
+ STATIC_URL + "leaflet-markercluster/MarkerCluster.css",
+ STATIC_URL + "leaflet-markercluster/MarkerCluster.Default.css",
+ ]
+ }
+ # key: [(url, condition)]
+ MAP_CONDITIONNAL_CSS_URLS = {
+ 'openlayers':[("http://www.openlayers.org/api/theme/default/style.css",
+ None)],
+ 'leaflet':[
+ (STATIC_URL + "leaflet/leaflet.css", None),
+ (STATIC_URL + "leaflet/leaflet.ie.css", 'lte IE 8'),
+ (STATIC_URL + "leaflet-markercluster/MarkerCluster.css", None),
+ (STATIC_URL + "leaflet-markercluster/MarkerCluster.Default.css", None),
+ (STATIC_URL + "leaflet-markercluster/MarkerCluster.Default.ie.css",
+ 'lte IE 8'),
+ ]
+ }
+
if 'OSM_JS_URLS' not in globals():
global OSM_JS_URLS
OSM_JS_URLS = [STATIC_URL + "openlayers/OpenLayers.js",