Live data from Hacker News

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

stxnext.com

91–100 of 168 posts

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

#91
post #29

We need to write a lot of small APIs in Python for SPAs. We ended up going with FastAPI which utilizes Starlette under the hood. I'm surprised neither of them are mentioned here. Starlette was developed by the same dev who wrote the Django RESTful package. If you mostly just need REST APIs or even GraphQL, it feels far more light and modern than anything in Django and forms some better opinions around things than the…

Do frameworks need to be asynchronous or is it good enough to just spawn threads for background tasks?

Asynchronous IO is really good at doing nothing, especially doing multiple nothings in parallel.

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

#92

Earlier quoted context omitted.

Django is a pretty big omission from your list.

Good point. I was specifically looking for "base-level" frameworks that focus on routing and responses (so are well-suited for API development) rather than full-stack solutions (e.g. FastAPI isn't there either). Just copy/pasted that from my notes -- as I said, FWIW.

Django’s REST library is incredible. Steep learning curve compared to flask etc, but truly an industrial strength library that is brilliantly designed.

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

#93
post #35

I was forced to encounter Web2Py in an open-source project several years ago. It was awful. Besides the fact that it's stuck in Python 2 (seriously, even today?), it had a lot of bizarre design decisions. For instance, it loaded controllers by concatenating files in a directory - alphabetically. I know Python's import system can confuse some folks, but surely there was a better way. The whole thing left a very sour t…

Sour taste and sour grapes? And yes it supports Python 3.

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

#94

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://sym…

Not really 5 years ago Python and its framework were cleaner as it is today. They are mostly based on WSGI or ASGI. The only different breed were grand daddy of all framework called Zope and Twisted Matrix (for network programming besides web). Obviously Zope modernized as library with WSGI support and async support is built into Python.

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

#95

Earlier quoted context omitted.

Is there any python framework that optimizes for developer productivity?

Django's tagline is "The Web framework for perfectionists with deadlines".

.. That comes with a brief documentation of 1941 pages (as of August 20, 2019)..

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

#96

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 the best of all of these if you don't need async.

Look at, for example, the best of all the flask tutorials of all time, Miguel Greenberg. He still has to create a ton of the boilerplate and then restructure the app half way through.

Pyramid is the goldilocks of frameworks: Just enough to get you going without insanity, and not too much to bog you down.

Here's the real truth: If you're going to build anything nontrivial, you need a ton of stuff that Flask doesn't give you, and the packages that are easy to install and add to your project are mostly anti-pattern.

If you are going to build something nontrivial with Django, you're going to have to tear out large parts of it and redo stuff.

Pyramid is the best balance. The WebSauna team si doing some amazing stuff, and I'm working on something similar that's a little more lightweight. Pyramid is a very active ecosystem. Just a little less exciting because we have some conceptual relationships with Pylons.

If you need async or websockets, I use starlette/fast-api for endpoints that get hit from my mako templates.

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

#97
post #24

Are any of these extremely good compared to a framework not written in Python? For example compared to Rails or Phoenix?

We’re mainly a C# shop with some JavaScript, but I’ve done my time with php, ror and java, and, Django is still my favourite web-framework. Don’t get me wrong I actually like .Net Core, but DB migrations, authentication, testing and productivity is just better in Django (I do have an unnatural hatred for entity framework). Django even had the best learning resource I’ve ever seen with the testing goat book. That bein…

Hating entity framework is not unnatural.

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

#99

Earlier quoted context omitted.

Django's tagline is "The Web framework for perfectionists with deadlines".

.. That comes with a brief documentation of 1941 pages (as of August 20, 2019)..

Isn't there a way to abstract that, using some of Django's libraries ?

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

#100

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…

Zope is probably the granddaddy of them all. Tried and failed miserably to use it 20 years ago.

Zope was my way into Python, way back in 2000. Brilliant concept, but hard to use well.
Post reply on HN