register_block_tag( library: django.template.library.Library, takes_context: Optional[bool] = None, upto: Optional[bool] = None, name: Optional[str] = None) ‑> Callable[[~_T], ~_T]
Helper for creating and registering a template tag that contains a block of html and accepts args and kwargs similarly to the
Wrap a callable in a parser, passing its args and kwargs to the wrapped callable, along with
its content nodelist as the
The implementation is identical to Django's inbuilt Library.simple_tag, except that it continues to parse up to an end marker.
- The tags library to register the tag with.
- Whether the tag accepts its parent context. Note that the block's content always receives its parent context. If provided, the decorated function must have
contextas its first parameter.
- The name of the template tag. Defaults to the function name.
- Override the tag signifying the end of the html block. Defaults to "end" prepended to the tag name.
- A decorator that can be used similarly to @simple_tag