Custom setting file

Geotrek configuration is currently restricted to values present in etc/settings.ini.

However, it is still possible to write a custom Django setting file.

  • Create your a file in geotrek/settings/ with the following content :
from .prod import *

# My custom value
  • Add this etc/settings.ini to specify the newly created setting :
settings = settings.custom
  • As for any change in settings, re-run make env_standalone deploy.

Disable modules and components

In order to disable a full set of features, in the custom settings file, add the following code:

# Disable infrastructure and maintenance

In order to remove notion of trails:


In order to remove zoning combo-boxes on list map:

notes:By doing so, some software upgrades may not be as smooth as usual. Never forget to mention this customization if you ask for community support.

WYSIWYG editor configuration

Text form fields are enhanced using TinyMCE.

Its configuration can be customized using advanced settings (see above paragraph).

For example, in order to control which buttons are to be shown, and which tags are to be kept when cleaning-up, add this bloc :

    'theme_advanced_buttons1': 'bold,italic,forecolor,separator,code',
    'valid_elements': "img,p,a,em/i,strong/b",

This will apply to all text fields.

For more information on configuration entries available, please refer to the official documentation of TinyMCE version 3.

View attachments in the browser

Attached files are downloaded by default by browser, with the following line, files will be opened in the browser :


Using IGN Geoportail WMTS tiles

Specify the tiles URLs this way in your custom Django setting file:

    ('Scan', 'http://{s}{z}/{x}/{y}.png', '(c) OpenStreetMap Contributors'),
    ('Ortho', 'http://{s}{z}/{x}/{y}.jpg', '(c) MapBox'),

External authent

You can authenticate user against a remote database table or view.

To enable this feature, fill authent_dbname and other fields in etc/settings.ini.

Expected columns in table/view are :

  • username : string (unique)
  • first_name : string
  • last_name : string
  • password : string (simple md5 encoded, or full hashed and salted password)
  • email : string
  • level : integer (1: readonly, 2: redactor, 3: path manager, 4: trekking manager, 6: administrator)
  • structure : string
  • lang : string (language code)

User management will be disabled from Administration backoffice.

In order to disable remote login, just remove authent_dbname value in settings file, and update instance (see paragraph above).

Geotrek can support many types of users authentication (LDAP, oauth, ...), contact-us for more details.

Map layers colors and style

All layers colors can be customized from the settings. See Leaflet reference for vectorial layer style.

  • To apply these style changes, re-run sudo supervisorctl restart all.
MAP_STYLES['path'] = {'color': 'red', 'weight': 5}

Or change just one parameter (the opacity for example) :

MAP_STYLES['city']['opacity'] = 0.8

Regarding colors that depend from database content, such as land layers (physical types, work management...) or restricted areas. We use a specific setting that receives a list of colors :

COLORS_POOL['restrictedarea'] = ['#ff00ff', 'red', '#ddddd'...]

See the default values in geotrek/settings/ for the complete list of available styles.

Restart the application for changes to take effect.

External raster layers

It is possible to add overlay tiles layer on maps. For example, it can be useful to:

  • Get the cadastral parcels on top of satellite images
  • Home made layers (with Tilemill or QGisMapserver for example). Like the park center borders, traffic maps, IGN BDTopo® or even the Geotrek paths that are marked as invisible in the database!

In, just add the following lines:

    ('Coeur de parc', 'http://serveur/coeur-parc/{z}/{x}/{y}.png', '© PNF'),

Expected properties

For GeoJSON files, you can provide the following properties :

  • title: string
  • description: string
  • website: string
  • phone: string
  • pictures: list of objects with url and copyright attributes
  • category: object with id and label attributes

Disable darker map backgrounds

Since IGN map backgrounds are very dense and colourful, a dark opacity is applied. In order to disable, change this MapEntity setting :


Override public document OpenOffice template

Copy the file geotrek/trekking/templates/trekking/trek_public.odt to var/media/templates/trekking/trek_public.odt.

Edit the copy using OpenOffice.


The default template may change in the future versions. You will be in charge of porting the modification to your copy.

Custom font in public document OpenOffice template

In order to use custom fonts in trek PDF, it is necessary to install the font files on the server.

Microsoft fonts like Arial and Verdana can be installed via the package manager

sudo apt-get install ttf-mscorefonts-installer

For specific fonts, copy the .ttf (or .otf) files into the folder /usr/local/share/fonts/custom/ as root, and run the following command


For more information, check out Ubuntu documentation.

Custom colors in public document OpenOffice template

Trek export geometries are translucid red by default. In order to control the apparence of objects in public trek exports, use the following setting :

MAP_STYLES['print']['path'] = {'weight': 3}

See Leaflet reference documentation for detail about layers apparence.

Custom logos

You might also need to deploy logo images in the following places :

  • var/media/upload/favicon.png
  • var/media/upload/logo-login.png
  • var/media/upload/logo-header.png

Share services between several Geotrek instances

As explained in the design section, Geotrek relies on several services. They are generic and reusable, and can thus be shared between several instances, in order to save system resources for example.

A simple way to achieve this is to install one instance with everything as usual (standalone), and plug the other instances on its underlying services.


Sharing your postgreSQL server is highly recommended. Create several databases for each of your instances.

Then in etc/settings.ini, adjust the host and dbname sections of each instance.

Capture and conversion

On the standalone server, make sure the services will be available to others. Add the following lines in its settings.ini :

host =

host =

In, point the tiles URL to the shared services (replace SERVER by the one you installed as standalone) :


Shutdown useless services

Now that your instances point the shared server. You can shutdown the useless services on each instance.

Start by stopping everything :

sudo stop geotrek

Before you used to run make env_standalone deploy on every server. Now you will have only one standalone, and on the other ones the Geotrek application only.

To achieve this, you will just have to run the prod environment instead of standalone in the deployment procedure (or when settings are changed) :

make env_prod deploy

Control number of workers and request timeouts

By default, the application runs on 4 processes, and timeouts after 30 seconds.

To control those values, add a section in etc/settings.ini for each running service. See conf/settings-defaults.cfg for an exhaustive list:

workers = 4
timeout = 30

To know how many workers you should set, please refer to gunicorn documentation.