Although you can use a context processor, this may not always be what you want.
In the accepted answer, a fragment of documents:
[Filters] may have optional arguments in parentheses.
So, looking at the filter of the authorβs template:
@mod.app_template_filter('posts_page') def posts(post_id, company_id): pass
The following applies in the template:
{{ post.id|posts_page(post.company_id) }}
source share