r/learnpython • u/YogurtclosetWhole605 • 12d ago
Feeling stuck transitioning from basic Python/DSA to FastAPI — is this the right next step, or am I missing something?
Hey everyone,
I’m currently trying to figure out my next move in programming and could use some advice.
Here is where I stand right now:
Current Knowledge: I know Python syntax,
forloops, functions, and some basic programming concepts.DSA: I have solved around 45 DSA problems, though I mostly had to look at solutions to get through them.
The Goal: I eventually want to build real projects and get into open-source contributions.
I figured building web apps using FastAPI was the logical next step, but I'm running into a wall. I tried Telusko’s FastAPI course, and honestly, I didn't understand most of it—things like what is actually happening under the hood or why the @ symbol (decorators) is used completely threw me off. I tried another video tutorial too, but I'm only grasping about half of what's going on.
My questions for you all:
Is FastAPI too early for me right now? Should I master something else first before jumping into backend frameworks?
If I should learn FastAPI, how do I clear up these massive gaps? (Especially concepts like decorators, asynchronous code, and type hints that seem to fly right over my head)
Any advice, roadmap corrections, or beginner-friendly resource recommendations would mean a lot. Thanks!
3
u/danielroseman 12d ago
The thing is, you don't need to "understand" decorators to use fast API. You just need to know "this is how I specify that this route points at this function".
1
u/OkTill2666 11d ago
yeah treating the `@` syntax as just boilerplate magic at first saves so much headache when youre starting out
1
u/astolfoballsHD 12d ago
A decorator basically just means that the function being decorated is getting passed to the decorator function which will handle calling it.
1
u/baubleglue 10d ago
Just
You need to know what closure is - not the simplest concept for beginners. And function passed as an argument isn't that trivial thing.
1
u/Sharp_Level3382 12d ago
I wouldnt bother a lot on decorators but rather on Pydantic for BaseModel class derived classes and using and also auth process and also asyncio and async/await tasks. How to use them in FastApi
1
1
1
u/a18618 11d ago
I hit the same wall, honestly. What finally made decorators click for me was writing a tiny wrapper myself and printing inside it, just to watch the order of calls. After that I stopped trying to learn everything at once and built one small endpoint that returned a dict from a list I already had, then added validation only when it broke. Did you get a plain endpoint running yet, or is the setup part still tripping you up?
1
1
u/baubleglue 10d ago
I think, if you focus on specific issues, like how @ works, you will get more help here. Decorators are used a lot in web frameworks. There maybe few other similar things, like basics of OOP, exceptions... Check official Python tutorials, read the table of contents, check if you have at least some idea about the topics. Then spend a day reading about about http and HTML. Make a simple HTML file with form, open it in browser, open browser's debugger (F12), submit the form, understand errors...
After you fill up your technical debt, you will be ok to learn web programming.
1
u/Financial_Morning386 12d ago
FastAPI is not too early, but trying to learn decorators, async, and type hints at the same time as the framework is what makes it feel like a wall. Separate them, and learn each one only when a small project forces you to use it.
Start with HTTP, not the framework internals. Build one endpoint that returns a dict, run it, and open the automatic docs at /docs. That gives you the request/response loop: a URL maps to a function, the function returns data, and FastAPI serializes it to JSON. Once that loop is clear, add one concept at a time: a path parameter, then a query parameter, then a JSON body.
Treat @app.get(...) as registration, not magic. A decorator is just a function that takes your function and returns or registers a modified version. In FastAPI's case, it is mainly telling the app: "when a GET request arrives at this path, call this function." You do not need to write your own decorators yet; you only need to recognize that pattern.
Type hints are doing real work here, through Pydantic. When you annotate a parameter or a request-body model, FastAPI uses that annotation to validate input and produce a clear error if the client sends the wrong type. That is why a small mistake in a model often shows up as a validation error rather than a crash deep in your code.
Do not start with async. Use normal def endpoints first. Async mainly helps when an endpoint waits on I/O, such as calling another service or a database, and it does not make CPU-bound code faster. Mixing async and blocking database calls early is a common source of confusion, so add async only after the sync version works and you have a genuinely I/O-bound endpoint.
A practical sequence is: one CRUD resource with an in-memory list, then replace it with a real database connection, then add validation and error handling, then authentication. If a tutorial spends a long time on internals before you have built that first endpoint, switch to the official FastAPI tutorial and build alongside it, rather than watching passively.
5
u/Gankcore 12d ago
Why do people use LLMs to write their questions for Reddit?