Live data from Hacker News

Flask 0.7 Released (Python Web Framework)

flask.pocoo.org

51–60 of 80 posts

Re: Flask 0.7 Released (Python Web Framework)

#51

I really enjoy Flask's simplicity (relative to Django) and light-weightness. It was the first web framework I used, actually. Armin Ronacher & team make quality products.

The debugger is badass. I built a few simple sites with Flask year and it was the thing I wished most I could have in Rails.

Can't help you with Rails, but in case you or anyone else didn't know the Django-Extensions app adds the Flask (Werkzeug) debugger to Django projects with the run_plus command.

Re: Flask 0.7 Released (Python Web Framework)

#52
post #39

Right now, I'm writing most of my projects in Tornado.. Not because I need the async, but because I wanted a simple web.py like format that was under active development. Can someone help me understand where Flask fits into things? It would essentially be a replacement for Tornado? What's the advantage of this over Tornado? Ease of use? I can understand the simplicity argument; I chose to avoid Django because it was t…

You can actually use Flask from within Tornado's WSGI adapter.

http://flask.pocoo.org/docs/deploying/others/

This lets your leverage Tornado's high-performance IO loop while still developing your web application using Flask.

Re: Flask 0.7 Released (Python Web Framework)

#53

I'm always impressed by Flask - especially its documentation. In fact, this seems like a good occasion to have a poke around and build something with it. On a slightly related note - although jinja2 is already quite compact, I'm a fan of haml and I'm always surprised by the lack of support for it in Python. Is there something I'm missing? Uncanny valley for Pythonistas?

You can roll out your own or use one of the existing translators which translate from haml to jinja2 syntax.

Do you use slim templates? I recently wrote a hand rolled recursive decent parser which translates slim to jinja2 - https://github.com/thoughtnirvana/slimish-jinja2. Jinja2 supports extensions and after adding this extension, you can write slim templates which will be translated to jinja2 on the run.

The lexer and parser are simple enough - you can make code changes or roll out your own if you want to.

Re: Flask 0.7 Released (Python Web Framework)

#54
post #39

Right now, I'm writing most of my projects in Tornado.. Not because I need the async, but because I wanted a simple web.py like format that was under active development. Can someone help me understand where Flask fits into things? It would essentially be a replacement for Tornado? What's the advantage of this over Tornado? Ease of use? I can understand the simplicity argument; I chose to avoid Django because it was t…

For a web framework(non async run of the mill), I would say Flask has an edge. My Flask stack is:

1. SQLAlchemy for ORM.

2. Jinja2 for templates (flask default).

3. Flask for basic web framework functionality.

4. WTForm for forms.

5. Other extensions as needed.

Flask itself is built on werkzeug which is a clean, high-level wrapper over WSGI. Basically Flask is assembling working components into coherent applications. I have done some applications in flask and I can say it's suited for applications of all size.

Tornado, on the other hand, implements its own templating and orm.

Re: Flask 0.7 Released (Python Web Framework)

#55
post #54
post #39

Right now, I'm writing most of my projects in Tornado.. Not because I need the async, but because I wanted a simple web.py like format that was under active development. Can someone help me understand where Flask fits into things? It would essentially be a replacement for Tornado? What's the advantage of this over Tornado? Ease of use? I can understand the simplicity argument; I chose to avoid Django because it was t…

For a web framework(non async run of the mill), I would say Flask has an edge. My Flask stack is: 1. SQLAlchemy for ORM. 2. Jinja2 for templates (flask default). 3. Flask for basic web framework functionality. 4. WTForm for forms. 5. Other extensions as needed. Flask itself is built on werkzeug which is a clean, high-level wrapper over WSGI. Basically Flask is assembling working components into coherent applications.…

Tornado doesn't have any orm, it only has a very thin wrapper around MySQLdb.

Re: Flask 0.7 Released (Python Web Framework)

#56

I'm always impressed by Flask - especially its documentation. In fact, this seems like a good occasion to have a poke around and build something with it. On a slightly related note - although jinja2 is already quite compact, I'm a fan of haml and I'm always surprised by the lack of support for it in Python. Is there something I'm missing? Uncanny valley for Pythonistas?

There was a Haml-like language called GHRML a while back, but it seems to have disappeared. There is something like it called SHPAML: http://shpaml.webfactional.com/ Though I think Ruby has better markup libraries in general. For example, they have Nokogiri, which is an absolute joy to use for XML parsing. And implementations of Markdown and Textile with actual parsers, whereas Python Markdown and Python Textile are…

python-markdown is in no way port of perl version. It's complete parser which can be extended and so on. But python-markdown2 is port of perl version, based on regexps instead of being real parser.

Re: Flask 0.7 Released (Python Web Framework)

#57
I've used it for small side-projects and liked it. What I would like to know is how to do logging, both day-to-day ("user Joe created") and for debugging (like JSON dumps of objects). It should work both with the built-in server and with gunicorn, for deployment. I looked but wasn't able to find a solution that worked. The documentation mentioned logging facilities, but I found no working examples.

Re: Flask 0.7 Released (Python Web Framework)

#58
post #31

Earlier quoted context omitted.

I must have been mistaken for static files, for templates however it is the case: https://github.com/defnull/bottle/blob/master/bottle.py#L263... You can override it but you would have to do that for every call to `template` or by monkey patching `TEMPLATE_PATH`.

In the big picture, I don't see having to write a wrapper function for template rendering with a fixed template_lookup argument being a big deal (I'm basing all of my judgments on source alone, I've only fiddled with either framework).

It's still a problem for modularity, something like Flask's blueprints are basically impossible for Bottle.

Re: Flask 0.7 Released (Python Web Framework)

#59

I've used it for small side-projects and liked it. What I would like to know is how to do logging, both day-to-day ("user Joe created") and for debugging (like JSON dumps of objects). It should work both with the built-in server and with gunicorn, for deployment. I looked but wasn't able to find a solution that worked. The documentation mentioned logging facilities, but I found no working examples.

I believe that refers to the standard python "logging" module.

Re: Flask 0.7 Released (Python Web Framework)

#60

I'm always impressed by Flask - especially its documentation. In fact, this seems like a good occasion to have a poke around and build something with it. On a slightly related note - although jinja2 is already quite compact, I'm a fan of haml and I'm always surprised by the lack of support for it in Python. Is there something I'm missing? Uncanny valley for Pythonistas?

There was a Haml-like language called GHRML a while back, but it seems to have disappeared. There is something like it called SHPAML: http://shpaml.webfactional.com/ Though I think Ruby has better markup libraries in general. For example, they have Nokogiri, which is an absolute joy to use for XML parsing. And implementations of Markdown and Textile with actual parsers, whereas Python Markdown and Python Textile are…

XML parsing: lxml (lxml.html is particularly wonderful).

Markdown/Textile; in the Python world people mostly use Restructured Text, not least because of its privileged position in docstrings.

Post reply on HN