[... To be a valid tag library, the module '''must''' contain a module-
level variable '''named register''' that is a template.Library instance,
in which all the tags and filters are registered. So, near the top of your
module, put the following: ...]
if I'm not mistaken, "register" is just a convention. I would be more
explicit:
[... To be a valid tag library, the module '''must''' contain a module-
level variable '''(by convention named register)''' that is a
template.Library instance, in which all the tags and filters are
registered. So, near the top of your module, put the following: ...]
--
Ticket URL: <https://code.djangoproject.com/ticket/21526>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0
Comment:
Hi,
The documentation is correct here. Django's template code specifically
looks for a variable named `register`:
https://github.com/django/django/blob/master/django/template/base.py#L1286
--
Ticket URL: <https://code.djangoproject.com/ticket/21526#comment:1>
Comment (by oubiga):
Hi,
You are absolutely right!
Thanks.
--
Ticket URL: <https://code.djangoproject.com/ticket/21526#comment:2>