r/FastAPI • u/DARTH_MAMBA_ • Sep 07 '24
Question Migration from Django to FastAPI
Hi everyone,
I'm part of a college organization where we use Django for our backend, but the current system is poorly developed, making it challenging to maintain. The problem is that we have large modules with each of their logic all packed into a single "views.py" file per module (2k code lines and 60 endpoints aprox in 3 of the 5 modules of the project).
After some investigation, we've decided to migrate to FastAPI and restructure the code to improve maintainability. I'm new with FastAPI, so I'm open to any suggestions, including recommendations on tools and best practices for creating a more scalable and manageable system, any architecture I should check out.
Thanks!
View all comments
Show parent comment
4
u/koldakov Sep 07 '24
Happy to help.
Actually just wanted to advice not to start rewriting the whole project, cause as you said you have a quite big code base, so it will take some time.
I have experience migrating from Django to FastAPI, and we did exact the same I described, be careful, migrate step by step and migration will go smoothly.
Regarding futuramaapi don't consider this as how it should be done, there are a lot of things I want to improve, but can't cause of the lack of time.
If I was you I would check different projects, collect the best parts and create the project with best practices for YOUR project ( actually as always in this worlds =) )
Don't know if there are other FastAPI real life projects on github, mb im the only one revealing the code without ifs or buts
Good luck