News for hackers. Stuff that matters.
Re:The Decline of Django by maxbond on Friday October 15, 2021 @09:19AM (#28877380)
I second FastAPI! In my mind it's, "Flask, but better." The killer feature in my mind is that it leverages type hinting and dataclasses, using Pydantic, to take away a lot of the grindyy, boilerplate parts of writing an API, like type checking, dependency injection, generating good error messages, generating API documentation, ...

Even when I'm not using FastAPI now, I use Pydantic everywhere. Types in Python, while not nearly as useful as in a strongly typed language, are a dream come true.

Re:The Decline of Django by prionassembly on Friday October 15, 2021 @09:32AM (#28877491)
Pydantic's BaseSettings has cured my configuration-DSL itch. You can type in (typed) defaults in Python and have them overidden by env vars.
Re:The Decline of Django by maxbond on Friday October 15, 2021 @09:46AM (#28877632)
And Docker secrets! It's also pretty easy to rig them up with YAML files! BaseSettings is amazing.

The only gripe I have with Pydantic is that sometimes it has really opinionated type coercion that can get you in trouble sometimes. For instance, `Union[int, float]` will accept either an int or a float, sure, but it will always output an int. This isn't difficult to fix but may only realize it after having shot yourself in the foot.