When will jinja2 "2.8" become available?

108 views
Skip to first unread message

Kaan Soral

unread,
Aug 21, 2015, 4:09:21 PM8/21/15
to Google App Engine
Well the question says it all, I've been wanting to use {% set %} {% endset %} with jinja2 for a while - it's available at 2.8

(By the way the cloud playground is broken: https://cloud-playground.appspot.com/playground/?template_url=https:%2F%2Fgithub.com%2FGoogleCloudPlatform%2Fappengine-guestbook-python%2Fblob%2Fpart5-templates%2F#app.yaml - it doesn't load, it's the first time I'm seeing the playground - so I'm not sure how it works when it works)

I'm interested in alternatives too, if anyone has any
It's for a very specific use case, where I replace sections of translated phrases with html tags at templates - for example, "A [S]Tag[/S]" becomes "A <span style='gg'>Tag</span>" etc.

Storing raw html in variables is practical, otherwise putting htmls into jinja2 strings gets complicated due to quotation marks

Without the set/endset, macro's are a nice alternative, but an overkill

George S

unread,
Oct 6, 2015, 3:53:31 AM10/6/15
to Google App Engine
Would love to use jinja2 2.8 too, is there any update on this?

Renzo Nuccitelli

unread,
Oct 7, 2015, 6:37:03 AM10/7/15
to Google App Engine
Hi Guys,

Why waiting for Google to install libraries? What I have done in my projects is a little workaround so I can use virtualenv as a regular project. It is working as a charm for pure Python libraries. This is the case for Jinja and several other libraries.

What I do is installing the virtualenv within the project: https://github.com/renzon/tekton/tree/master/backend/venv. After installing it and dependencies from requirements I create a symlink inside de my App Engine  project folder: https://github.com/renzon/tekton/blob/master/backend/venv/venv.sh#L32. Once you create this symlink, App Engine SDK will upload all the libs which you install in your venv.

Finishing the workaround you need add this libraries on path: https://github.com/renzon/tekton/blob/master/backend/appengine/convention.py#L6.

I hope it can help you guys.

Cheers,
Renzo Nuccitelli

Kaan Soral

unread,
Oct 8, 2015, 10:41:39 AM10/8/15
to Google App Engine
Thanks a lot for sharing this method
Reply all
Reply to author
Forward
0 new messages