What you are reporting is not a bug. You need to look closer at what
is happening with django.conf. django/conf/__init__.py contains a
variable named settings that is the lazy evaluator of the setting
file. THis is the object that is obtained when you call 'from
django.conf import settings"
Your "fix" will break quite a bit of code - including, potentially,
your own. It would results in the template system only ever using the
global defaults. This wouldn't be a problem, except for the fact that
there are a couple of settings that affect the way that templates are
rendered.
Django's dependence on DJANGO_SETTINGS_MODULE is an oft-lamented
problem. Suggestions on how to address this constraint are most
welcome. However, it isn't a simple problem to fix.
Yours,
Russ Magee %-)
This is documented here:
> I am
> assuming that the code works in a project context since the project
> would import settings and this 'broken' import would just fail
> silently
Pay special attention to the last section (Either configure() or
DJANGO_SETTINGS_MODULE is required) of the docs linked above. As
Russell mentioned settings is lazy so you don't get an import error
but you will get a RuntimeError if settings have not been configured
properly when you actually try to use your templates.
--
----
\X/ /-\ `/ |_ /-\ |\|
Waylan Limberg
Doh' sorry that is wrong. Actually you do get an ImportError - but not
until the settings are actually accessed (being lazy and all). The
RuntimeError is if you call settings.configure() more than once. Thus,
the importance of reading that section carefully. :-D