I am building a project on GAE, webapp2, jinja2 and I use engineauth for authorization. I need something like Django’s context_processor in order to use session, user and some other variables from webapp2.request in templates. Please, help me to solve this problem.
I am building a project on GAE, webapp2, jinja2 and I use engineauth for
Share
There are many ways to achieve this.
The simplest way probably looks like this:
I like when my variables are in template globals, then I can access them in my template widgets without having to pass around bunch of vars in template. So I am doing it like this:
There are other methods in: Context processor using Werkzeug and Jinja2