Ticket #583: settings-v2.patch
File settings-v2.patch, 1.6 KB (added by , 19 years ago) |
---|
-
django/conf/global_settings.py
52 52 # Host for sending e-mail. 53 53 EMAIL_HOST = 'localhost' 54 54 55 # Should templates/ directories in the INSTALLED_APPS module-directories 56 # be added to TEMPLATE_DIRS, 57 ADD_APP_TEMPLATE_DIRS = False 58 55 59 # List of locations of the template source files, in search order. 56 60 TEMPLATE_DIRS = () 57 61 -
django/conf/settings.py
44 44 setting_value = (setting_value,) # In case the user forgot the comma. 45 45 setattr(me, setting, setting_value) 46 46 47 # Add templates/ directories from INSTALLED_APPS to TEMPLATE_DIRS, 48 # [ Note -- There is a good reason i jump through these hoops, if the 49 # original TEMPLATE_DIRS setting was a list-instance, we should keep it 50 # that way. ] 51 if me.ADD_APP_TEMPLATE_DIRS: 52 tds_type = type(me.TEMPLATE_DIRS) 53 tds = list(me.TEMPLATE_DIRS) 54 for app in me.INSTALLED_APPS: 55 m, a = app.rsplit('.', 1) 56 m = getattr(__import__(m, globals(), locals(), [a]), a) 57 app_root = os.path.dirname(m.__file__) 58 td = os.path.join(app_root, 'templates') 59 if os.path.isdir(td): 60 tds.append(td) 61 me.TEMPLATE_DIRS = tds_type(tds) 62 47 63 # save DJANGO_SETTINGS_MODULE in case anyone in the future cares 48 64 me.SETTINGS_MODULE = os.environ.get(ENVIRONMENT_VARIABLE, '') 49 65