Live data from Hacker News

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

stxnext.com

71–80 of 168 posts

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

#71

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…

From what I remember from my research and readings, asyncio based python web servers are _not_ automatically faster than non-asyncio python web servers.

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

#72

This is a great resource, and there are some neat inclusions like Falcon, but I find the main trouble when building python web apps is deployment. I always feel like I've duct-taped my carefully written app to the web-server.

Where have you deployed? I'm looking to switch for my Django website. I'd like something full-serve like Heroku, but Heroku doesn't work well with sqlite.

Depending on what you need and your traffic, a simple $5 Digital Ocean droplet with a nginx reverse proxy in front of Django would do the trick. It'd still let you run sqlite, but Django's pretty powerful when you give it postgres (which you could also run in the droplet).

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

#73
post #12

I started working with Python around 2013 and I still consider Django the best framework to use. Yes Flask you can pick what you want to use but I have found the supporting libraries to be a bit outdated. Everytime I have used it I feel like I am just gluing together a lot of different pieces and it becomes messy. Django is constantly updated and I have little to no worries about security issues. Edit: And I have bee…

We have a legacy Django app at work. Coming from Rails and living in the npm eco-system for the past few years, Django to me seems like an anti-pattern framework in a death-spiral.

[deleted]

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

#74
post #12

I started working with Python around 2013 and I still consider Django the best framework to use. Yes Flask you can pick what you want to use but I have found the supporting libraries to be a bit outdated. Everytime I have used it I feel like I am just gluing together a lot of different pieces and it becomes messy. Django is constantly updated and I have little to no worries about security issues. Edit: And I have bee…

We have a legacy Django app at work. Coming from Rails and living in the npm eco-system for the past few years, Django to me seems like an anti-pattern framework in a death-spiral.

Would you mind sharing reasons why you think that?

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

#75

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?

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

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

#76
post #20

Earlier quoted context omitted.

It's also a myth that Django makes it difficult to pick and choose. For example, this article fails to mention that Django includes support for alternative template engines, including the popular Jinja2. Of course, if you choose not to use a feature like the ORM, you won't get any of the benefits of that feature- but Django doesn't get in your way or make it difficult in any way to do so. You can use as many differen…

Everything you wrote is true, however I think using another ORM in Django is asking for trouble, or at least it's missing a lot of the benefit of Django. The way models work with admin, forms, etc is to me what makes Django so efficient. Also, you don't get much by switching Django templates to Jinja.

> Also, you don't get much by switching Django templates to Jinja.

Well, you gain a lot of performance - as much as 10x depending on the complexity of your template. Also, Jinja is a lot less crippled than Django Templates (for example, you can't call a function/method with parameters in Django Templates).

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

#77

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.

I still think WSGI is the main reason for so many frameworks in Python. So probably it will be nice to divide framework or libraries in WSGI and ASGI.

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

#78

Earlier quoted context omitted.

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 an…

I traditionally like using the libraries not the Flask integrations (as in your sqlalchemy example) however I do find myself using Flask Admin and Flask-WTForms, since while they do have downsides and you have to commit to using them, they do a lot for you. I haven't checked out CherryPy, I should next hobby project. Gunicorn is awesome, uWSGI is also good and feels more "production" to me.

My problem with those additional projects are that I am dependent on one another layer of abstraction and not sure if the team is able to continue to develop it if core developers abandon it. Thats the reason I prefer using libraries, which if not supported can be supported by my team or replaced if necessary.

We use Flask mostly for REST API, so flask-admin and WTForms do not add that much value as all those are done on client side SPA (I do not like SPA, but it makes job easier as same API is leveraged for integration and mobile app).

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

#79

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…

This looks ridiculously like PHP back in what, 2011ish? Kohana, Cake, Zend, etc etc etc. Ultimately they all collapsed into Laravel or Zend.

Well if you will notice all this framework are abstraction over WSGI or ASGI (these are standards in Python Language interface for web programming). So the situation is not same as PHP.

Moreover if you look at the framework code of many of them you can replace them easily, for example Flask and bottle.py can be completely replaced by your own code if your service or app grows the intended performance. The lowest common denominator in both is WSGI.

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

#80

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…

Django is a pretty big omission from your list.

Especially considering Django powers Instagram and Pinterest's backends.

At some point, Python's creator Guido van Rossum also said "My personal favorite -- and I expect that that will remain a personal favorite for a long time -- is something named Django. ... I highly recommend it."

Personally, I use Django with REST Framework (https://www.django-rest-framework.org). I've enjoyed using it tremendously for the past few years.

One important feature Django lacks right now is asyncio support. There are plans to add it though (https://groups.google.com/forum/#!topic/django-developers/Kw...). Hopefully that happens soon.

Post reply on HN