"""
from pathlib import Path
+import json
import os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/
-# SECURITY WARNING: keep the secret key used in production secret!
+try:
+ with open('~/.styxrc', 'r') as styxrc:
+ LOCAL_SETTINGS = json.loads(styxrc.read())
+
+except FileNotFoundError:
+ LOCAL_SETTINGS = {}
# SECURITY WARNING: don't run with debug turned on in production!
-DEBUG = (os.environ.get('STYX_DEBUG', 'true') == 'true')
+DEBUG = LOCAL_SETTINGS.get('DEBUG', True)
if DEBUG:
SECRET_KEY = 'mq@_9a6&y4nvgqa7obf-r%a4^dt)z=r8jr&91&=oc^6-=i0*$z'
else:
- SECRET_KEY = os.environ['STYX_SECRET_KEY']
+ SECRET_KEY = LOCAL_SETTINGS['SECRET_KEY']
ALLOWED_HOSTS = [
'localhost',
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'styx',
'USER': 'styxuser',
- 'PASSWORD': os.environ['STYX_DB_PASSWORD'],
+ 'PASSWORD': LOCAL_SETTINGS['DB_PASSWORD'],
}
}