TemplateSyntaxError: 'subpackage.echo' is not a valid tag library

26 views
Skip to first unread message

Jose Paul

unread,
Nov 11, 2015, 7:33:02 AM11/11/15
to Django users
   getting following error ,can someone help me to understand this

.........
compiled_result = compile_func(self, token)
  File "C:\Python27\lib\site-packages\django\template\defaulttags.py", line 1140, in load
    (taglib, e))
TemplateSyntaxError: 'subpackage.echo' is not a valid tag library: Template library subpackage.echo not found, tried django.templatetags.subpackage.echo

James Schneider

unread,
Nov 11, 2015, 2:01:40 PM11/11/15
to django...@googlegroups.com

> --

What does the template line look like that it's throwing that error? Do you have something like {% subpackage.echo %} in your template?

-James

Jose Paul

unread,
Nov 12, 2015, 8:10:26 AM11/12/15
to Django users
I am just running DJango 1.8 test cases ,here is start of the error trace .

=====================================================================
ERROR: test_load06 (template_tests.syntax_tests.test_load.LoadTagTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\template_tests\utils.py", line 117, in inner
    func(self)
  File "C:\Python27\lib\site-packages\django\test\utils.py", line 196, in inner
    return test_func(*args, **kwargs)
  File "C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\template_tests\utils.py", line 62, in inner
    func(self)
  File "C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\template_tests\syntax_tests\test_load.py", line 39, in test_load06
    output = self.engine.render_to_string('load06')
  File "C:\Python27\lib\site-packages\django\template\engine.py", line 208, in render_to_string

James Schneider

unread,
Nov 12, 2015, 7:14:50 PM11/12/15
to django...@googlegroups.com
On Thu, Nov 12, 2015 at 5:10 AM, Jose Paul <joseka...@gmail.com> wrote:
I am just running DJango 1.8 test cases ,here is start of the error trace .

=====================================================================
ERROR: test_load06 (template_tests.syntax_tests.test_load.LoadTagTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\template_tests\utils.py", line 117, in inner
    func(self)
  File "C:\Python27\lib\site-packages\django\test\utils.py", line 196, in inner
    return test_func(*args, **kwargs)
  File "C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\template_tests\utils.py", line 62, in inner
    func(self)
  File "C:\Users\IBM_ADMIN\PythonWorkspace\DJangoTestCases\src\DJangoTestCases\tests\template_tests\syntax_tests\test_load.py", line 39, in test_load06
    output = self.engine.render_to_string('load06')
  File "C:\Python27\lib\site-packages\django\template\engine.py", line 208, in render_to_string


I suspect one of your tests is rendering a template. Do you have a reference to a template tag anywhere in your templates like {% subpackage.echo %}? I'm guessing if you visit the page that has that reference, it will also break in a similar manner. You probably need to add a {% load tag_library %} or whatever your template tags are called in your template before you call the template tag. 

-James

Tom Evans

unread,
Nov 13, 2015, 6:24:00 AM11/13/15
to django...@googlegroups.com
On Fri, Nov 13, 2015 at 12:14 AM, James Schneider
<jrschn...@gmail.com> wrote:
> On Thu, Nov 12, 2015 at 5:10 AM, Jose Paul <joseka...@gmail.com> wrote:
>>
>> I am just running DJango 1.8 test cases ,here is start of the error trace
>
> I suspect one of your tests is rendering a template. Do you have a reference
> to a template tag anywhere in your templates like {% subpackage.echo %}? I'm
> guessing if you visit the page that has that reference, it will also break
> in a similar manner. You probably need to add a {% load tag_library %} or
> whatever your template tags are called in your template before you call the
> template tag.

He is running the tests that are built in to django, not his own test
cases, specifically this one:

https://github.com/django/django/blob/master/tests/template_tests/syntax_tests/test_load.py#L41


OP: You will need to clarify how you are running the test suite. The
built in django tests depend on various settings, are you following
the instructions in:

https://docs.djangoproject.com/en/1.8/internals/contributing/writing-code/unit-tests/#quickstart

and

https://docs.djangoproject.com/en/1.8/internals/contributing/writing-code/unit-tests/#running-all-the-tests

?

Cheers

Tom
Reply all
Reply to author
Forward
0 new messages