Unlike traditional Django settings, we use environment variables for configuration to be compliant with twelve-factor apps.
You can define environment variables using your environment, or
(if you’re developing locally) an
.env file in the root directory
of the repository. For more information on configuring
environment variables on cloud.gov, see
Deploying to Cloud Foundry.
Note: When an environment variable is described as representing a boolean value, if the variable exists with any value (even the empty string), the boolean is true; otherwise, it’s false.
Local development settings¶
These settings are likely to only be useful during local development and/or the deployment of non-production instances of CALC.
DEBUGis a boolean value that indicates whether debugging is enabled (this should always be false in production).
DEBUG_LOG_SQLis a boolean value that indicates whether SQL statements sent to the database should be logged to the console.
DEBUG_HTTPSis a boolean value that indicates whether the site should consider itself to be served over HTTPS while debugging is enabled. This can be useful if you want to develop with SSL enabled.
HIDE_DEBUG_UIis a boolean value that indicates whether to hide various development and debugging affordances in the UI, such as the Django Debug Toolbar. This can be useful when demoing or user testing a debug build.
REDIS_TEST_URLis the redis URL to use when running tests. When
DEBUGis true and
REDIS_URLisn’t defined, it defaults to
FORCE_DISABLE_SECURE_SSL_REDIRECTis a boolean value that indicates whether to disable redirection from http to https. Because such redirection is enabled by default when
DEBUGis false, this option can be useful when you want to simulate almost everything about a production environment without having to setup SSL.
USE_POLLINGis a boolean; if true, this will force all the watchers to use filesystem polling instead of OS notifications, which works better with some configurations, such as Windows, VirtualBox, and NFS mounts.
NON_PROD_INSTANCE_NAMEis an optional instance name that when specified will cause a banner to be shown at the top of every page to let users know that they are viewing a non-production instance of CALC. This value can contain HTML, so it’s possible to e.g. wrap the value in a hyperlink.
These are useful for any kind of deployment of CALC.
SECRET_KEYis a large random value corresponding to Django’s
SECRET_KEYsetting. It is automatically set to a known, insecure value when
DATABASE_URLis the URL for the database, as per the DJ-Database-URL schema. Note that the protocol must be
EMAIL_URLis the URL for the service to use when sending email, as per the dj-email-url schema. When
DEBUGis true, this defaults to
console:. If it is set to
dummy:then no emails will be sent and messages about email notifications will not be shown to users. The setting can easily be manually tested via the
DEFAULT_FROM_EMAILis the email from-address to use in all system generated emails to users. It corresponds to Django’s
DEFAULT_FROM_EMAILsetting. It defaults to
SERVER_EMAILis the email from-address to use in all system generated emails to managers and admins. It corresponds to Django’s
SERVER_EMAILsetting. It defaults to
HELP_EMAILis the email used as the reply-to address in system generated emails to users. It is also the email address used in the site footer and for other contact purposes. It should refer to an inbox that is monitored. If not set, it will use the same value as
REDIS_URLis the URL for redis, which is used by the task queue. When
DEBUGis true, it defaults to
ENABLE_SEO_INDEXINGis a boolean value that indicates whether to indicate to search engines that they can index the site.
UAA_CLIENT_IDis your cloud.gov/Cloud Foundry UAA client ID. It defaults to
UAA_CLIENT_SECRETis your cloud.gov/Cloud Foundry UAA client secret. If this is undefined and
DEBUGis true, then a built-in Fake UAA Provider will be used to “simulate” cloud.gov login.
SECURITY_HEADERS_ON_ERROR_ONLYis a boolean value that indicates whether security-related response headers (such as
X-XSS-Protection) should only be added on error (status code >= 400) responses. This setting will likely only be used for cloud.gov deployments, where the built-in proxy sets those security headers on 200 responses but not on others.
GA_TRACKING_IDis the tracking ID (e.g.
'UA-12345678-12') for the associated Google Analytics account. It will default to the empty string if not found in the environment.
NEW_RELIC_LICENSE_KEYis the private New Relic license key for this project. If it is present, then the WSGI app will be wrapped with the New Relic agent.
SLACKBOT_WEBHOOK_URLis the URL of a Slack incoming webhook that will be sent messages whenever certain kinds of events occur in the app.