Last Updated: September 2022
portal_config.yml is the primary configuration file for Tethys Portal. As of version 3.0, you should not edit the
settings.py file directly. Instead add any Django settings that you need to the
settings section of the
portal_config.yml. This can be done by manually editing the file, or you can use the
tethys settings command to add settings to it.
This part of the installation guide will show you how to create the
portal_config.yml and highlights a few of the settings that you should configure when setting up Tethys Portal for production. The following sections of the production installation guide will walk you through other important settings as well.
Generate the portal configuration file with the following command:
The directory where the
portal_config.yml is generated is the
TETHYS_HOME directory for your installation.
The default location of
/home/<username>/.tethys/ if your environment is named Tethys, otherwise it is
Note this location and use it anywhere you see
The following settings should be changed for a production installation of Tethys Portal.
The ALLOWED_HOSTS setting is used to specify a list of host/domain names that this Django site can serve. If a request comes in with a host/domain name that is not listed here, it will be rejected. You should set this to the domain(s) of your server. For example, you can set this setting using the
tethys settings command as follows:
tethys settings --set ALLOWED_HOSTS "['<SERVER_DOMAIN_NAME>']"
<SERVER_DOMAIN_NAME>with the domain name you identified during the Preparation step.
The first entry in
ALLOWED_HOSTSwill be used to set the server name in the NGINX configuration file in one of the following sections of this guide.
The DEBUG settings is used to enable debug mode. You should never deploy a site into production with
DEBUG turned on. You should set this setting to
False as follows:
tethys settings --set DEBUG False
Review the Django Deployment Checklist carefully.
Remember, do not edit the settings.py file directly, instead use the
tethys settingscommand or edit the
settingssection of the
portal_config.ymlto change Django settings.