[Flask] help on context processor and Jinja filter

夏天的风 langslike at foxmail.com
Wed Jan 20 04:09:54 EST 2016


Hi:
    When we need to do process some value, or do some text formatting, we can define a filter function, which is really handy. However when I ran into this article about Context processors,:
    http://flask.pocoo.org/docs/0.10/templating/
     I really want to know the differences between a filter function and a context processor function. Is  context processor function mainly designed for those who are not using Jinja, so that they can still implement filters in another way?  I found that people tend to do more complicated things in a context processor function, say get hottest articles in a blog, list recent articles and so on.
     Thx.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160120/57a357e0/attachment.html>


More information about the Flask mailing list