The first import in django/core/template/__init__.py wants to obtain
DEFAULT_CHARSET and TEMPLATE_DEBUG from the settings file. Being
DJANGO_SETTINGS_MODULE not set, an EnvironmentError exception is
raised. If you handle this exception with try/except, defining yourself
default values for DEFAULT_CHARSET and TEMPLATE_DEBUG, you have found a
(rude) way to change the intended behaviour.

Of course, as already said, this is not an acceptable solution,
because: 1) in this way the default charset and template debug settings
are hardcoded; 2) still worst, you can't extend the template language
with your tags and filters, as their definitions live in a package at
the same level as models, views, etc., and so it is coupled to an
application.

Perhaps, a valid solution would require changes at a deeper level!

Thanks for your attention.

Reply via email to