Skip to content

Instantly share code, notes, and snippets.

@gimntut
Forked from SmileyChris/conf.py
Created July 22, 2020 19:03
Show Gist options
  • Save gimntut/ff44c44eb70b227a060283f2bb0be934 to your computer and use it in GitHub Desktop.
Save gimntut/ff44c44eb70b227a060283f2bb0be934 to your computer and use it in GitHub Desktop.
Django application specific settings configuration
from django.conf import settings as django_settings
class Settings(object):
DEFAULTS = {
# Define any default settings in here.
}
def __dir__(self):
return dir(django_settings)
def __getattr__(self, attr):
args = []
if attr in self.DEFAULTS:
args.append(self.DEFAULTS[attr])
return getattr(django_settings, attr, *args)
settings = Settings()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment