|
|
@ -1,38 +1,38 @@ |
|
|
|
""" |
|
|
|
Django settings for app project. |
|
|
|
|
|
|
|
Generated by 'django-admin startproject' using Django 2.0.5. |
|
|
|
|
|
|
|
For more information on this file, see |
|
|
|
https://docs.djangoproject.com/en/2.0/topics/settings/ |
|
|
|
|
|
|
|
For the full list of settings and their values, see |
|
|
|
https://docs.djangoproject.com/en/2.0/ref/settings/ |
|
|
|
|
|
|
|
Any setting that is configured via an environment variable may |
|
|
|
also be set in a `.env` file in the project base directory. |
|
|
|
""" |
|
|
|
from os import path |
|
|
|
|
|
|
|
import os |
|
|
|
import django_heroku |
|
|
|
import dj_database_url |
|
|
|
from environs import Env |
|
|
|
|
|
|
|
|
|
|
|
# Build paths inside the project like this: path.join(BASE_DIR, ...) |
|
|
|
BASE_DIR = path.dirname(path.dirname(path.abspath(__file__))) |
|
|
|
|
|
|
|
# Build paths inside the project like this: os.path.join(BASE_DIR, ...) |
|
|
|
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
|
|
|
env = Env() |
|
|
|
env.read_env(BASE_DIR, recurse=False) |
|
|
|
|
|
|
|
|
|
|
|
# Quick-start development settings - unsuitable for production |
|
|
|
# See https://docs.djangoproject.com/en/2.0/howto/deployment/checklist/ |
|
|
|
|
|
|
|
# SECURITY WARNING: keep the secret key used in production secret! |
|
|
|
SECRET_KEY = os.environ.get( |
|
|
|
'SECRET_KEY', |
|
|
|
'v8sk33sy82!uw3ty=!jjv5vp7=s2phrzw(m(hrn^f7e_#1h2al') |
|
|
|
SECRET_KEY = env('SECRET_KEY', |
|
|
|
'v8sk33sy82!uw3ty=!jjv5vp7=s2phrzw(m(hrn^f7e_#1h2al') |
|
|
|
|
|
|
|
# SECURITY WARNING: don't run with debug turned on in production! |
|
|
|
DEBUG = True |
|
|
|
if os.environ.get('DEBUG') == 'False': |
|
|
|
DEBUG = False |
|
|
|
# DEBUG = bool(os.environ.get('DEBUG', False)) |
|
|
|
# DEBUG = os.environ.get('DEBUG') == 'TRUE' |
|
|
|
DEBUG = env.bool('DEBUG', True) |
|
|
|
|
|
|
|
# ALLOWED_HOSTS = [] |
|
|
|
|
|
|
@ -73,7 +73,7 @@ ROOT_URLCONF = 'app.urls' |
|
|
|
TEMPLATES = [ |
|
|
|
{ |
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates', |
|
|
|
'DIRS': [os.path.join(BASE_DIR, 'server/templates')], |
|
|
|
'DIRS': [path.join(BASE_DIR, 'server/templates')], |
|
|
|
'APP_DIRS': True, |
|
|
|
'OPTIONS': { |
|
|
|
'context_processors': [ |
|
|
@ -92,7 +92,7 @@ TEMPLATES = [ |
|
|
|
] |
|
|
|
|
|
|
|
STATICFILES_DIRS = [ |
|
|
|
os.path.join(BASE_DIR, 'server/static'), |
|
|
|
path.join(BASE_DIR, 'server/static'), |
|
|
|
] |
|
|
|
|
|
|
|
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage' |
|
|
@ -105,12 +105,12 @@ AUTHENTICATION_BACKENDS = [ |
|
|
|
'django.contrib.auth.backends.ModelBackend', |
|
|
|
] |
|
|
|
|
|
|
|
SOCIAL_AUTH_GITHUB_KEY = os.getenv('OAUTH_GITHUB_KEY') |
|
|
|
SOCIAL_AUTH_GITHUB_SECRET = os.getenv('OAUTH_GITHUB_SECRET') |
|
|
|
SOCIAL_AUTH_GITHUB_KEY = env('OAUTH_GITHUB_KEY', None) |
|
|
|
SOCIAL_AUTH_GITHUB_SECRET = env('OAUTH_GITHUB_SECRET', None) |
|
|
|
|
|
|
|
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_KEY = os.getenv('OAUTH_AAD_KEY') |
|
|
|
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_SECRET = os.getenv('OAUTH_AAD_SECRET') |
|
|
|
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_TENANT_ID = os.getenv('OAUTH_AAD_TENANT') |
|
|
|
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_KEY = env('OAUTH_AAD_KEY', None) |
|
|
|
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_SECRET = env('OAUTH_AAD_SECRET', None) |
|
|
|
SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_TENANT_ID = env('OAUTH_AAD_TENANT', None) |
|
|
|
|
|
|
|
# Database |
|
|
|
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases |
|
|
@ -118,7 +118,7 @@ SOCIAL_AUTH_AZUREAD_TENANT_OAUTH2_TENANT_ID = os.getenv('OAUTH_AAD_TENANT') |
|
|
|
DATABASES = { |
|
|
|
'default': { |
|
|
|
'ENGINE': 'django.db.backends.sqlite3', |
|
|
|
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), |
|
|
|
'NAME': path.join(BASE_DIR, 'db.sqlite3'), |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -195,9 +195,9 @@ SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') |
|
|
|
# on the import phase |
|
|
|
IMPORT_BATCH_SIZE = 500 |
|
|
|
|
|
|
|
GOOGLE_TRACKING_ID = os.getenv('GOOGLE_TRACKING_ID', 'UA-125643874-2') |
|
|
|
GOOGLE_TRACKING_ID = env('GOOGLE_TRACKING_ID', 'UA-125643874-2') |
|
|
|
|
|
|
|
AZURE_APPINSIGHTS_IKEY = os.getenv('AZURE_APPINSIGHTS_IKEY') |
|
|
|
AZURE_APPINSIGHTS_IKEY = env('AZURE_APPINSIGHTS_IKEY', None) |
|
|
|
APPLICATION_INSIGHTS = { |
|
|
|
'ikey': AZURE_APPINSIGHTS_IKEY if AZURE_APPINSIGHTS_IKEY else None, |
|
|
|
} |
|
|
|