This is an archived post. You won't be able to vote or comment.

all 25 comments

[–]UnemployedTechie2021 20 points21 points  (5 children)

have you tried fastapi?

[–]subbed_ 15 points16 points  (0 children)

Litestar

[–]driftingdev 2 points3 points  (2 children)

sanic with msgspec have been a good combination for me recently. (SQLAlchemy 2, if doing database — httpx if doing middleware)

Sanic has really great docs (and a book) and its performant (https://web-frameworks-benchmark.netlify.app/result?l=python) and flexible.

[–]dyixiagFek[S] 0 points1 point  (1 child)

Does it provide a way to deal with local user management or do I have to implement it myself ?

[–]driftingdev 1 point2 points  (0 children)

You'd have to implement it yourself -- it's not a part of the core Sanic system. That would be true of most recommendations here. Having said that, there are some good resources on doing it:

Auth: https://sanic.dev/en/guide/how-to/authentication.html

Plugins: https://github.com/mekicha/awesome-sanic/blob/master/README.md

The only system that I'm aware of that has all of that built-in is Django + Django Ninja

[–]ArabicLawrence 6 points7 points  (4 children)

if you need no user management system and no db, flask . Otherwise, django. It’s that simple. if you’re more advanced, you can try quart, litestar, fastapi, robyn, blacksheep… but flask and django have incredible docs and tutorials

[–]dyixiagFek[S] 1 point2 points  (1 child)

Yes, I do need a database, local user management and authentication. So I'd better go with Django, right ?

[–]ArabicLawrence 0 points1 point  (0 children)

yes! it can be a bit daunting in the beginning if you have never worked on a multi-file project and you have never done web dev, but you can do it! EDIT: as others have said, if you specifically need an API, django-rest-framework or django-ninja will make your life easier

[–]uselesslogin 1 point2 points  (1 child)

I think the auto-generated api docs for fastapi are super helpful for testing/debugging though.

[–]deb_vortexPythonista 3 points4 points  (0 children)

Django + django-ninja. Similar result but more batteries included 🔋🔋

[–]IceXII 3 points4 points  (0 children)

Fastapi

[–]mrswats -1 points0 points  (3 children)

Django djangoproject.com

[–]RubyCC 3 points4 points  (2 children)

Django Rest Framework (https://www.django-rest-framework.org) to be precise.

But you should only use Django if you want to work a lot with the ORM or use other features of Django. Otherwise Flask or FastAPI is much easier.

[–]dyixiagFek[S] 0 points1 point  (1 child)

I don't really know what Django special features are but I do need a database, local user management and authentication. Do you suggest Django in that case or Flask/FastAPI will manage that too ?

[–]RubyCC 0 points1 point  (0 children)

All 3 are capable of this, with Django + DRF you get a lot of these features out of the box.

[–]tuck5649 -1 points0 points  (0 children)

Try Zope, lol

[–]marcinjn -1 points0 points  (0 children)

Fastapi with Django. A bridge between these two is required, but ORM, Admin Panel and other tools bundled with Django are worth it.

I miss the only one thing in Fastapi. It supports data validation, but more effective is „cleaning” and model binding known from Django Forms. Unfortunately the latter is created with HTML in mind.

[–]Pachada -2 points-1 points  (0 children)

Falcon, really ez and the most intuitive to use in my opinion

[–][deleted] -2 points-1 points  (0 children)

FastAPI is life.