Modules and components

Info

For a complete list of available parameters, refer to the default values in geotrek/settings/base.py.

Enable Apps

To disable specific modules, modify the custom settings file by adding the following code:

# Disable infrastructure and maintenance modules
_INSTALLED_APPS = list(INSTALLED_APPS)
_INSTALLED_APPS.remove('geotrek.infrastructure')
_INSTALLED_APPS.remove('geotrek.maintenance')
INSTALLED_APPS = _INSTALLED_APPS
INSTALLED_APPS = (
  'geotrek.cirkwi',
  'geotrek.authent',
  'geotrek.common',
  'geotrek.altimetry',
  'geotrek.core',
  'geotrek.infrastructure',
  'geotrek.signage',
  'geotrek.maintenance',
  'geotrek.zoning',
  'geotrek.land',
  'geotrek.trekking',
  'geotrek.tourism',
  'geotrek.flatpages',
  'geotrek.feedback',
  'geotrek.api',
)

Path model enabled

This parameter allows enabling or disabling the Path module:

PATH_MODEL_ENABLED = True
PATH_MODEL_ENABLED = False

Trail model enabled

This parameter allows enabling or disabling the Trail module:

TRAIL_MODEL_ENABLED = True
TRAIL_MODEL_ENABLED = False

Landedge model enabled

This parameter allows enabling or disabling the Landedge module:

LANDEDGE_MODEL_ENABLED = True
LANDEDGE_MODEL_ENABLED = False

Signage model enabled

This parameter allows enabling or disabling the Signage module:

SIGNAGE_MODEL_ENABLED = True
SIGNAGE_MODEL_ENABLED = False

Infrastructure model enabled

This parameter allows enabling or disabling the Infrastructure module:

INFRASTRUCTURE_MODEL_ENABLED = True
INFRASTRUCTURE_MODEL_ENABLED = False

Project model enabled

This parameter allows enabling or disabling the Project module:

PROJECT_MODEL_ENABLED = True
PROJECT_MODEL_ENABLED = False

Intervention model enabled

This parameter allows enabling or disabling the Intervention module:

INTERVENTION_MODEL_ENABLED = True
INTERVENTION_MODEL_ENABLED = False

Report model enabled

This parameter allows enabling or disabling the Report module:

REPORT_MODEL_ENABLED = True
REPORT_MODEL_ENABLED = False

Trekking model enabled

This parameter allows enabling or disabling the Trekking module:

TREKKING_MODEL_ENABLED = True
TREKKING_MODEL_ENABLED = False

Poi model enabled

This parameter allows enabling or disabling the Poi module:

POI_MODEL_ENABLED = True
POI_MODEL_ENABLED = False

Service model enabled

This parameter allows enabling or disabling the Service module:

SERVICE_MODEL_ENABLED = True
SERVICE_MODEL_ENABLED = False

Tourism enabled

This setting enables or disables tourism-related menus, such as touristic content and events:

TOURISM_ENABLED = True
TOURISM_ENABLED = False

Touristic content model enabled

This parameter allows enabling or disabling the Touristic content module:

TOURISTICCONTENT_MODEL_ENABLED = True
TOURISTICCONTENT_MODEL_ENABLED = False

Touristic event model enabled

This parameter allows enabling or disabling the Touristic event module:

TOURISTICEVENT_MODEL_ENABLED = True
TOURISTICEVENT_MODEL_ENABLED = False

Site model enabled

This parameter allows enabling or disabling the Site module:

SITE_MODEL_ENABLED = True
SITE_MODEL_ENABLED = False

Course model enabled

This parameter allows enabling or disabling the Course module:

COURSE_MODEL_ENABLED = True
COURSE_MODEL_ENABLED = False

Flatpages enabled

Flatpages are used in Geotrek-rando and Geotrek-mobile. This setting allows enabling or disabling them in the Django menus:

FLATPAGES_ENABLED = True
FLATPAGES_ENABLED = False

Accessibility attachments enabled

This setting enables or disables the accessibility menu for attachments:

