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.
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. WhenDEBUGis true andREDIS_URLisn't defined, it defaults toredis://localhost:6379/1. -
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 whenDEBUGis 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'sSECRET_KEYsetting. It is automatically set to a known, insecure value whenDEBUGis true. -
DATABASE_URLis the URL for the database, as per the DJ-Database-URL schema. Note that the protocol must bepostgres:. -
EMAIL_URLis the URL for the service to use when sending email, as per the dj-email-url schema. WhenDEBUGis true, this defaults toconsole:. If it is set todummy: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 themanage.py sendtestemailcommand. -
DEFAULT_FROM_EMAILis the email from-address to use in all system generated emails to users. It corresponds to Django'sDEFAULT_FROM_EMAILsetting. It defaults tonoreply@localhostwhenDEBUG=True. -
SERVER_EMAILis the email from-address to use in all system generated emails to managers and admins. It corresponds to Django'sSERVER_EMAILsetting. It defaults tosystem@localhostwhenDEBUG=True. -
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 asDEFAULT_FROM_EMAIL. -
REDIS_URLis the URL for redis, which is used by the task queue. WhenDEBUGis true, it defaults toredis://localhost:6379/0. -
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 tocalc-dev. -
UAA_CLIENT_SECRETis your cloud.gov/Cloud Foundry UAA client secret. If this is undefined andDEBUGis 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 asX-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. -
SLACKBOT_WEBHOOK_URLis the URL of a Slack incoming webhook that will be sent messages whenever certain kinds of events occur in the app.