On Thu, Oct 29, 2009 at 11:07 AM, Waylan Limberg <way...@gmail.com> wrote: > On Thu, Oct 29, 2009 at 10:37 AM, Johan <djjord...@gmail.com> wrote: >> >> I am >> wanting to use the template engine outside the context of a django >> project so I would not have a settings file anywhere on my path. > > This is documented here: > > http://docs.djangoproject.com/en/dev/topics/settings/#using-settings-without-setting-django-settings-module > >> 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.
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 -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---