Created
May 4, 2011 22:30
-
-
Save SmileyChris/956186 to your computer and use it in GitHub Desktop.
Django application specific settings configuration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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