Flask and FastAPI together, at last!

dynamic-python-developer
The Pythoneers
Published in
3 min readMar 22, 2021

--

This is the story of how the same framework, “Dynamic Pluggable Microservice Framework Lite”, was developed for both Flask and FastAPI at the same time with minimal code changes.

Photo by Alex Kondratiev on Unsplash

In the beginning, there was “flask”.

And now there is “fastAPI”.

I was able to develop the “Dynamic Pluggable Microservice Framework Lite” for Flask and then for kicks, because I mentioned this to someone I was interviewing with for a possible job, I ported the code to FastAPI but left all the original Flask code intact which means this framework can be deployed using gunicorn or uvicorn just by setting the correct environment variable for either. So now whenever I talk about microservices I can confidently say I have developed the same framework for Django, Flask, and FastAPI with the latter two sharing the same code.

The only rub for me, as a developer, was having to deal with the coroutine issues from FastAPI but I was able to get it done with minimal effort and I have not done any real coding with Python coroutines which means I had no real experience with this aspect of Python 3. I am sure I would never be hired to work with anything for which I could not prove prior experience, like this, and yet I was able to be 100% effective in getting this done. The odd thing for me is I am generally never hired to work with things that…

--

--

dynamic-python-developer
The Pythoneers

Dynamic Pluggable MicroService Framework v3.1 now in Production !!! (raychorn.github.io)