make it kubernetes friendly
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2020-12-29 21:43:31 +01:00
parent dd1fd1c80f
commit 189326b30f
12 changed files with 145 additions and 28 deletions

View File

@@ -15,13 +15,11 @@ import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
with open(os.path.join(BASE_DIR, "env_secret_key.txt")) as secret_key:
SECRET_KEY = secret_key.read().strip()
SECRET_KEY = os.environ.get("SECRET_KEY")
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False
@@ -53,7 +51,6 @@ INSTALLED_APPS = [
'geogame.main',
'django_countries',
]
MIDDLEWARE = [
@@ -71,7 +68,7 @@ ROOT_URLCONF = 'geogame.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, "geogame/templates"),],
'DIRS': [os.path.join(BASE_DIR, "geogame/templates"), ],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
@@ -86,21 +83,19 @@ TEMPLATES = [
WSGI_APPLICATION = 'geogame.wsgi.application'
# Database
# https://docs.djangoproject.com/en/2.2/ref/settings/#databases
with open(os.path.join(BASE_DIR, "env_db.txt")) as db_pw:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'geogame',
'USER': 'geogame',
'PASSWORD': db_pw.read().strip(),
'HOST': 'localhost',
'PORT': '',
}
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'geogame',
'USER': 'geogame',
'PASSWORD': os.environ.get("DB_PW"),
'HOST': '192.168.8.4',
'PORT': '5432',
}
}
# Password validation
# https://docs.djangoproject.com/en/2.2/ref/settings/#auth-password-validators
@@ -120,7 +115,6 @@ AUTH_PASSWORD_VALIDATORS = [
},
]
# Internationalization
# https://docs.djangoproject.com/en/2.2/topics/i18n/
@@ -143,16 +137,12 @@ STATIC_ROOT = os.path.join(BASE_DIR, "static")
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
MEDIA_URL = '/attachments/'
with open(os.path.join(BASE_DIR, "env_email_key.txt")) as email_key:
SENDGRID_API_KEY = email_key.read().strip()
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_HOST_USER = 'apikey'
EMAIL_HOST_PASSWORD = SENDGRID_API_KEY
EMAIL_PORT = 587
EMAIL_HOST = '192.168.8.7'
EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''
EMAIL_PORT = 25
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL = "admin@peakdistrictwalks.org.uk"
DEFAULT_FROM_EMAIL = "geogame@kmlabz.com"
# AUTH