Opened 19 years ago

Closed 19 years ago

Last modified 18 years ago

#242 closed defect (fixed)

Traceback when viewing tag docs.

Reported by: mmarshall Owned by: Jacob
Component: contrib.admin Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

going to /admin/doc/tags/ results in the following traceback:

There's been an error:

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 63, in get_response
    return callback(request, **param_dict)

  File "/usr/lib/python2.4/site-packages/django/views/decorators/cache.py", line 27, in _check_cache
    response = view_func(request, *args, **kwargs)

  File "/usr/lib/python2.4/site-packages/django/views/admin/doc.py", line 71, in template_tag_index
    return HttpResponse(t.render(c))

  File "/usr/lib/python2.4/site-packages/django/core/template.py", line 116, in render
    return self.nodelist.render(context)

  File "/usr/lib/python2.4/site-packages/django/core/template.py", line 437, in render
    bits.append(node.render(context))

  File "/usr/lib/python2.4/site-packages/django/core/template_loader.py", line 97, in render
    return compiled_parent.render(context)

  File "/usr/lib/python2.4/site-packages/django/core/template.py", line 116, in render
    return self.nodelist.render(context)

  File "/usr/lib/python2.4/site-packages/django/core/template.py", line 437, in render
    bits.append(node.render(context))

  File "/usr/lib/python2.4/site-packages/django/core/template_loader.py", line 79, in render
    compiled_parent = self.get_parent(context)

  File "/usr/lib/python2.4/site-packages/django/core/template_loader.py", line 74, in get_parent
    return get_template_from_string(load_template_source(parent, self.template_dirs))

  File "/usr/lib/python2.4/site-packages/django/core/template_loader.py", line 20, in get_template_from_string
    return template.Template(source)

  File "/usr/lib/python2.4/site-packages/django/core/template.py", line 107, in __init__
    self.nodelist = compile_string(template_string)

  File "/usr/lib/python2.4/site-packages/django/core/template.py", line 122, in compile_string
    return parser.parse()

  File "/usr/lib/python2.4/site-packages/django/core/template.py", line 220, in parse
    nodelist.append(registered_tags[command](self, token))

  File "/usr/lib/python2.4/site-packages/django/core/template_loader.py", line 115, in do_block
    nodelist = parser.parse(('endblock',))

  File "/usr/lib/python2.4/site-packages/django/core/template.py", line 222, in parse
    raise TemplateSyntaxError, "Invalid block tag: '%s'" % command

TemplateSyntaxError: Invalid block tag: 'admin_media_prefix'

Change History (7)

comment:1 by Jacob, 19 years ago

Owner: changed from Adrian Holovaty to Jacob

comment:2 by Jacob, 19 years ago

Status: newassigned

comment:3 by Adrian Holovaty, 19 years ago

milestone: Version 1.0

comment:4 by Jacob, 19 years ago

Resolution: worksforme
Status: assignedclosed

I can't reproduce this, but it sounds like you're missing a {% load adminmedia %} somewhere; have you updated your code lately?

comment:5 by Jacob, 19 years ago

Resolution: worksforme
Status: closedreopened

Wait, I just got the error myself.

comment:6 by Jacob, 19 years ago

Resolution: fixed
Status: reopenedclosed

(In [390]) Fixed a subtle bug with the {% load %} tag: if a tag/filter was removed from template.registered_tags/filters, {% load %} would fail (since module-level code is only run on an initial import). {% load %} now reloads the module, which makes sure that the tag always works even when someone's been doing something screwy. This fixes #242 (and wouldn't had been found without it, so much thanks).

comment:7 by (none), 18 years ago

milestone: Version 1.0

Milestone Version 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top