After a bit of playing with #FastAPI, I feel like it's really, well, API-oriented. You can have templating of course, but it's just a liiiittle clumsier than returning JSON (e. g., you need to manually inject the request into it).
So I'm not entirely sure if I should stick to my original plan of mostly rendering HTML and using #htmx, or if I should go with the framework flow and make a #Vue app. Probably the latter TBH.
#Starlette (and thus #FastAPI) does self.render() in Response.init() to populate self.body, meaning that for example a JSONResponse will always instantly render its JSON to bytes as soon as it's constructed, not lazily when it's actually about to be sent.
This becomes a bit of an issue when you'd like to modify the original data in a middleware, because you basically have to re-parse the bytes into a Python object, then render them again.
There's also no way to access the original object.
It is literally one (1) day after having set up dual-boot Linux on the laptop that ran Windows for years, and now the other laptop, that has been my Linux machine for months, does no longer react to its Control key being pressed (and yes, it has only one).
Why does always something have to break?
I've also found out that apparently I have to decide between either being able to share my screen under Sway or have audio without stuttering.
Also, #FastAPI / #Starlette middleware should totally have a way to get a reference to the function that handled the request. Make it a property on the Response object.
(Yes, I will open an issue about that and maybe even write a PR, but not tonight. Tonight there's only energy for tootin'.)
Apparently, in python web ecosystem, /foo/bar and /foo%2Fbar are interpreted the same (but not /foo?bar and /foo%3Fbar at least) 🤦 #Python#FastAPI#flask#django
So many fun things to learn. Obviously working with audio data, speech to text, but also LLMs from AssemblyAI, #FastAPI, Beanie, #MongoDB, #HTMX, #Python, and plenty more. cc @mkennedy
Our next event is a sprint at SparkUp Sat 13.4. 12-16 and the theme is web development with Python using Django, Flask or FastAPI.
Our sprints are hands-on programming events where we gather together to learn about a given theme. Collaborating with others, asking questions and helping each other find the answers is at the heart of these events.
For anyone using FastAPI or python-multipart, you may want to upgrade the version of python-multipart to >= 0.0.7 or FastAPI >= 0.109.1 (which includes a bump of required version of python-multipart). This is to fix a regex denial-of-service vulnerability.
Planning to work on something comparing FastAPI and Django Ninja ⚡️🥷
Any questions you have you'd want to be covered? #PythonWeb#FastAPI#DjangoNinja#Django
I’ve made it easy to implement your own algorithm. It’s just a #python class with 2-3 methods, maybe some HTML jinja templates (if you want to change how it’s displayed)
I’ve also rewritten the UI to be #FastAPI and #htmx, which seems a lot more resource efficient than streamlit (although streamlit was great for prototyping).
Hey devs, I am working on a project that requires restricting a #fastapi API from public access, but data generated from API needs to be made available to clients. So, came up with this workflow, what do you all suggest?
Estic aprenent el protocol #Activitypub (com interaccionen els servidors a baix nivell).
Quina millor manera que aprendre´l programant el meu propi servidor escrit amb #Python amb l'excel·lent framework #FastAPI ?
L'he anomenat "appy, Activitypub Python server".
De moment ja federa, ja es pot seguir el seu únic usuari des de qualsevol servidor del #fedivers.
Em queda molt per aprendre i afegir al codi, moltíssim, però és molt divertit. 😀
Baixar al nivell del protocol és com sortir de Matrix