Live data from Hacker News

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

stxnext.com

121–130 of 168 posts

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

#121
post #68

I primarily use Flask for my research project. It was quick to pick up and honestly, I like a more barebones style - one of the reasons I use Sublime Text over IDEs. Plus Miguel Grinberg's tutorial is fantastic at getting you on your feet (though I'm still sour over changes compared to his original tutorial, more because its made it difficult to onboard new developers). However, Pyramid's made some of the coolest shi…

For once I thought, you're bluffing, and the shirts were of some Rock band, but it's indeed for the web framework "Pyramid" xD

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

#122
post #38
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…

I LOVE Web2py! I use it for pretty much all of my projects. It is the only Python framework that is super easy to use, has enough "batteries included" but not too much, super simple and super powerful templating, decent migrations, simple data access layer not complicated ORM, no import hell, implicit routing. Developer has a new effort underway that is a little more "pythonic": https://github.com/web2py/py4web

I'm a fan but found it a bit lacking in add ons for new stuff so am learning rails.

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

#123

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

They are probably not much better as frameworks than Rails or Phoenix but using Python allows you to import a lot of things from the Python ecosystem. (eg http://www.developintelligence.com/blog/python-ecosystem-201...)

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

#124
I started Python programming 8 or 9 years ago and went from bottle to flask to Falcon to Django to Sanic.

Django is incredible - I wish I'd started with it. It's truly the most useful framework I've ever used - a real workhorse for building applications.

Flask and bottle are minimalist and get the job done for focused tasks - for example I hacked together various web examples into an mjpeg server recently used Flask (based on Miguel Grinberg's webcam server). You can get a simple web site up and running in 3 minutes with bottle or Flask. I'd recommend against using them for anything bigger though - you'll just spend all your time reinventing Django (badly).

I use Sanic for asynchronous web servers.

Falcon is great to use to build APIs - it's raw and minimal and built to task.

Indeed in my latest project I use Django for the main web application, Flask for the mjpeg server and sanic as a long polling web server acting as a message queue server.

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

#126

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…

Maybe a semi-realistic example would help us understand what you mean by the path segment branch in tree of resources part? Is that like /api//// would boil down to /api/cars/ford/fusion/ with cars, ford, and fusion each being a branch in the tree?

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

#127

I started Python programming 8 or 9 years ago and went from bottle to flask to Falcon to Django to Sanic. Django is incredible - I wish I'd started with it. It's truly the most useful framework I've ever used - a real workhorse for building applications. Flask and bottle are minimalist and get the job done for focused tasks - for example I hacked together various web examples into an mjpeg server recently used Flask…

I have used Django a lot for applications where front-end is server generated HTML page with templates. For REST API or GraphQL minimalist framework like CherryPy, flask, bottle and others combined with excellent Python libraries will work great even for a large modular app.

It is not true when you recommend don't use flask or bottle for large apps. On the contrary it will be good for large projects to use minimalist framework as they will act more like library. Also you can write code yourself for the parts in the system which outgrow the framework. My team has built large production level application for machine learning service initially in Django and then later ported completely to flask. Given we don't use templates and jinja2 as most of the front-end is in SPA, flask has been wonderful to work with. Django rest framework doesn't work that well when you just need to work directly with request/responses. Blueprints made it so easy to write large modular code that choice between monolith and micro-service, just a configuration setting coupled with either gunicorn or uwsgi in emperor mode.

All Python framework under the hood are WSGI or ASGI, so a decent Python programmer can use excellent marshmallow, sqlalchemy, alembic, celery and flask (or others) with blueprints to write a performant large modular application and a service layer.

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

#128

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)..

Having extensive docs is a very good thing, much better than having a short readme and then rely on stack overflow to eventually fill in the gaping holes.

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

#129
post #44

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…

Any of those have good Swagger integration? https://swagger.io/

It is extremely easy to integrate Django (well, DRF) with Swagger: https://django-rest-swagger.readthedocs.io/en/latest/
Post reply on HN