ACCESSIBILITY_ATTACHMENTS_ENABLED = True
ACCESSIBILITY_ATTACHMENTS_ENABLED = False

Note

  • Disabling some modules may cause compatibility issues during software upgrades.

  • If you seek community support, mention any customizations you have made.

Paths

Allow path deletion

If set to False, paths that are linked to at least one topology cannot be deleted:

ALLOW_PATH_DELETION_TOPOLOGY = True
ALLOW_PATH_DELETION_TOPOLOGY = False

Show extremities

If set to True, shows a bullet at path extremities :

SHOW_EXTREMITIES = False
SHOW_EXTREMITIES = True

Alert draft

If set to True, managers will receive an email notification whenever a path is changed to draft:

ALERT_DRAFT = False
ALERT_DRAFT = True

Alert review

If set to True, managers will receive an email notification whenever an object that can be validated is moved to review mode:

ALERT_REVIEW = False
ALERT_REVIEW = True

Signage and Blade

These parameters enable or disable submodules for signage blades and lines:

BLADE_ENABLED = True
LINE_ENABLED = True
BLADE_ENABLED = False
LINE_ENABLED = True

These parameters are used to have direction field on lines instead of blades.

DIRECTION_ON_LINES_ENABLED = False
DIRECTION_ON_LINES_ENABLED = True

Blade code type

You can change the type of the blade code field (string or integer):

BLADE_CODE_TYPE = INT
BLADE_CODE_TYPE = STR

Blade code format

You can modify the format of blade codes:

BLADE_CODE_FORMAT = "{signagecode}-{bladenumber}"

Example display: CD99.XIDNZEIU.01 (first blade of XIDNZEIU)

BLADE_CODE_FORMAT = "CD99.{signagecode}.{bladenumber}"

Line code format

You can modify the format of line codes. This setting is used in CSV exports for lines:

LINE_CODE_FORMAT = "{signagecode}-{bladenumber}-{linenumber}"

Example display: CD99.XIDNZEIU-01.02

LINE_CODE_FORMAT = "CD99.{signagecode}-{bladenumber}.{linenumber}"

Line distance format

You can modify the format of line distance. This setting is used in CSV exports for lines:

Example display: 8.5 km

LINE_DISTANCE_FORMAT = "{:0.1f} km"

Example display: 8.5 mi

LINE_DISTANCE_FORMAT = "{:0.1f} mi" # miles

Line time format

You can modify the format of line time. This setting is used in CSV exports for lines:

Example display: 3h05

LINE_TIME_FORMAT = "{hours}h{minutes:02d}"

Example display: 3:05

LINE_TIME_FORMAT = "{hours}:{minutes:02d}"

POI

Trek POI intersection margin

You can define a buffer around treks to intersect POIs (works only without dynamic segmentation).

TREK_POI_INTERSECTION_MARGIN = 500  # meters
TREK_POI_INTERSECTION_MARGIN = 800  # meters

Tourism

The TOURISM_INTERSECTION_MARGIN and OUTDOOR_INTERSECTION_MARGIN settings define a buffer distance (in meters) used to dynamically associate nearby content (POIs, services, events, tourism content, etc.) with other entities such as treks or outdoor sites. These parameters help control which elements are considered “nearby” and displayed in the API and Geotrek-rando or included in print/PDF exports.

Tourism intersection margin

The TOURISM_INTERSECTION_MARGIN setting defines the maximum distance (in meters) within which touristic contents and events are considered related to other objects (treks, POIs, services, etc.).

This setting is especially useful to reduce the number of tourism contents displayed around a trek, in order to improve readability and performance in the map interface (in the API, Geotrek-rando, Geotrek-widget…).

TOURISM_INTERSECTION_MARGIN = 500  # meters
TOURISM_INTERSECTION_MARGIN = 800  # meters

Note

This distance can be customized per trek practice in the admin interface: /admin/trekking/practice/<id>/change/

Outdoor intersection margin

The OUTDOOR_INTERSECTION_MARGIN setting defines the maximum distance (in meters) within which outdoor content (sites and courses) is considered related to other objects such as treks, POIs, services, or tourism content.

