r/FastAPI • u/itsme2019asalways • Sep 17 '25
Question Which ORM do you use in FastAPI?
Which ORM do you usually use in Fastapi which gives you all the things you needed out of the box and just work great?
r/FastAPI • u/itsme2019asalways • Sep 17 '25
Which ORM do you usually use in Fastapi which gives you all the things you needed out of the box and just work great?
r/FastAPI • u/Responsible_You_9258 • Sep 16 '25
Hey im trying to deploy my FASTAPI application on render but im facing some issues. please let me know if you can help out and we can discuss this further. Thanks :)
r/FastAPI • u/PracticalAttempt2213 • Sep 15 '25
You might be surprised, but we finally support SQLite databases in our interactive lessons, right in your browser!
First SQL Databases lesson is now live:
https://www.fastapiinteractive.com/fastapi-basics/33-sql-databases
Since my last update, we've got a lot more lessons and now we have 33 in total (~35 learning hours!)
A few more lessons are coming soon to complete the FastAPI Basics tutorial, after which I’ll start working on the Advanced series with more complex structures to explore.
I'm opened to hear more thoughts on the product and how to make the learning experience better!
Enjoy learning!
r/FastAPI • u/CardiologistNo5959 • Sep 15 '25
Found this library when trying to implement something similar to a django viewset, and found the approach really clean. Surprised it didn't have more upvotes.
https://github.com/asynq-io/fastapi-views
note: I'm not affiliated with the author, just thought it deserved more traction / don't want the project to die if they stop working on it.
r/FastAPI • u/shashstormer • Sep 15 '25
Hey everyone,
I built an async security library for FastAPI called AuthTuna to solve some problems I was facing with existing tools.
AuthTuna is an async-first security library for FastAPI. It's not just a set of helpers; it's a complete foundation for authentication, authorization, and session management. Out of the box, it gives you:
Organization -> Project -> Resource), which goes beyond simple roles.Depends and Pydantic models.This is built for Python developers using FastAPI to create production-grade applications. It's specifically useful for projects that need more complex, granular authorization logic, like multi-tenant SaaS platforms, internal dashboards, or any app where users have different levels of access to specific resources. It is not a toy project and is running in our own production environment.
I built this because I needed a specific combination of features that I couldn't find together in other libraries.
The code is up on GitHub, and feedback is welcome.
r/FastAPI • u/ChaconMoon • Sep 12 '25
Hi everyone!
Over the past month, I’ve been working on a South Park API as a personal project to learn more about FastAPI, Docker, and PostgreSQL. The project is still in its early stages (there’s a lot of data to process), but since this is my first API, I’d really appreciate any feedback to help me improve and keep progressing.
Here’s a quick overview:
Nonetype error or it fails to load, just refresh with F5 and it should work again.The GitHub repo is private for now since it’s still very early, but if anyone is interested I can make it public.
I plan to keep the API live for about a week. Once it’s no longer available, I’ll remove this post.
Thanks a lot for taking the time to check it out — any feedback is super welcome! 🙏
EDIT: I made the Github repo public: https://github.com/ChaconMoon/API-South-Park
r/FastAPI • u/fxj178 • Sep 11 '25
I want to read it on my kindle and wonder how can I save it as pdf. (https://fastapi.tiangolo.com/tutorial/)
r/FastAPI • u/felword • Sep 11 '25
To everyone who has already implemented their own auth with social sign-in (Google & Apple), how long did it take you.
Currently planning a new project and deciding between 100% custom and using fireauth. I need the social sign-in in my flutter apps.
r/FastAPI • u/Cherriedy • Sep 11 '25
I'm buiding endpoints with FastAPI, PostgreSQL as database, and the driver is asyncpg associated with SQLAlchemy for asynchronous. As mentioned in the title, I'm having trouble with async_sessionmaker, it keeps showing: 'async_sessionmaker' object does not support the asynchronous context manager protocol.
Here the part of code in repository:
class GenreRepositoryImpl(GenreRepository):
def __init__(self, sessionmaker: async_sessionmaker[AsyncSession]):
self._sessionmaker = sessionmaker
async def create(self, genre: Genre) -> Genre:
genre_entity = GenreEntityMappers.from_domain(genre)
async with self._sessionmaker() as session:
session.add(genre_entity)
await session.commit()
await session.refresh(genre_entity)
return GenreEntityMappers.to_domain(genre_entity)Somehow it works when I use it as transaction with begin(), I don't understand what's wrong.
r/FastAPI • u/somebodyElse221 • Sep 10 '25
Hey everyone!
After several months of development, we're excited to share FastKit, a complete admin panel built on FastAPI.
Tired of building user management, authentication, and core admin features from scratch on every project, we decided to create a robust, production-ready solution.
Our goal was to make a boilerplate project inspired by the best practices of the **Laravel** ecosystem, with a clean architecture and a focus on speed.
Here's what it provides out of the box:
We invite you to take a look at the code on GitHub. We would truly appreciate any feedback or contributions!
r/FastAPI • u/StreetMedium6827 • Sep 10 '25
Since one year, I was mastering my frontend skills, and as a result I developed my full-stack template inspired by official fastapi template but with some adjustments.
Backend: FastAPI, SQLAlchemy, Pydantic
Frontend: React, Material UI, Nginx
I have tested this template across my three commercial projects, as for now, it works well.
Online demo is available (see link in the repo below, http is not allowed on Reddit I guess).
In READMEs, I provide instructions, sources and some learning materials.
The template itself: https://github.com/konverner/full-stack-template
Feel free to ask questions or propose improvements.
r/FastAPI • u/webdev-dreamer • Sep 09 '25
Obligatory "i'm a noob" disclaimer...
Currently reading up on asyncio in Python, and I learned that awaiting a "coroutine" without wrapping it in a "task" would cause execution to be "synchronous" rather than "asynchronous". For example, in the Python docs, it states:
Unlike tasks, awaiting a coroutine does not hand control back to the event loop! Wrapping a coroutine in a task first, then awaiting that would cede control. The behavior of await coroutine is effectively the same as invoking a regular, synchronous Python function.
So what this tells me is that if I have multiple coroutines I am awaiting in a path handler function, I should wrap them in "task" and/or use "async.gather()" on them.
Is this correct? Or does it not matter? I saw this youtube video (5 min - Code Collider) that demonstrates code that isn't using "tasks" and yet it seems to be achieving asynchronous execution
I really haven't seen "create_task()" used much in the FastAPI tutorials I've skimmed through....so not sure if coroutines are just handled asynchronously in the background w/o the need to convert them into tasks?
Or am I misunderstanding something fundamental about python async?
Help! :(
r/FastAPI • u/Hamzayslmn • Sep 06 '25
r/FastAPI • u/david-vujic • Sep 06 '25
Here's a a tutorial about having a modern Microservice setup using FastAPI in a Monorepo, an article I wrote a while ago. The Monorepo is organized and managed with a thing called Polylith and you'll find more info about it in the linked tutorial.
You'll find info about the usage of a Monorepo and how well it fits with FastAPI and the Polylith Architecture when developing. Adding new services is a simple thing when working in a Polylith Monorepo, and the tooling is there for a really nice Developer Experience. Just like FastAPI has the nice Programming Experience.
The example in the article is using Poetry, but you can of course use your favorite Package & Dependency management tool such as uv, hatch, pixi and others. Polylith also encourages you to use the REPL, and the REPL Driven Development flow in particular.
Python FastAPI Microservices with Polylith article:
https://davidvujic.blogspot.com/2023/07/python-fastapi-microservices-with-polylith.html
r/FastAPI • u/PracticalAttempt2213 • Sep 05 '25
Hi everyone!
I just added 5 new interactive lessons on FastAPI Dependencies to FastAPIInteractive.com.
The lessons cover:
Everything runs in the browser, no setup needed. You can code, run, and test APIs right on the site.
Would love feedback from the community on how I can make these lessons better 🙏
r/FastAPI • u/itsme2019asalways • Sep 05 '25
Does anybody ever tried this
https://github.com/fastapi/full-stack-fastapi-template
If yes , then how was the experience with it. Please share your good and bad experiences as well.
r/FastAPI • u/Physical-Artist-6997 • Sep 04 '25
Hey folks,
I’m searching for a comprehensive, high-quality course in English that doesn’t just cover the basics of FastAPI or async/await, but really shows the transformation of microservices from development to production.
What I’d love to see in a course:
I’ve seen plenty of beginner tutorials on FastAPI or generic Kubernetes, but nothing that really connects async microservice development (with Uvicorn/Gunicorn workers) to the full story of production deployments in the cloud.
If you’ve taken a course similar to the one Im looking for or know a resource that matches this, please share your recommendations 🙏
Thanks in advance!
r/FastAPI • u/Detox-Boy • Sep 04 '25
As a backend developer, I was absolutely fed up with the tedious setup for every new project. The database configs, auth, background tasks, migrations, Docker, Makefiles... It's a total grind and it was killing my motivation to start new things.
So, I built something to fix it! I want to share Fastgen (aka fastapi-project-starter), my personal clutch for getting a production-ready FastAPI project up and running in a few seconds flat.
I made it with developers in mind, so you'll find all the good stuff already baked in:
docker-compose.This thing has been a massive time-saver for me, and I'm hoping it's just as clutch for you.
Check it out and let me know what you think!
https://pypi.org/project/fastapi-project-starter/
https://github.com/deveshshrestha20/FastAPI_Project_Starter

=====================UPDATE================
Automated post-deployment setup with interactive configuration

r/FastAPI • u/LordPeter_s • Sep 04 '25
Hey everyone,
A while back, I shared the first version of a library I was working on. After a lot of great feedback and more development, I'm back with a much more refined version of fastapi-query-builder.
My goal was to solve a problem I'm sure many of you have faced: your FastAPI routes get cluttered with repetitive logic for filtering, sorting, pagination, and searching SQLAlchemy models, especially across relationships.
To fix this, I designed a library that not only provides powerful query features but also encourages a clean, reusable architecture. The most unique part is its installation, inspired by shadcn/ui. You run query-builder init, and it copies the source code directly into your project. You own the code, so you can customize and extend it freely.
GitHub Repo: https://github.com/Pedroffda/fastapi-query-builder
The library is built around a three-layer pattern (UseCase, Service, Mapper) that integrates perfectly with FastAPI's dependency injection.
Here’s a quick example of setting up a Post model that has a relationship to a User.
First, the one-time setup:
# --- In your project, after running 'query-builder init' ---
# Import from your new local 'query_builder/' directory
from query_builder import BaseService, BaseMapper, BaseUseCase, get_dynamic_relations_map
from your_models import User, Post
from your_schemas import UserView, PostView
# 1. Define Mappers to convert DB models to Pydantic schemas
user_mapper = BaseMapper(model_class=User, view_class=UserView, ...)
post_mapper = BaseMapper(
model_class=Post, view_class=PostView,
relationship_map={'user': {'mapper': user_mapper.map_to_view, ...}}
)
# 2. Define the Service to handle all DB logic
post_service = BaseService(
model_class=Post,
relationship_map=get_dynamic_relations_map(Post),
searchable_fields=["title", "user.name"] # Search across relationships!
)
# 3. Define the UseCase to orchestrate everything
post_use_case = BaseUseCase(
service=post_service,
map_to_view=post_mapper.map_to_view,
map_list_to_view=post_mapper.map_list_to_view
)Now, look how clean your FastAPI endpoint becomes:
from query_builder import QueryBuilder
query_builder = QueryBuilder()
.get("/posts", response_model=...)
async def get_posts(
db: Session = Depends(get_db),
query_params: QueryParams = Depends(), # Captures all filter[...][...] params
# Your standard pagination and sorting params...
skip: int = Query(0),
limit: int = Query(100),
search: Optional[str] = Query(None),
sort_by: Optional[str] = Query(None),
select_fields: Optional[str] = Query(None, description="Ex: id,title,user.id,user.name")
):
filter_params = query_builder.parse_filters(query_params)
# Just call the use case. That's it.
return await post_use_case.get_all(
db=db,
filter_params=filter_params,
skip=skip, limit=limit, search=search, sort_by=sort_by,
select_fields=select_fields
)This single, clean endpoint now supports incredibly powerful queries out-of-the-box:
As FastAPI developers, what are your thoughts?
The library is on TestPyPI, and I'm looking to do a full release after incorporating feedback from the community that uses FastAPI every day.
TestPyPI Link: https://test.pypi.org/project/fastapi-query-builder/
Thanks for taking a look
r/FastAPI • u/itsme2019asalways • Sep 04 '25
Would you settle for FastAPI or Django in the long run as per a single framework for all your task or would django be it the one ?
What are your views because django(betteries included) has its own benifits and fastapi(simplicity) as its own and also some packages that give fastapi some batteries already that’s already being used in industry.
What are your thoughts on choosing one over other and will you settle down for one?
r/FastAPI • u/gkorland • Sep 04 '25
We're looking for a simple PaaS to deploy a stateless FastAPI app. We've tried a few platforms. We started with Vercel, which we really like, we've deployed many Next.js apps there, and the deployment is super simple. But it messes with the event loop, breaking our database connection pool. Then we tried Render, which worked without issues, but the response times and app restarts were super slow. Lastly, we switched to Azure App Service. It took us a while to configure it and set up the CI, but once it was running, we started experiencing freezes and disconnections.... Are there other recommended platforms? Should we try AWS App Runner?
r/FastAPI • u/rodrigoreyes79 • Sep 03 '25
Any recommendations? Thanks in advance.
r/FastAPI • u/Eastern_Jeweler_9709 • Sep 01 '25
Hi guys!
Recently during research I came across a library which provides filtering , sorting and search functionality for fastapi application.
Unfortunately I did not save it and now I am not able to find out which library was it.
As far as I remember it used `fastapi-pagniation` lib to provide pagination support.
It was not definitelyfastapi-filter lib.
Does anyone know which library this might be? I've looked at fastapi-sa-orm-filter, fastapi-listing, and sqlalchemy-filters but none of them seem to match exactly what I remember.
Any help would be greatly appreciated!
r/FastAPI • u/JeffTuche7 • Aug 25 '25
Hey everyone,
I’m working on a personal project with React on the frontend and a small FastAPI backend that already handles my frontend and has a basic role system (admin, user, etc.).
Now I’m wondering about authentication:
👉 What would you recommend as a secure, reliable, and easy-to-maintain solution?
I’ve been looking at BetterAuth, which looks modern and promising, but I’m not sure if it’s the best fit with FastAPI, or if I should go with something else (OAuth2, JWT, Auth0, etc.).
My goal is to have a setup where I can feel confident about security and functionality (persistent sessions, role management, smooth integration with the frontend).
I’d love to hear your experiences and advice! 🙏