Live data from Hacker News

A Beginner’s Introduction to Python Web Frameworks (2018)

stxnext.com

51–60 of 168 posts

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#51

This is a short list I have compiled a few months ago, FWIW: New kids on the block: - Starlette https://www.starlette.io - Vibora https://vibora.io - Xweb https://github.com/gaojiuli/xweb - Storm https://github.com/jiajunhuang/storm - Responder http://python-responder.org - Quart https://pgjones.gitlab.io/quart/ - Sanic https://sanic.readthedocs.io - Bocadillo https://bocadilloproject.github.io/ - Japronto https://gi…

Is there any python framework that optimizes for developer productivity?

Flask is pretty good. Stays out of your way and does what a framework must, and has some extras for forms etc.. if you want to use them. Tornado is fun to use, but less resources and libraries.

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#52

Of these frameworks, Pyramid is the only one I know of that uses the concept of traversal. Traversal is an elegant way to tame big projects. Whenever I look at a web framework, I look for traversal and I'm always a little disappointed to see it's missing. Traversal means the framework treats each path segment in the URL as a possible branch in a tree of resources provided by the app. After completing traversal, the f…

Pyramid is so well designed. The maintainers have a philosophy of "if it's not documented, it's broken", and it shows. They even have an amazing defense-of-design document.

http://docs.pylonsproject.org/projects/pyramid/en/latest/des...

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#53

Of these frameworks, Pyramid is the only one I know of that uses the concept of traversal. Traversal is an elegant way to tame big projects. Whenever I look at a web framework, I look for traversal and I'm always a little disappointed to see it's missing. Traversal means the framework treats each path segment in the URL as a possible branch in a tree of resources provided by the app. After completing traversal, the f…

Why is this better than using mixins when defining a Django CBV?

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#54
post #25

Earlier quoted context omitted.

>Yes, even on Windows. This would require you to run your containers on Windows servers right? Not much reason to do that anymore. Instead should just containerize as part of deployment pipeline

Docker on Windows can run linux containers just the same as docker on linux.. it uses a virtualbox vm with linux and runs containers inside that

This is not the case. It uses Hyper-V (which is multitudes faster in every benchmark I’ve seen and much more stable)

https://docs.docker.com/machine/get-started/

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#55

Earlier quoted context omitted.

Docker on Windows can run linux containers just the same as docker on linux.. it uses a virtualbox vm with linux and runs containers inside that

This is not the case. It uses Hyper-V (which is multitudes faster in every benchmark I’ve seen and much more stable) https://docs.docker.com/machine/get-started/

And WSL2 takes it a stage further, running linux-native docker on a linux kernel (albeit wsl2 is itself running in a specialised Hyper-V machine).

I haven't used Docker with WSL2 yet, but in other uses I've found WSL2 extremely fast. As long as you stay within its vhd, file access is ext4-quick. And on my machine running the geekbench cli gave me almost identical results to a native linux install.

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#56

Earlier quoted context omitted.

Is there any python framework that optimizes for developer productivity?

Flask is pretty good. Stays out of your way and does what a framework must, and has some extras for forms etc.. if you want to use them. Tornado is fun to use, but less resources and libraries.

I started working with Django when it was pre 1.0 (0.96), as it was explicit in nature compared to Ruby on rails in 2003-4. Subsequently I tried flask and recently async framework. Our team still use flask just for one reason, it's a thin layer over wsgi making it easier and once application or service grows it can disappear completely.

So it has right level of abstraction making it between a library and framework and you can use it either as library or framework. The difference is "framwwork calls your code" and "your code calls library code". I like the second paradigm more.

In order to make job very easy to develop there are excellent libraries so I have used flask, sqlalchemy (direct no flasl-sqlalchemy), alembic, marshmallow, celery, machine learning libraries (sci-kit, tensorflow, keras) and few more.

For development use cherrypy to graft wsgi app and for production use gunicorn or uwsgi. Our team is extremely happy and our test coverage is 98% as we use code as libraries not asnframework, so it makes it easy to test rest API and celery task code.

Also when needed for performance (not often as most libraries are better tested and designed), did take away the library abstraction and write our own code.

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#57
post #34

For such a comprehensive list, no mention of tornado?

That surprised me too. IMHO Tornado should be #3 after Django and Flask since AFAIK it has the best built-in support for writing hybrid HTTP/WebSocket servers in Python. I use Tornado to serve the WebSocket backend for https://www.slickdns.com/live/ . I've also used Django Channels to add WebSocket support to a Django app and found it very cumbersome compared to Tornado.

+1 For Tornado.

I'm curious if you care for their templates or not, though.

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#58

Earlier quoted context omitted.

Same can be said for any system, regardless of the language. Unless you’re able to create an artifact like a single executable or a Jar but you still need to supervise those and keep them running.

Say what you want to about PHP, but when it comes to deployment it’s hard to beat.

I have had the opposite experience personally. Any non-trivial application I've deployed has been a lot more complicated with PHP than anything I ever experienced with Python.

Asyncio really makes a difference here. I also hate that PHP has to spin up with every single request. This is something I have never gotten used to (From my understanding, most Python web frameworks just give you a clear/fresh Request Object, which is so much better even with WSGI (unless you're using WSGI scripts) Much easier to maintain application state this way in my experience. PHP-FPM doesn't exactly solve this problem, I don't think).

Re: A Beginner’s Introduction to Python Web Frameworks (2018)

#59

This is a short list I have compiled a few months ago, FWIW: New kids on the block: - Starlette https://www.starlette.io - Vibora https://vibora.io - Xweb https://github.com/gaojiuli/xweb - Storm https://github.com/jiajunhuang/storm - Responder http://python-responder.org - Quart https://pgjones.gitlab.io/quart/ - Sanic https://sanic.readthedocs.io - Bocadillo https://bocadilloproject.github.io/ - Japronto https://gi…

Welcome to php world, 5 years ago, when there where an astonishing number of frameworks. It seems to have coalessed around just a few (maybe the lack of the languague being as hot.. has limited resources)

Where php ended up somewhat confusingly is the frameworks are now frameworks and components to make web programming easier (syfony/zend...), which seem to be driving drupal and wordpress development.

eg: https://symfony.com/

Post reply on HN