Which (or do any) of the major Python frameworks have Python 3 support?
Ask HN: Best Python web framework
51–60 of 110 posts
Re: Ask HN: Best Python web framework
#52Pyramid. http://en.wikipedia.org/wiki/Pyramid_%28web_framework%29 * faster. * better quality (100% statement coverage via unit tests) * supports latest python. * great documentation (including free up to date book). There's also a separate pyramid cookbook. * simplicity. If you just see a pyramid app, you can dive right in fairly easily without learning lots of alien stuff. * sensible defaults, and you can choose to…
As an alternative viewpoint * It's complicated * It doesn't really do much for you (have to spend lots of effort/time/learning plumbing in all the 3rd party libs) * Lacks sensible defaults for many things * Documentation is rather lacking. Oh, there's tons of it, but it's rather maze-like and hard to use if you don't actually understand the system. High-level overview/cookbook type stuff is severely lacking.
Pyramid will:
* get you laid.
* help you take over the world.
* bring about world peace.
* 100% compatible with emacs, vim, textmate, and even eclipse.
* enterprise mumble mumble certified.
* tool of choice for the coolest startups in the world.
* Compatible with multiple currencies, $ £ and €. So you can make three times as much money.
* venture capitalists prefer it. 'I will chose companies that use pyramid, over those that use Django.' -- pg
Re: Ask HN: Best Python web framework
#53I really like bottle.py [1]. I've used it for a couple of different projects; although not fundamentally different from web.py or flask, it seems to just "make sense". [1] http://bottlepy.org/docs/stable/ An example from their website: from bottle import get, post, request @get('/login') # or @route('/login') def login_form(): return ''' ''' @post('/login') # or @route('/login', method='POST') def login_submit(): nam…
PHP guy here, don't know much about other languages, but seeing HTML mixed in with code is usually a bad code smell. Is this type of thing common in Python?
Re: Ask HN: Best Python web framework
#54Earlier quoted context omitted.
> I can't imagine that the benefits would outweigh the disadvantages of having to deal with two frameworks instead of one. Separation of concerns, loose coupling. I tended to find (in the few Django projects I worked on), that models were frequently accessed outside the app that created and owned the model. The subsequent dependency diagram would be spaghetti. We had apps for each significant feature area, and when w…
How do you handle "foreign key references" between modules in your new approach (using APIs to decouple?).
You either choose high-chatter and low complexity, or low-chatter and high complexity. As high-chatter is also a decrease in performance (mostly due to JSON serialisation/deserialisation and HTTP requests), we opted for low-chatter.
Resources that were a composite of other resources had their own knowledge of how they were composed, and generated their own IDs to save that knowledge. Each new composition resource got it's own Accept header identifier as a result.
Within that composition resource, there wasn't just knowledge of "I'm composed of x:17 and y:3", but also knowledge of how to search across the underlying services. This could be to call search on the underlying service if one side of the composition was dominant in applying the filter to the dataset.
Where it was trivial, a search index belonging to the composed service was used. And because this duplicates data from the underlying resources, messaging was put into the underlying service to notify the composed service of changes that affect searches.
For simplicity you can just imagine that we had some kind of table in the composed service, with ID on each row that because the ID of the composed resource, and that we could search that table, and that messaging magic kept that table in sync.
We could do all of this because we owned all of the services. If we didn't, then I imagine we would have followed a similar path to http://ql.io/
Re: Ask HN: Best Python web framework
#55I really like bottle.py [1]. I've used it for a couple of different projects; although not fundamentally different from web.py or flask, it seems to just "make sense". [1] http://bottlepy.org/docs/stable/ An example from their website: from bottle import get, post, request @get('/login') # or @route('/login') def login_form(): return ''' ''' @post('/login') # or @route('/login', method='POST') def login_submit(): nam…
PHP guy here, don't know much about other languages, but seeing HTML mixed in with code is usually a bad code smell. Is this type of thing common in Python?
Generally you won't see PHP/JSP levels of code, but the more popular engines do allow quite a bit of logic, i.e. don't adhere to StringTemplate-level purity[1].
[1]: http://www.cs.usfca.edu/~parrt/papers/mvc.templates.pdf
Re: Ask HN: Best Python web framework
#56Earlier quoted context omitted.
Disagree, Django Rest Framework and TastyPie make REST APIs effortless: write Django models, register them with the REST plugin, hook the plugin to your main URL structure. They're a really good example of how Django enables reuse. Implementation-wise they both hook into the model framework and the form framework, although you can swap out those parts if your data lives elsewhere.
I see what you're saying. But I disagree that: Database = Model = Resource
Re: Ask HN: Best Python web framework
#57CherryPy has had Python 3 support for quite a while now. Not many Python frameworks have that. Pylons just got it, so I'd go with CherryPy. You can get WebSocket support too, and documentation is OK.
Re: Ask HN: Best Python web framework
#58Diesel (http://diesel.io/) has piqued my interest as of late -- it's a high-concurrency, coroutine-based framework with Flask under the hood, by the guys at Bump.
The next-gen Python Web frameworks will probably be non-WSGI because WSGI doesn't support WebSockets.
One approach would be a ZeroMQ-based framework like Brubeck (http://brubeck.io/) behind Mongrel2 (http://mongrel2.org/). But AFAIK, WebSocket support is not yet fully baked into Mongrel2. The handshake still needs to happen on the handler side.
Re: Ask HN: Best Python web framework
#59Tornado. Built-in async operations. Not standing in your way. Rapid developments. Huge community. Simply works. Simple, yet rich.
Use gevent. Huge community. Simply works and simply scales. And it makes all your blocking calls nonblocking automatically. Tornado just blocks.
Re: Ask HN: Best Python web framework
#60It converts your blocking calls to nonblocking, has no spaghetti code filled with callback shenanigans, and can even generate a full REST API for you.