Production Environment Variables
This section covers the environment and its required setup for running the care project in production. This involves setting up the secret keys, encryption keys, PostGIS database URLs etc. The project also employs other services such as Redis for caching and Sentry for logging.
The following list contains variables you will need during the production environment.
Variable Key | Required | Description |
| Yes | This variable is the URL to your Postgres database with the PostGIS extension. To obtain this, simply replace |
| Yes | This variable shall be used to access your Django admin dashboard. For security purposes, it is a good idea to keep it as a short random string. |
| Yes | A secret key used by Django for generating session cookies and other purposes. An online search will provide several methods for generating it. |
| Yes | A secret key used for encrypting patient records in the database. This can be generated in the same way as the Django secret key. A change in the fernet key will cause all data to be corrupted, please make sure this variable is always handled with care. The development version has a hardcoded fernet key to avoid issues. |
| Yes | This variable specifies which settings to use in the production environment. Set the value to |
| No | Set this variable to |
| No | This variable is used to store the bucket name to store your static files during the collectstatic step. Note that this is used only if |
| No | The AWS Access Key of your account used to access your S3 bucket. Note that this is used only when |
| No | The AWS Secret Key of your account used to access your S3 bucket. Note that this is used only when |
| Yes | The URL to your Redis instance for use in caching. Redis is also used as the background job management |
| Yes | The URL to your Redis instance for use in celery worker management. |
| Yes | The Sentry DSN value for logging errors from your app. To get a free DSN, sign up at https://sentry.io. |
| No | The configured site key for your recaptcha. Recaptcha is used to prevent brute-force attacks while logging into care. |
| No | The secret key for your recaptcha. |
| Yes | This is used to store a JSON type array of hosts you want to allow access to your backend API. Requests with other Host fields will not be able to complete successfully. Set it to |
| Yes | Contains a JSON array of hosts that are allowed to make cross site requests to the backend API. Defaults to |
| No | Use this option to set whether or not you want to redirect from HTTP to HTTPS automatically. Defaults to |
| No | A string value of the form requests/time to be set for rate limiting. For eg., if you want to allow not more than 5 requests from a user in 10 mins, provide |
| No | Set this variable to 1 to put the site/API into maintenance. Defaults to 0. |
| Yes | Your PostGIS DB name. This is used to check if the postgres db is connected before performing db migrations |
| Yes | Your Postgres host address. |
| Yes | Your Postgres username. |
| Yes | Your |
| Yes | Your Postgres instance port number. |
| Yes | AWS SNS access key for sending SMS messages |
| Yes | AWS SNS Secret key for sending SMS messages |
| Yes | Vapid Public key for sending Web push notifications, Defaults to publicly visible certificates |
| Yes | Vapid Private key for sending Web push notifications, Defaults to publicly visible certificates |
| Yes | AWS S3 bucket name with no public access to store confidential patient files |
| Yes | AWS Access key to access the File Upload Bucket |
| Yes | AWS Secret key to access the File Upload Bucket |
| Yes | SMTP Email Host |
| Yes | SMTP Email User |
| Yes | SMTP Email Password |
Last updated