Skip to content
This repository was archived by the owner on Jun 21, 2022. It is now read-only.

Latest commit

Β 

History

History
71 lines (62 loc) Β· 12.3 KB

File metadata and controls

71 lines (62 loc) Β· 12.3 KB

Environment variables

This document detail the env variables that you can/must set for the DHost app.

DJANGO_ENV

The variable DJANGO_ENV define wich environment to use. By default it's development, and can be set to production or tests.

Legend

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.

Variables

Note:

  • ROOT_DIR is the location of the base directory wich is the root project's folder.
  • BASE_DIR is at ROOT_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 ❓