#25158: InvalidTemplateLibrary when using django_extensions
---------------------------------+--------------------
     Reporter:  jaddison         |      Owner:  nobody
         Type:  Bug              |     Status:  new
    Component:  Uncategorized    |    Version:  master
     Severity:  Release blocker  |   Keywords:
 Triage Stage:  Unreviewed       |  Has patch:  0
Easy pickings:  0                |      UI/UX:  0
---------------------------------+--------------------
 Trying to use django_extensions version 1.5.5 with Django master branch
 gives this traceback:

 {{{
 Environment:


 Request Method: GET
 Request URL: http://localhost:8000/

 Django Version: 1.9.dev20150721153804
 Python Version: 3.4.3
 Installed Applications:
 ['django.contrib.admin',
  'django.contrib.auth',
  'django.contrib.contenttypes',
  'django.contrib.sessions',
  'django.contrib.messages',
  'django.contrib.staticfiles',
  'django_extensions']
 Installed Middleware:
 ['django.middleware.security.SecurityMiddleware',
  'django.contrib.sessions.middleware.SessionMiddleware',
  'django.middleware.common.CommonMiddleware',
  'django.middleware.csrf.CsrfViewMiddleware',
  'django.contrib.auth.middleware.AuthenticationMiddleware',
  'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
  'django.contrib.messages.middleware.MessageMiddleware',
  'django.middleware.clickjacking.XFrameOptionsMiddleware']


 Traceback:

 File
 "/Users/jaddison/.virtualenvs/django19test/src/django/django/template/utils.py"
 in __getitem__
   86.             return self._engines[alias]

 During handling of the above exception ('django'), another exception
 occurred:

 File "/Users/jaddison/.virtualenvs/django19test/lib/python3.4/site-
 packages/django_extensions/templatetags/highlighting.py" in <module>
   41.     from pygments import highlight as pyghighlight

 During handling of the above exception (No module named 'pygments'),
 another exception occurred:

 File
 
"/Users/jaddison/.virtualenvs/django19test/src/django/django/template/backends/django.py"
 in get_package_libraries
   144.             module = import_module(entry[1])

 File
 "/Users/jaddison/.virtualenvs/django19test/lib/python3.4/importlib/__init__.py"
 in import_module
   109.     return _bootstrap._gcd_import(name[level:], package, level)

 File "/Users/jaddison/.virtualenvs/django19test/lib/python3.4/site-
 packages/django_extensions/templatetags/highlighting.py" in <module>
   45.     raise ImportError("Please install 'pygments' library to use
 highlighting.")

 During handling of the above exception (Please install 'pygments' library
 to use highlighting.), another exception occurred:

 File
 
"/Users/jaddison/.virtualenvs/django19test/src/django/django/core/handlers/base.py"
 in get_response
   147.                     response = wrapped_callback(request,
 *callback_args, **callback_kwargs)

 File "/Users/jaddison/projects/django19test/testviews/views.py" in
 testview
   5.     return render(request, template)

 File
 "/Users/jaddison/.virtualenvs/django19test/src/django/django/shortcuts.py"
 in render
   67.             template_name, context, request=request, using=using)

 File
 
"/Users/jaddison/.virtualenvs/django19test/src/django/django/template/loader.py"
 in render_to_string
   91.             template = get_template(template_name, using=using)

 File
 
"/Users/jaddison/.virtualenvs/django19test/src/django/django/template/loader.py"
 in get_template
   21.     engines = _engine_list(using)

 File
 
"/Users/jaddison/.virtualenvs/django19test/src/django/django/template/loader.py"
 in _engine_list
   139.     return engines.all() if using is None else [engines[using]]

 File
 "/Users/jaddison/.virtualenvs/django19test/src/django/django/template/utils.py"
 in all
   110.         return [self[alias] for alias in self]

 File
 "/Users/jaddison/.virtualenvs/django19test/src/django/django/template/utils.py"
 in <listcomp>
   110.         return [self[alias] for alias in self]

 File
 "/Users/jaddison/.virtualenvs/django19test/src/django/django/template/utils.py"
 in __getitem__
   101.             engine = engine_cls(params)

 File
 
"/Users/jaddison/.virtualenvs/django19test/src/django/django/template/backends/django.py"
 in __init__
   31.         options['libraries'] =
 self.get_templatetag_libraries(libraries)

 File
 
"/Users/jaddison/.virtualenvs/django19test/src/django/django/template/backends/django.py"
 in get_templatetag_libraries
   49.         libraries = get_installed_libraries()

 File
 
"/Users/jaddison/.virtualenvs/django19test/src/django/django/template/backends/django.py"
 in get_installed_libraries
   131.             for name in get_package_libraries(pkg):

 File
 
"/Users/jaddison/.virtualenvs/django19test/src/django/django/template/backends/django.py"
 in get_package_libraries
   148.                 "trying to load '%s': %s" % (entry[1], e)

 Exception Type: InvalidTemplateLibrary at /
 Exception Value: Invalid template library specified. ImportError raised
 when trying to load 'django_extensions.templatetags.highlighting': Please
 install 'pygments' library to use highlighting.
 }}}

 I'm not positive, but it looks like it will always blow up when a template
 tag 'library' is encountered that has missing Python dependencies - even
 if you don't use that library.

--
Ticket URL: <https://code.djangoproject.com/ticket/25158>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/051.bb11d42bd7146954428b4e026c002eb4%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to