This document detail the env variables that you can/must set for the DHost app.
The variable DJANGO_ENV define wich environment to use. By default it's development, and can be set to production or tests.
| Emojie | Meaning |
|---|---|
| β | You must change this value for the website to work in production. |
| β | Heavly dependant on your infrastructure, you should look at this option. |
| πͺ | You should set this variable but it won't break the site if you don't. |
| π€· | It's up to you if you want to set the value in most cases this will enable site features. |
| β | You shouldn't change this value. |
Note:
ROOT_DIRis the location of the base directory wich is the root project's folder.BASE_DIRis atROOT_DIR/dhost, it's the apps root.
| Environment variables | Prod | Default values | Descriptions |
|---|---|---|---|
DEBUG |
β | True |
Set to False for production, more infos here. |
DJANGO_SECRET_KEY |
β | Your website secret key, more infos here. | |
SITE_ID |
β | 1 |
More infos here. |
ALLOWED_HOSTS |
β | localhost,127.0.0.1 |
A list of strings representing the host/domain names that this Django site can serve. More infos here. |
CORS_ALLOWED_ORIGINS |
β | http://localhost:8000 |
A list of strings representing the CORS allowed hosts. More infos here. |
CORS_ALLOW_ALL_ORIGINS |
β | DEBUG | Set allowed hosts to *, by default it take the value of DEBUG. |
ENABLE_SSL |
β | 1 |
Enable all SSL (redirect, cookie), enabled by default in production only. |
DATABASE_URL |
πͺ | sqlite:///db.sqlite3 |
The database URL, more infos here. |
REDIS_URL |
πͺ | The URL to the Redis server. | |
SENTRY_DSN |
πͺ | The Sentry DSN URL, more infos here. | |
EMAIL_HOST |
πͺ | localhost |
The host to use for sending email. More infos here. |
SERVER_EMAIL |
πͺ | root@localhost |
More infos here. |
DEFAULT_FROM_EMAIL |
πͺ | webmaster@localhost |
More infos here. |
EMAIL_PORT |
πͺ | 1025 |
More infos here. |
CSRF_COOKIE_SECURE |
πͺ | False |
Whether to use a secure cookie for the CSRF cookie. More infos here. |
SESSION_COOKIE_SECURE |
πͺ | False |
Whether to use a secure cookie for the session cookie. More infos here. |
STATIC_URL |
πͺ | /static/ |
URL to use when referring to static files. More infos here. |
STATIC_ROOT |
β | BASE_DIR / 'static' |
The absolute path to the directory where collectstatic will collect static files. More infos here. |
MEDIA_URL |
πͺ | /media/ |
URL that handles the media served. More infos here. |
MEDIA_ROOT |
β | BASE_DIR / 'media' |
Absolute filesystem path to the directory that will hold user-uploaded files. More infos here. |
SOCIAL_AUTH_GITHUB_KEY |
β | Github OAuth2 client ID. | |
SOCIAL_AUTH_GITHUB_SECRET |
β | Github OAuth2 client secret. | |
DJANGO_DEFAULT_FILE_STORAGE |
β | default |
Wich default file storage to use, one of default, aws, google. |
DJANGO_STATICFILES_STORAGE |
β | whitenoise |
Wich staticfiles storage to be used, one of whitenoise, aws, google. |
GITHUB_REPOS_ROOT |
β | MEDIA_ROOT / 'github' |
Absolute filesystem path to the directory that will hold Github repos files. |
CELERY_BROKER_URL |
β | redis://127.0.0.1:6379/0 |
Celery broker URL. |
CELERY_RESULT_BACKEND |
β | redis://127.0.0.1:6379/0 |
Celery broker URL. |
AWS_ACCESS_KEY_ID |
β | AWS access key more infos here. | |
AWS_SECRET_ACCESS_KEY |
β | AWS secret key. | |
AWS_DEFAULT_ACL |
β | None |
AWS ACL. |
AWS_STORAGE_BUCKET_NAME |
β | AWS bucket name, giving a storage bucket name will enable storage of staticfiles. | |
AWS_S3_CUSTOM_DOMAIN |
β | Custom domain for static bucket. | |
AWS_MEDIA_BUCKET_NAME |
β | AWS bucket name, giving a media bucket name will enable storage of media files. | |
AWS_MEDIA_CUSTOM_DOMAIN |
β | Custom domain for media bucket. | |
STATIC_URL |
β | /static/ |
For AWS: https://<bucket_name>.s3.amazonaws.com/<static>/. |
AWS_LOCATION |
β | The base path inside you S3 bucket. | |
AWS_S3_REGION_NAME |
β | AWS region name. | |
GOOGLE_APPLICATION_CREDENTIALS |
β | ||
GS_BUCKET_NAME |
β | ||
GS_PROJECT_ID |
β | ||
GS_DEFAULT_ACL |
β | ||
GS_QUERYSTRING_AUTH |
β | ||
GS_LOCATION |
β | ||
GS_MEDIA_BUCKET_NAME |
β |