Skip to content

Instantly share code, notes, and snippets.

@SmileyChris
Created May 4, 2011 22:30
Show Gist options
  • Save SmileyChris/956186 to your computer and use it in GitHub Desktop.
Save SmileyChris/956186 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