Customizing the Look and Feel of GeoNode

This section will explain how to change GeoNode’s main logo, the index page and the colors. It also contains an introduction to Django’s template and media management.

The paths to the different locations are assumed to be on Ubuntu with GeoNode installed via packages, but the same notions can be applied in any deployment.

Customizing the home page

GeoNode uses Django’s template engine, /etc/geonode/templates is empty by default but it is abover other folders in the template lookup hierarchy. This means that it is possible to copy any html template to that location and it will take precence. Let’s start by doing the following:

sudo cp /var/lib/geonode/src/GeoNodePy/geonode/templates/index.html /etc/geonode/templates

The copy of index.html that was just created takes precedence over the default one, the text in the main section can be changed there and a reload of the web page in the browser will show the updated version.

Note

Changes to templates are picked up automatically and do not require a server restart.

With the same approach, the structure of all pages can be modified by copying and then editing page_template.html. We recommend reading about the Django template language for advanced customizations.

Note

While editing the templates in place will also achieve the expected results, it will make upgrading GeoNode harder, therefore it is recommended to follow the approach described above.

Changing the entire site media

All the files in /var/lib/geonode/src/GeoNodePy/geonode/media/theme can be overriden using this method, including site.css which contains most of the color schemes for the entire site. Once you copy it, the file should live in /etc/geonode/media/theme/site.css.

Changing the default basemap

This setting is configured in MAP_BASELAYERS in /etc/geonode/local_settings.py

Change the visibility setting in the one that is set to True to False, and set it to True in the layer you want as the new default. Please make sure there is only one with visible: True, to avoid any conflicts.

Adding external WMS servers by default to the map composer

The easiest way to do this is to copy the MAP_BASELAYERS setting from /var/lib/geonode/src/GeoNodePy/geonode/settings.py to /etc/geonode/local_settings.py and then adding a line with the wms as a source, without specifying any layer:

},{
  "source": {"url": "http://my-server/wms?"},

The source’s title in the composer would depend on what is configured in the external WMS server.