'Register a callable as an inclusion tag:
@register.inclusion_tag(\'results.html\')
def show_results(poll):
choices = poll.choice_set.all()
return {\'choices\': choices}'

def inclusion_tag(self, filename, func=None, takes_context=None, name=None):

    def dec(func):
        (params, varargs, varkw, defaults, kwonly, kwonly_defaults, _) = getfullargspec(func)
        function_name = (name or getattr(func, '_decorated_function', func).__name__)
        @functools.wraps(func)
        def compile_func(parser, token):
            bits = token.split_contents()[1:]
            (args, kwargs) = parse_bits(parser, bits, params, varargs, varkw, defaults, kwonly, kwonly_defaults, takes_context, function_name)
            return InclusionNode(func, takes_context, args, kwargs, filename)
        self.tag(function_name, compile_func)
        return func
    return dec
