On 8/8/07, Malcolm Tredinnick <[EMAIL PROTECTED]> wrote:
> A couple of other areas are going to be at least equally as
> interesting...

Malcolm has made some *really* good points throughout this thread, and
I'm convinced that going  down this path would be a not-so-good idea.

My opinion on it at this point could be be classified as "blah," or
possibly "meh."

I have a feeling that the underlying reason for wanting a standalone
django.template, deep in our collective subconscious, is that the
settings.configure() thing is inelegant. I shouldn't have to configure
anything just to use the template library. I should be able to import
django.template.Template and django.template.Context, and use them
immediately to render some text.

Plainly put, the system should work without requiring configuration.

Sure, if you need template loading support, maybe then we would
require the settings to be configured. Sure, if you need
internationalization, maybe then we would require configuration. But
the barebones, common case of "render this template with this context,
with no internationalization" needs to work without having to mess
with configuration.

Here's what currently happens.

>>> from django.template import Template, Context
>>> t = Template('hello')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "django/template/__init__.py", line 167, in __init__
    if settings.TEMPLATE_DEBUG and origin == None:
  File "django/conf/__init__.py", line 28, in __getattr__
    self._import_settings()
  File "django/conf/__init__.py", line 55, in _import_settings
    raise EnvironmentError, "Environment variable %s is undefined." %
ENVIRONMENT_VARIABLE
EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined.

I think some work in this area *would* be worth it, as it would make
it easier to use Django's template language in a standalone setting
but would stop short of being a complete reorganization of the code
and architecture.

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to