Ticket #7015: appsettings.patch
File appsettings.patch, 1.4 KB (added by , 17 years ago) |
---|
-
django/conf/__init__.py
142 142 143 143 settings = LazySettings() 144 144 145 class ApplicationSettings(object): 146 147 def __init__(self, app_name): 148 self.app_name = app_name.upper() 149 150 def __getattribute__(self, attr): 151 if attr == 'app_name': 152 return super(ApplicationSettings, self).__getattribute__('app_name') 153 global_name = '%s_%s' % (self.app_name, attr) 154 return getattr(settings, global_name, 155 super(ApplicationSettings, self).__getattribute__(attr)) -
django/conf/app_template/__init__.py
1 import app_settings 2 3 settings = app_settings.LocalApplicationSettings('{{ app_name }}') -
django/conf/app_template/app_settings.py
1 from django.conf import settings, ApplicationSettings 2 3 class LocalApplicationSettings(ApplicationSettings): 4 # Put your application specific settings here.