Live data from Hacker News

Ask HN: What would you use for a Python REST API in 2022?

news.ycombinator.com

1–7 of 7 posts

Ask HN: What would you use for a Python REST API in 2022?

#1
I've heard a lot of good things about django-rest-framework.

However:

1. I've used SQLAlchemy in the past and I liked it, and I'm not sure how well it works with Django or if the Django ORM is as powerful. Though at the end of the day I just want a simple mapper and SQL query builder, not necessarily the super high level DSL.

2. How useful is the rest of Django when only the REST API parts are needed? Is it easy to disable the unneeded parts? Is it easy to completely remove them from the distribution (primarily for security concerns)

What would you recommend for an average Python dev team?

Some of the requirements:

1. authentication/authorization with support for IdPs.

2. paging.

3. built-in security features preventing various injections and web attacks.

I know about Flask but it seems like a more barebones solution that has a longer ramp-up time, in order to find the right libraries that go together and make them work well.

Re: Ask HN: What would you use for a Python REST API in 2022?

#4
If your contemplating the ecosystem then Django beats Flask, the framework has the rest of the parts you haven’t even contemplated needing yet. Django Rest Framework is awesome and worth investment in learning and potentially applying… however For all internal APIs I’ve abandoned RESt, even using Django and the Django ORM I no longer use REST for internal APIs, it’s gRPC for anything internal. The simplicity is a massive win, the performance is a fantastic windfall and the ability to just “lift and shift” any code in a supported language into a load balanced GRPC API is life changing.

Re: Ask HN: What would you use for a Python REST API in 2022?

#7
post #3

I'd recommend taking a look at AWS' serverless offerings - specifically API gateway and python lambda backend fxns. You get exactly what you need, nothing you don't and its extremely quick to get set up.

> python lambda backend fxns

What do you use for this?