diff options
Diffstat (limited to 'app')
| -rw-r--r-- | app/app/settings.py | 21 | ||||
| -rw-r--r-- | app/config.yml | 13 |
2 files changed, 30 insertions, 4 deletions
diff --git a/app/app/settings.py b/app/app/settings.py index 8cc3338..e876895 100644 --- a/app/app/settings.py +++ b/app/app/settings.py @@ -11,10 +11,13 @@ https://docs.djangoproject.com/en/1.11/ref/settings/ """ import os +import yaml # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +CONFIG = yaml.load(open(BASE_DIR + '/config.yml').read()) + # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.11/howto/deployment/checklist/ @@ -78,10 +81,20 @@ WSGI_APPLICATION = 'app.wsgi.application' # https://docs.djangoproject.com/en/1.11/ref/settings/#databases DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } + 'default': CONFIG['db_default'] + # 'default': { + # 'ENGINE': 'django.db.backends.sqlite3', + # 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + # } + + # 'default': { + # 'ENGINE': 'django.db.backends.postgresql', + # 'NAME': 'dispatch', + # 'USER': 'postgres', + # 'PASSWORD': '', + # 'HOST': '127.0.0.1', + # 'PORT': '5432', + # } } diff --git a/app/config.yml b/app/config.yml new file mode 100644 index 0000000..a60a66e --- /dev/null +++ b/app/config.yml @@ -0,0 +1,13 @@ +--- +# Postgres Example +db_default: + ENGINE: django.db.backends.postgresql + NAME: dispatch + USER: postgres + PASSWORD: + HOST: 127.0.0.1 + PORT: 5432 +# Sqlite example. Full path is recommended +# db_default: +# ENGINE: django.db.backends.sqlite3 +# NAME: /home/mitch/scm/dispatch-tracker/app/db.sqlite3 |
