-
Notifications
You must be signed in to change notification settings - Fork 4
/
local_settings.py
42 lines (36 loc) · 1.53 KB
/
local_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"""
Local settings for the HealthChecks app
"""
import os
ALLOWED_HOSTS = ['*']
DEBUG = os.getenv('HEALTHCHECKS_DEBUG', False)
HOST = os.getenv('HEALTHCHECKS_HOST', "localhost")
SITE_ROOT = os.getenv('HEALTHCHECKS_SITE_ROOT', "http://localhost:9090")
PING_ENDPOINT = SITE_ROOT + "/ping/"
DEFAULT_FROM_EMAIL = os.getenv('HEALTHCHECKS_EMAIL_FROM', "[email protected]")
EMAIL_HOST = os.getenv('HEALTHCHECKS_EMAIL_HOST', "localhost")
EMAIL_PORT = os.getenv('HEALTHCHECKS_EMAIL_PORT', 25)
EMAIL_HOST_USER = os.getenv('HEALTHCHECKS_EMAIL_USER', "")
EMAIL_HOST_PASSWORD = os.getenv('HEALTHCHECKS_EMAIL_PASSWORD', "")
if os.environ.get("HEALTHCHECKS_DB") == "postgres":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': os.getenv("HEALTHCHECKS_DB_NAME", "hc"),
'USER': os.getenv('HEALTHCHECKS_DB_USER', "postgres"),
'PASSWORD': os.getenv('HEALTHCHECKS_DB_PASSWORD', ""),
'HOST': os.getenv('HEALTHCHECKS_DB_HOST', "localhost"),
'TEST': {'CHARSET': 'UTF8'}
}
}
if os.environ.get("HEALTHCHECKS_DB") == "mysql":
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'USER': os.getenv('HEALTHCHECKS_DB_USER', "root"),
'PASSWORD': os.getenv('HEALTHCHECKS_DB_PASSWORD', ""),
'NAME': os.getenv("HEALTHCHECKS_DB_NAME", "hc"),
'HOST': os.getenv('HEALTHCHECKS_DB_HOST', "localhost"),
'TEST': {'CHARSET': 'UTF8'}
}
}