I can't figure out how to access
. In standart Jinja2 examples I can see an example of datetimeformat
def datetimeformat(value, format='%H:%M / %d-%m-%Y'):
Then we can add the filter:
environment.filters['datetimeformat'] = datetimeformat
But I attached django_jinja application and now use a standart
method from django.shortcuts (Jinja's macros, built-in functions work OK
). So my views make such responses:
return render_to_response( html_template, result_dict )
I only included Jinja2 app and don't worry about constructing custom Jinja2 response, but I don't know how to access the environment.
What should I change to add a custom template filter with django_jinja application?
Here is a description of the app: https://pypi.python.org/pypi/django-jinja/0.8