Settings¶
Environment Variable Overview¶
Most settings are defined by environment variables. They may be set in
an .env file in the project’s root directory to adjust various
aspects of the deployment.
See their usage details below.
General App Settings¶
These environment variables are read by the Django app and thus have a
corresponding value in Django accessible via django.conf.settings.
Environment Variable |
Django Setting |
Production Default |
Development Default |
|---|---|---|---|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|||
|
|
||
|
|
|
|
|
|
|
|
|
|||
|
|||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Email Settings¶
Environment Variable |
Django Setting |
Production Default |
Development Default |
|---|---|---|---|
|
|||
|
|
|
|
|
|
||
|
|||
|
|
||
|
|
||
|
|
Database Settings¶
Environment Variable |
Default |
|---|---|
|
|
|
|
Third-party Authentication¶
Environment Variable |
Django Setting |
Production Default |
Development Default |
|---|---|---|---|
Environment Variable Usage¶
Detailed descriptions of each environment variable and their intended usage.
- ACCOUNT_EMAIL_VERIFICATION¶
Options |
|
|---|---|
|
User’s MAY optionally provide an email at signup which may be used for password resets and other notifications. |
|
User’s MUST provide an email |
|
User’s CANNOT provide an email. This option usually corresponds with an alternative third-party authentication option. Otherwise user’s won’t be able to make accounts at all. |
- DATABASE_URL¶
By default, the database URL used by the Django application to communicate with the Postgres database is generated from the Database Settings. This setting will override that generated database URL.
- DJANGOADMIN_FORCE_ALLAUTH¶
TODO
- DJANGO_ACCOUNT_ALLOW_REGISTRATION¶
TODO
- DJANGO_ADMINS¶
TODO
- DJANGO_ADMIN_URL¶
The URL for the admin dashboard. It is recommended to change this from the default value to help prevent authenticaton attacks on the admin dashboard.
- DJANGO_ALLOWED_HOSTS¶
This setting configures the app to accept requests from a list of hosts. When deployed via Docker, this value should not need to be changed from the default. See the relevant Django docs for more details.
- DJANGO_DEBUG_TOOLBAR¶
This a development only setting which enables the Django Debug Toolbar. It has no effect on a production deployment.
- DJANGO_DEBUG¶
This setting enables or disables Django’s Debug Mode which will cause the app to display detailed error messages and additional info about the runtime environment. This setting SHOULD NOT be enabled in a production deployment unless you know what you’re doing.
- DJANGO_DEFAULT_FROM_EMAIL¶
TODO
- DJANGO_DISCORD_CLIENT_ID¶
The client ID for Discord third-party login.
- DJANGO_DISCORD_CLIENT_SECRET¶
The client secret for Discord third-party login.
- DJANGO_DISCORD_PUBLIC_KEY¶
The public key for Discord third-party login.
- DJANGO_EMAIL_BACKEND¶
The email backend used by Django to handle emails. See the Django Email backends documentation for more details.
Options |
|
|---|---|
|
use the Django SMTP email backend |
|
use the Anymail Mailgun email backend |
|
use the Anymail Mailtrap email backend |
Note
Setting either MAILGUN_API_KEY or MAILTRAP_API_TOKEN will automatically override this setting to use the appropriate email backend.
- DJANGO_EMAIL_HOST_PASSWORD¶
The password to use for the SMTP server defined in DJANGO_EMAIL_HOST.
- DJANGO_EMAIL_HOST_USER¶
The username to use for the SMTP server defined in DJANGO_EMAIL_HOST.
- DJANGO_EMAIL_HOST¶
The host used for sending email.
- DJANGO_EMAIL_PORT¶
The port to use for the SMTP server defined in DJANGO_EMAIL_HOST.
- DJANGO_ENABLE_MFA¶
Enables MFA (multifactor authentication).
TODO: describe MFA options
- DJANGO_HOMEPAGE_LINKS¶
A list describing the default links to display on the homepage. For example the default as of this writing is this:
DJANGO_HOMEPAGE_LINKS=[
("Home", "/"),
("Posts", "/posts"),
("Tags", "/tags"),
("Collections", "/collections"),
]
The list must contain a series of lists or tuples with the first and values for each being the link title and the URL respectively.
- DJANGO_SECRET_KEY¶
See the Django docs for details. The application cannot start without setting this variable. Set it to a long alphanumeric string. Preferably, 24 characters or more.
Warning
Failing to keep this value secret could lead to remote code execution and privilege escalation on the host system.
- DJANGO_SECURE_CONTENT_TYPE_NOSNIFF¶
TODO
- DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS¶
TODO
- DJANGO_SECURE_HSTS_PRELOAD¶
TODO
- DJANGO_SECURE_SSL_REDIRECT¶
TODO
- DJANGO_SERVER_EMAIL¶
TODO
- DJANGO_SETTINGS_MODULE¶
TODO
- DJANGO_SILKY_PYTHON_PROFILER_BINARY¶
TODO
- DJANGO_SILKY_PYTHON_PROFILER¶
TODO
- DJANGO_SOCIAL_LOGIN_ENABLED¶
TODO
- DJANGO_TITLE¶
TODO
- POSTGRES_DB¶
TODO
- POSTGRES_PASSWORD¶
TODO
- POSTGRES_PORT¶
TODO
- POSTGRES_USER¶
TODO
- USE_DOCKER¶
TODO