librelist archives

« back to archive

Flask and PJAX

Flask and PJAX

From:
Zach Williams
Date:
2011-12-26 @ 03:40
I was curious about using PJAX
<https://github.com/defunkt/jquery-pjax>recently, so I put together a
small example site:
http://flaskpjax.herokuapp.com/

All of the source code is available on Github:
https://github.com/zachwill/pjax_flask

I came across some trouble trying to use blocks, and opted for an include
tag instead (I don't know if Flask/Jinja have something similar to
Sinatra/ERB's :layout => false):
https://github.com/defunkt/jquery-pjax/tree/heroku

Anyways, was just looking for some discussion on whether this is the
preferred way to go about integrating with PJAX or not — basically ignoring
blocks and opting for include tags.

Thanks.

Zach

Re: [flask] Flask and PJAX

From:
Simon Sapin
Date:
2011-12-26 @ 06:47
Le 26/12/2011 04:40, Zach Williams a écrit :
> I came across some trouble trying to use blocks, and opted for an
> include tag instead (I don't know if Flask/Jinja have something similar
> to Sinatra/ERB's :layout => false):
> https://github.com/defunkt/jquery-pjax/tree/heroku


I haven’t tried it, but were you using this?
http://jinja.pocoo.org/docs/api/#jinja2.Template.blocks

It is the low-level API, so when using it you need to do more work than 
usual.

Regards,
-- 
Simon Sapin