Skip to content

Configuration

Apart from the deployment-specific configuration (see Deploy sections), all the configuration will happen in the files stored in this repo's config/ folder.

Tip

Superset config files are actually python files. which means that not only can we define config values (e.g. ROW_LIMIT = 5000) but we can also write functions, classes, override some Superset object and behaviours. You have to do it with caution. But actually, this is how we managed to configure Superset to read users and roles from the geOrchestra console.

  • superset_georchestra_config.py is the entrypoint for the configuration of your app. This is where you are expected to make most of the changes. See Configuring Superset for more information about what you can do here.
    It is also loading more definitions from the other python files:

    • Preconfig.py allows to set some variables that will be necessary for the rest of the configuration , e.g. REDIS_BASE_URL that is not set, when running non-dockerized deployment. This file is loaded at the beginning of superset_georchestra_config.py
    • GeorchestraCustomizations.py handles the geOrchestra-specific logic:
      • Manages the authentication logic
      • Provides a mechanism to configure the home page in Superset. See HOME_PAGE_VIEW param in the main config file.
      • Loads the configuration for the geOrchestra header (see below)
    • LocalizationFr.py adds some config that is specific to French locale (decimal separator, currency). If you want to add support for another locale, just copy it and contribute it.
      The choice of the file to load from is done in the main config file: from LocalizationFr import * actually imports (copies) all the content into the main config file at runtime.
      You need to have built Superset with i18n support for both frontend and backend.
    • Overrides.py can be used to override anything previously defined. If not useful to you, you can even delete this file.

Configuring the geOrchestra header

The header is the top menu usually added to all geOrchestra components.

There are two ways to configure the header:

  • either by reading the geOrchestra default.properties file. The GEORCHESTRA_PROPERTIES_FILE_PATH config parameter needs to point to the properties file (local path. URLs are not supported).
  • or by providing the necessary config parameters directly into your superset configuration files.

If both are provided, the values from the superset config file will override the ones from the default.properties file.

Tip

If you don't want the header displayed on the superset app, it is possible to disable it with the config parameter GEORCHESTRA_NOHEADER=True.

Adding a Superset entry in the header menu

The items of the geOrchestra header are now entirely configurable, since January 2025. You can find a sample config-file here.

The path to the config file will need to be an URL (relative or absolute, but since this will be loaded by javascript, it cannot be a local path).

i18n: language support

If you're using the docker distribution, the geOrchestra images are built with i18n support. However, it is not activated by default. To activate the language support, you need to declare it in your configuration file, for instance:

# Setup default language
BABEL_DEFAULT_LOCALE = "fr"
LANGUAGES = {
    'fr': {'flag': 'fr', 'name': 'French'},
    'en': {'flag': 'us', 'name': 'English'},
}

This is done by default in the LocalizationFr.py file, loaded from the main config file. However, to support other languages, you will have to adjust it accordingly.

If you're installing it from the source code, the instructions above are still true. But you will first need to build Superset with i18n support. This is explained in https://docs.georchestra.org/superset/en/latest/technical_guides/contribute/dev_setup/.

Using this version of Superset for a geOrchestra-less environment

This version of Superset ships with a few improvements to upstream Superset project, in particular regarding French translations. We have been asked a few times if it would be possible to use it from plain Superset deployments, without any geOrchestra specificities, like the header, custom authentication, etc.

It is indeed possible and easy. Just forget about the configuration provided in the superset_georchestra_config.py and children files. You can still pick a few config items that you want, for instance from LocalizationFr.py but remove all geOrchestra-related configuration. Your Superset instance will run without the geOrchestra authentication, header and other geOrchestra-specific features.

You might also want to check for the URL prefix. Depending on your deployment choice, it might be declared on several places. For instance for docker deployment, it is configured in the environment file (SUPERSET_APP_ROOT="/superset") and can be changed to SUPERSET_APP_ROOT="/" to deploy it at the root of the domain.