Hey everyone! I'm starting a new backend for a mid-sized project which will involve a real-time dashboard and standard CRUD APIs. I have experience with Django REST Framework (DRF) in production, but I'm curious to explore FastAPI for this project, especially regarding its performance and support for asynchronous programming. What do you all think?
5 Answers
If you're leaning towards Django, consider using Django Ninja for asynchronous endpoints. It combines the Django ORM and offers a lightweight experience without the complexity of DRF for your needs.
Django handles async quite decently with added components. But if maximum performance and async capabilities are what you need, definitely look into FastAPI or even Litestar, especially for ease of integration with SQLAlchemy. Just consider whether your project really needs the async features!
You really can’t go wrong with either option you choose. Just pick what feels right for you! If async support is a priority, FastAPI is the way to go. But if you want a more opinionated structure, Django has great capabilities for that as well.
Honestly, both FastAPI and Django Ninja are solid choices. If complexity isn’t necessary for your project, Django Ninja allows a smoother transition from Django while still providing a Pydantic-like experience for data validation. Plus, using tools like Swagger UI is a plus for testing your APIs!
FastAPI might seem great, but remember it can require a good understanding of scalable code, which can add complexity, especially with SQLAlchemy. Django allows you to focus more on your models and relationships up front, which can be beneficial in the long run.
Related Questions
How To: Running Codex CLI on Windows with Azure OpenAI
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically