2024-03-20 02:29:37 +00:00
|
|
|
import json
|
|
|
|
|
|
|
|
from django.core.exceptions import ImproperlyConfigured
|
|
|
|
|
2024-07-22 07:13:34 +00:00
|
|
|
from .base import * # NOQA
|
2024-03-20 02:29:37 +00:00
|
|
|
|
|
|
|
DEBUG = False
|
|
|
|
ALLOWED_HOSTS = ['www.sfconservancy.org', 'sfconservancy.org']
|
|
|
|
|
|
|
|
ADMINS = [
|
|
|
|
('Bradley M. Kuhn', 'sysadmin@sfconservancy.org'),
|
|
|
|
('Ben Sturmfels', 'sysadmin+conservancy@sturm.com.au'),
|
|
|
|
]
|
|
|
|
|
|
|
|
MANAGERS = [
|
|
|
|
('Bradley M. Kuhn', 'sysadmin@sfconservancy.org'),
|
|
|
|
]
|
|
|
|
|
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'NAME': '/var/lib/www/database/conservancy-website.sqlite3',
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Apache/mod_wsgi doesn't make it straightforward to pass environment variables
|
|
|
|
# to Django (can't use the Apache config).
|
2024-07-22 07:13:34 +00:00
|
|
|
with open(BASE_DIR.parent / 'secrets.json') as f: # NOQA
|
2024-03-20 02:29:37 +00:00
|
|
|
secrets = json.load(f)
|
|
|
|
|
|
|
|
def get_secret(secrets, setting):
|
|
|
|
try:
|
|
|
|
return secrets[setting]
|
|
|
|
except KeyError:
|
|
|
|
raise ImproperlyConfigured(f'Missing secret \'{setting}\'')
|
|
|
|
|
|
|
|
SECRET_KEY = get_secret(secrets, 'SECRET_KEY')
|
|
|
|
|
|
|
|
SESSION_COOKIE_SECURE = True
|