Skip to content

Commit

Permalink
Start using Goodconf.
Browse files Browse the repository at this point in the history
  • Loading branch information
mblayman committed Nov 2, 2019
1 parent 28a8369 commit 1656d2e
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -84,6 +84,7 @@ assets/fonts
assets/images/img
assets/images/node_modules

settings.yaml
settings/_*.py
conductor/templates/sitemap.xml
media
Expand Down
3 changes: 3 additions & 0 deletions mypy.ini
Expand Up @@ -26,6 +26,9 @@ ignore_missing_imports = True
[mypy-faker.*]
ignore_missing_imports = True

[mypy-goodconf.*]
ignore_missing_imports = True

[mypy-google.*]
ignore_missing_imports = True

Expand Down
1 change: 1 addition & 0 deletions requirements.in
Expand Up @@ -6,6 +6,7 @@ django-anymail==3.0
django-localflavor==2.0
django-storages==1.6.6
django-waffle==0.15.1
goodconf[yaml]==1.0.0
google-api-python-client==1.6.4
# google-auth-httplib2 has an adapter to make google-auth creds work
# with the Python client.
Expand Down
3 changes: 3 additions & 0 deletions requirements.txt
Expand Up @@ -20,6 +20,7 @@ django-waffle==0.15.1
django==2.0.9
docutils==0.14 # via botocore
gevent==1.4.0 # via wal-e
goodconf[yaml]==1.0.0
google-api-python-client==1.6.4
google-auth-httplib2==0.0.3
google-auth-oauthlib==0.2.0
Expand All @@ -40,6 +41,8 @@ requests-oauthlib==1.2.0 # via google-auth-oauthlib
requests==2.9.1
rollbar==0.14.7
rsa==4.0 # via google-auth, oauth2client
ruamel.yaml.clib==0.2.0 # via ruamel.yaml
ruamel.yaml==0.16.5 # via goodconf
s3transfer==0.1.13 # via boto3
six==1.12.0 # via django-anymail, google-api-python-client, google-auth, oauth2client, python-dateutil, rollbar
stripe==2.11.0
Expand Down
7 changes: 5 additions & 2 deletions settings/base.py
Expand Up @@ -5,14 +5,17 @@

import conductor

from .conf import config

config.load()

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
ROOT_DIR = os.path.dirname(BASE_DIR)

SECRET_KEY = "y$l*8=9d0b^nbf4c#vs+z=d)vb(3rsgvcx!+2as@f5f2s*#x=q"

# Other settings must explicitly opt-in for debug mode.
DEBUG = False
DEBUG = config.DEBUG

DATABASES = {
"default": {
Expand Down
10 changes: 10 additions & 0 deletions settings/conf.py
@@ -0,0 +1,10 @@
from goodconf import GoodConf, Value


class Config(GoodConf):
"""Configuration settings for College Conductor"""

DEBUG = Value(default=False, help="Toggle debugging.")


config = Config(default_files=["/etc/conductor/settings.yaml", "settings.yaml"])
2 changes: 0 additions & 2 deletions settings/development.py
@@ -1,7 +1,5 @@
from settings.base import * # noqa

DEBUG = True

INTERNAL_IPS = ("127.0.0.1",)
INSTALLED_APPS += ("debug_toolbar",) # noqa
MIDDLEWARE.insert(0, "debug_toolbar.middleware.DebugToolbarMiddleware") # noqa

0 comments on commit 1656d2e

Please sign in to comment.