maraujop/django-crispy-forms — Issue #24: django-crispy-forms and django-sekizai and django-jinja2
Author: pannal
Created: 2012-03-05 17:27:26+00:00
State: open

Hey,

using the above combination of modules results in an error (may be a circular import):

```
(djangocms)cmstest@dev:~/djangocms/project/subproject/toxavis$ python manage.py runserver 0.0.0.0:8000 --settings=settings_panni
Traceback (most recent call last):
File "manage.py", line 14, in
execute_manager(settings)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/core/management/__init__.py", line 438, in execute_manager
utility.execute()
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/core/management/__init__.py", line 379, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/devserver/management/commands/runserver.py", line 70, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/core/management/base.py", line 209, in execute
translation.activate('en-us')
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/utils/translation/__init__.py", line 100, in activate
return _trans.activate(language)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 202, in activate
_active.value = translation(language)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 185, in translation
default_translation = _fetch(settings.LANGUAGE_CODE)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/utils/translation/trans_real.py", line 162, in _fetch
app = import_module(appname)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/cms/__init__.py", line 9, in
patch_settings()
File "/home/cmstest/djangocms/lib/python2.6/site-packages/cms/conf/__init__.py", line 32, in patch_settings
post_patch_check()
File "/home/cmstest/djangocms/lib/python2.6/site-packages/cms/conf/patch.py", line 56, in post_patch_check
if not validate_template(template[0], ['js', 'css']):
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django_sekizai-0.5-py2.6.egg/sekizai/helpers.py", line 86, in validate_template
found = get_namespaces(template)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django_sekizai-0.5-py2.6.egg/sekizai/helpers.py", line 76, in get_namespaces
compiled_template = get_template(template)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/template/loader.py", line 157, in get_template
template, origin = find_template(template_name)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/template/loader.py", line 128, in find_template
loader = find_template_loader(loader_name)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/template/loader.py", line 95, in find_template_loader
mod = import_module(module)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django_jinja/loaders.py", line 7, in
from django_jinja.base import env
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django_jinja/base.py", line 173, in
env = Environment(**initial_params)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django_jinja/base.py", line 94, in __init__
filemod = import_module(file_mod_path)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/utils/importlib.py", line 35, in import_module
__import__(name)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/crispy_forms/templatetags/crispy_forms_filters.py", line 8, in
from crispy_forms.helper import FormHelper
File "/home/cmstest/djangocms/lib/python2.6/site-packages/crispy_forms/helper.py", line 4, in
from utils import render_field
File "/home/cmstest/djangocms/lib/python2.6/site-packages/crispy_forms/utils.py", line 14, in
default_field_template = get_template("%s/field.html" % TEMPLATE_PACK)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/template/loader.py", line 157, in get_template
template, origin = find_template(template_name)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/template/loader.py", line 128, in find_template
loader = find_template_loader(loader_name)
File "/home/cmstest/djangocms/lib/python2.6/site-packages/django/template/loader.py", line 101, in find_template_loader
raise ImproperlyConfigured('Error importing template source loader %s: "%s"' % (loader, e))
django.core.exceptions.ImproperlyConfigured: Error importing template source loader django_jinja.loaders.FileSystemLoader: "'module' object has no attribute 'FileSystemLoader'"
```

TEMPLATE_LOADERS is
```
(
'django_jinja.loaders.FileSystemLoader',
'django_jinja.loaders.AppLoader',
)
```