#13334: Importing template tags from an egg fails
--------------------------------------+-------------------------------------
Reporter: joerg86 | Owner: nobody
Status: new | Milestone: 1.2
Component: Template system | Version: SVN
Resolution: | Keywords:
Stage: Accepted | Has_patch: 1
Needs_docs: 0 | Needs_tests: 1
Needs_better_patch: 0 |
--------------------------------------+-------------------------------------
Comment (by kmtracey):
Attached a patch with tests that uses the utility function from the patch
on #13348.
While the earlier patch works to load valid tags from eggs, the case where
it does not work is where there is an egg with a templatetags module, but
attempting to import it raises an !ImportError. With the earlier patch
this case gets reported indicating that the tag library could not be found
("'broken_egg' is not a valid tag library: Template library broken_egg not
found, tried
django.templatetags.broken_egg,tagsegg.templatetags.broken_egg") instead
of properly indicating what the real problem is ("'broken_egg' is not a
valid tag library: !ImportError raised loading
tagsegg.templatetags.broken_egg: cannot import name Xtemplate").
This patch also changes from raising a bare !ImportError to
!TemplateSyntaxError. That makes the debug page include a the snippet from
the template that has caused the problem, and restores much of the text
that used to be in the error message for this case (minus the misleading
identification of where the templatetags module was supposedly located.
The text of the message could maybe be improved but I'm too tired for that
just now.)
--
Ticket URL: <http://code.djangoproject.com/ticket/13334#comment:5>
Django <http://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 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-updates?hl=en.