2017-07-30 15:43:01 +03:00
.. _settings:
2015-09-18 20:20:48 +03:00
Settings
2018-09-15 23:25:40 +03:00
========
2015-09-18 20:20:48 +03:00
This project relies extensively on environment settings which **will not work with Apache/mod_wsgi setups** . It has been deployed successfully with both Gunicorn/Nginx and even uWSGI/Nginx.
2017-01-09 22:02:53 +03:00
For configuration purposes, the following table maps environment variables to their Django setting and project settings:
======================================= =========================== ============================================== ======================================================================
Environment Variable Django Setting Development Default Production Default
======================================= =========================== ============================================== ======================================================================
DJANGO_READ_DOT_ENV_FILE READ_DOT_ENV_FILE False False
======================================= =========================== ============================================== ======================================================================
2015-09-18 20:20:48 +03:00
======================================= =========================== ============================================== ======================================================================
Environment Variable Django Setting Development Default Production Default
======================================= =========================== ============================================== ======================================================================
2018-09-15 23:25:40 +03:00
DATABASE_URL DATABASES auto w/ Docker; postgres://project_slug w/o raises error
2018-05-14 10:09:24 +03:00
DJANGO_ADMIN_URL n/a 'admin/' raises error
2015-09-18 20:20:48 +03:00
DJANGO_DEBUG DEBUG True False
2018-09-15 23:25:40 +03:00
DJANGO_SECRET_KEY SECRET_KEY auto-generated raises error
2015-09-18 20:20:48 +03:00
DJANGO_SECURE_BROWSER_XSS_FILTER SECURE_BROWSER_XSS_FILTER n/a True
DJANGO_SECURE_SSL_REDIRECT SECURE_SSL_REDIRECT n/a True
DJANGO_SECURE_CONTENT_TYPE_NOSNIFF SECURE_CONTENT_TYPE_NOSNIFF n/a True
DJANGO_SECURE_FRAME_DENY SECURE_FRAME_DENY n/a True
DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS HSTS_INCLUDE_SUBDOMAINS n/a True
DJANGO_SESSION_COOKIE_HTTPONLY SESSION_COOKIE_HTTPONLY n/a True
DJANGO_SESSION_COOKIE_SECURE SESSION_COOKIE_SECURE n/a False
DJANGO_DEFAULT_FROM_EMAIL DEFAULT_FROM_EMAIL n/a "your_project_name <noreply@your_domain_name>"
DJANGO_SERVER_EMAIL SERVER_EMAIL n/a "your_project_name <noreply@your_domain_name>"
DJANGO_EMAIL_SUBJECT_PREFIX EMAIL_SUBJECT_PREFIX n/a "[your_project_name] "
2015-11-16 21:24:21 +03:00
DJANGO_ALLOWED_HOSTS ALLOWED_HOSTS ['*'] ['your_domain_name']
2015-09-18 20:20:48 +03:00
======================================= =========================== ============================================== ======================================================================
2016-02-16 21:07:20 +03:00
The following table lists settings and their defaults for third-party applications, which may or may not be part of your project:
2015-09-18 20:20:48 +03:00
======================================= =========================== ============================================== ======================================================================
Environment Variable Django Setting Development Default Production Default
======================================= =========================== ============================================== ======================================================================
2018-09-15 23:25:40 +03:00
CELERY_BROKER_URL CELERY_BROKER_URL auto w/ Docker; raises error w/o raises error
2015-09-18 20:20:48 +03:00
DJANGO_AWS_ACCESS_KEY_ID AWS_ACCESS_KEY_ID n/a raises error
DJANGO_AWS_SECRET_ACCESS_KEY AWS_SECRET_ACCESS_KEY n/a raises error
DJANGO_AWS_STORAGE_BUCKET_NAME AWS_STORAGE_BUCKET_NAME n/a raises error
2019-04-02 16:45:58 +03:00
DJANGO_AWS_S3_REGION_NAME AWS_S3_REGION_NAME n/a None
2020-05-29 01:16:54 +03:00
DJANGO_AWS_S3_CUSTOM_DOMAIN AWS_S3_CUSTOM_DOMAIN n/a None
2022-10-19 22:15:25 +03:00
DJANGO_AWS_S3_MAX_MEMORY_SIZE AWS_S3_MAX_MEMORY_SIZE n/a 100_000_000
2019-05-19 02:24:29 +03:00
DJANGO_GCP_STORAGE_BUCKET_NAME GS_BUCKET_NAME n/a raises error
2019-04-16 19:30:22 +03:00
GOOGLE_APPLICATION_CREDENTIALS n/a n/a raises error
2018-05-27 22:36:13 +03:00
SENTRY_DSN SENTRY_DSN n/a raises error
2020-08-28 11:17:34 +03:00
SENTRY_ENVIRONMENT n/a n/a production
SENTRY_TRACES_SAMPLE_RATE n/a n/a 0.0
2015-09-18 20:20:48 +03:00
DJANGO_SENTRY_LOG_LEVEL SENTRY_LOG_LEVEL n/a logging.INFO
2019-05-27 20:16:00 +03:00
MAILGUN_API_KEY MAILGUN_API_KEY n/a raises error
2018-03-05 20:56:45 +03:00
MAILGUN_DOMAIN MAILGUN_SENDER_DOMAIN n/a raises error
2019-04-02 16:17:22 +03:00
MAILGUN_API_URL n/a n/a "https://api.mailgun.net/v3"
2020-02-07 04:18:49 +03:00
MAILJET_API_KEY MAILJET_API_KEY n/a raises error
MAILJET_SECRET_KEY MAILJET_SECRET_KEY n/a raises error
MAILJET_API_URL n/a n/a "https://api.mailjet.com/v3"
MANDRILL_API_KEY MANDRILL_API_KEY n/a raises error
MANDRILL_API_URL n/a n/a "https://mandrillapp.com/api/1.0"
POSTMARK_SERVER_TOKEN POSTMARK_SERVER_TOKEN n/a raises error
POSTMARK_API_URL n/a n/a "https://api.postmarkapp.com/"
SENDGRID_API_KEY SENDGRID_API_KEY n/a raises error
SENDGRID_GENERATE_MESSAGE_ID True n/a raises error
SENDGRID_MERGE_FIELD_FORMAT None n/a raises error
SENDGRID_API_URL n/a n/a "https://api.sendgrid.com/v3/"
SENDINBLUE_API_KEY SENDINBLUE_API_KEY n/a raises error
SENDINBLUE_API_URL n/a n/a "https://api.sendinblue.com/v3/"
SPARKPOST_API_KEY SPARKPOST_API_KEY n/a raises error
SPARKPOST_API_URL n/a n/a "https://api.sparkpost.com/api/v1"
2015-09-18 20:20:48 +03:00
======================================= =========================== ============================================== ======================================================================
2015-12-05 22:12:53 +03:00
2016-02-16 21:07:20 +03:00
--------------------------
Other Environment Settings
--------------------------
2015-12-05 22:12:53 +03:00
2016-02-16 21:07:20 +03:00
DJANGO_ACCOUNT_ALLOW_REGISTRATION (=True)
Allow enable or disable user registration through `django-allauth` without disabling other characteristics like authentication and account management. (Django Setting: ACCOUNT_ALLOW_REGISTRATION)