Like the tourism intersection margin, it can help limit the number of associated elements shown around outdoor content, making the map and exports more readable.

OUTDOOR_INTERSECTION_MARGIN = 500  # meters
OUTDOOR_INTERSECTION_MARGIN = 800  # meters

Note

  • This setting applies globally to all outdoor objects (sites and courses) and cannot be customized by activity.

  • Currently, adjusting the OUTDOOR_INTERSECTION_MARGIN also affects the distance used to associate outdoor content with treks. This side effect may lead to unintended behavior when trying to reduce only tourism content density around outdoor elements.

Land

You can insert circulation and authorization types using this command:

sudo geotrek loaddata /opt/geotrek-admin/lib/python*/site-packages/geotrek/land/fixtures/circulations.json
docker compose run --rm web ./manage.py loaddata /opt/geotrek-admin/lib/python*/site-packages/geotrek/land/fixtures/circulations.json

Show labels

Display labels on status elements on the map view:

SHOW_LABELS = True
SHOW_LABELS = False

Outdoor

Installed app for Outdoor

To enable the Outdoor module, add the following code to the custom settings file:

INSTALLED_APPS += ('geotrek.outdoor', )

Then run:

sudo dpkg-reconfigure -pcritical geotrek-admin
docker compose run --rm web update.sh

To insert Outdoor minimal data:

sudo geotrek loaddata /opt/geotrek-admin/lib/python*/site-packages/geotrek/outdoor/fixtures/basic.json
docker compose run --rm web ./manage.py loaddata /opt/geotrek-admin/lib/python*/site-packages/geotrek/outdoor/fixtures/basic.json

After installing the Outdoor module, you need to add permissions to user groups for outdoor sites and courses.

Note

Sensitive areas

Note

  • The sensitivity module was developed as part of the Biodiv’Sports project to provide a central platform for managing sensitive areas.

  • The official address of the Geotrek instance for Biodiv’Sports is: https://biodiv-sports.fr, which serves as the base URL for API calls.

Installed app for Sensitive areas

To enable the Sensitivity module, add the following code to the custom settings file:

INSTALLED_APPS += ('geotrek.sensitivity', )

To insert sensitivity area rules:

sudo geotrek loaddata /opt/geotrek-admin/lib/python*/site-packages/geotrek/sensitivity/fixtures/rules.json
cp -r /opt/geotrek-admin/lib/python*/site-packages/geotrek/sensitivity/fixtures/upload/rules/ /opt/geotrek-admin/var/media/upload/
sudo docker compose run --rm web ./manage.py loaddata rules
docker compose run --rm web bash
cp -r /opt/geotrek-admin/geotrek/sensitivity/fixtures/upload/* /opt/geotrek-admin/var/media/upload/

Sensitivity default radius

Defines the radius of sensitivity areas when not specified for species:

SENSITIVITY_DEFAULT_RADIUS = 100  # meters
SENSITIVITY_DEFAULT_RADIUS = 200  # meters

Sensitive area intersection margin

Defines the buffer around treks to intersect sensitive areas:

SENSITIVE_AREA_INTERSECTION_MARGIN = 500  # meters
SENSITIVE_AREA_INTERSECTION_MARGIN = 800  # meters

Note

If you modify this value after adding data, you must update the buffered geometry in SQL: UPDATE sensitivity_sensitivearea SET geom_buffered = ST_BUFFER(geom, <your new value>);

See also

See Sensitive area import section for data import instructions.

Zoning

These 3 parameters (LAND_BBOX_CITIES_ENABLED, LAND_BBOX_DISTRICTS_ENABLED and LAND_BBOX_AREAS_ENABLED) enable or disable zoning combo-boxes in the list map view:

LAND_BBOX_CITIES_ENABLED = True
LAND_BBOX_DISTRICTS_ENABLED = True
LAND_BBOX_AREAS_ENABLED = False
LAND_BBOX_CITIES_ENABLED = False
LAND_BBOX_DISTRICTS_ENABLED = False
LAND_BBOX_AREAS_ENABLED = True
Zoning combo boxes