Playing around with #FastAPI for streamed responses from ChatCompletions API. Swagger doesn't understand jsonlines natively, but the default display works pretty well!
Spreading the good vibes at the Sentry + FastAPI Berlin Meetup by @getsentry with the incredible trio: @marcelotryle, @samuelcolvin, and @hasanramezani! 💫✨
Learning, connecting, and having fun together as a team.
#Meetup #Pydantic #Sentry #FastAPI #OpenSource #GoodVibesOnly" 📸🤝😄
#meetup #pydantic #sentry #fastapi #opensource #goodvibesonly
👎 An insecure direct object reference (#IDOR) is a security vulnerability that occurs when a system’s implementation allows attackers to directly access & manipulate sensitive objects or resources without authorization checks.
Learn more about handling these vulnerabilities, including:
1️⃣ Types of IDOR
2️⃣ Creating a #Python application with IDOR using #FastAPI
3️⃣ Identifying and fixing IDOR vulnerabilities
Read the full blog here: https://snyk.co/ufXcj
Learned about attaching debuggers to running processes early on, but understood its real value when dealing with a project's tangled startup scripts.
🔗 Read about it here:
Ever encountered a similar situation? Let's chat!
#tdd #fastapi #python #softwareengineering #codingtips
👎 An insecure direct object reference (#IDOR) is a security vulnerability that occurs when a system’s implementation allows attackers to directly access & manipulate sensitive objects or resources without authorization checks.
Learn more about handling these vulnerabilities, including:
1️⃣ Types of IDOR
2️⃣ Creating a #Python application with IDOR using #FastAPI
3️⃣ Identifying and fixing IDOR vulnerabilities
Read the full blog here: https://snyk.co/ufXci
FastAPIを使ってストリーム対応のLLM API RESTサーバを作る on Databricks
https://qiita.com/isanakamishiro2/items/c55123343e95fd2769a6?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items
#qiita #Databricks #FastAPI #langchain #LLM #CTranslate2
#qiita #databricks #fastapi #langchain #llm #ctranslate2
Today's Python hot take: FastAPI is one of those sarcastic names, like Greenland (which isn't very green). The devs' claims of it being fast is some kind of joke. Because it's not actually very fast at all. A replacement package that's actually fast is Litestar, which also seems generally more wholesome.
@toledano probé #FastAPI para un proyecto hace tiempo. No quedé encantado la verdad. A la fecha no tiene documentación de su #API y esto quiere decir que si quieres hacer algo que no cubre alguno de los tutoriales tienes que leer su código fuente.
Además está construido sobre la (falsa) premisa de que hay que reescribir todas las bibliotecas python usando #async
Ya teníamos async en python mucho antes de que la sintaxis entrara al lenguaje via #eventlet #greenlet y familia.
#fastapi #api #async #eventlet #greenlet
After extensive #debugging I found out, why I was not receiving callback request to my #fastapi app: The callback requests were captured first by the complete stack running in #docker which I forgot to shut down.... happy to still be sane :)
Estoy revisando la documentación de #FastAPI porque ¿qué mejor plan hay una noche de viernes en agosto que ponerme a estudiar documentación técnica? Así es mi vida: emociones fuertes y desenfreno 24/7 :blobcatgooglybongo:
El caso es que en prácticamente todos los ejemplos usan canciones de los #FooFighters y sólo con eso ya me tienen ganado.
Además el framework no tiene mala pinta. Está a medio camino entre #Django y #Flask. Tendré que hacerme algún proyectillo a ver cómo se compara con éstos.
#fastapi #foofighters #django #flask
So here's another pretty solid resource explicitly stating that WSGI URL routing treating %2F like / is unexpected.
Source: https://www.w3.org/Addressing/URL/4_URI_Recommentations.html
#framework #web #flask #fastapi #wsgi #Python
Many #python #web #frameworks urldecode the url before doing url based routing. So they can't distinguish these URLs:
/users/tom/edit
/users/tom%2Fedit
I'm baffled. Does anyone have a quick reference describing why this is wrong? And as in this discussion, why a HTTP reverse proxy that unescapes URL-encodings before forwarding the request would be breaking all sorts of things, even though it is technically possible?
#python #web #framework #starlette #fastapi #flask
https://github.com/encode/starlette/pull/1828#issuecomment-1466793664
#flask #fastapi #Starlette #framework #frameworks #web #Python
@pamelafox I wrote "coroutine" 469 times in Fluent Python Second Edition.
The main chapter about asynchronous programming is framework-agnostic.
The examples use #asyncio, #FastAPI, and #curio, to show that `async/await` are not tied to a specific runtime event loop or library.
https://www.oreilly.com/library/view/fluent-python-2nd/9781492056348/
In general:
https://softwareengineering.stackexchange.com/questions/148108/why-is-global-state-so-evil#148109
In particular:
When running tests, you'd want to pass a connection created in a fixture so that each test is wrapped in a transaction that rolls back after each test. In your case, you'd need to monkey patch the global internal connection cache, which is implicit, error-prone, not thread-safe, and makes refactoring hard. A better option is if you can pass connection in the code you test explicitly or use dependency injection like the one #fastapi has.
A new post, about building modern FastAPI Microservices.
FastAPI is a good choice for developing Python APIs. It’s modern and easy to learn. When I think about it, I could say the same thing about Polylith. In the article, I describe how to combine the two for a nice developer experience.
https://davidvujic.blogspot.com/2023/07/python-fastapi-microservices-with-polylith.html
#microservices #python #polylith #fastapi
Na pira por mais uma aula ao vivo no excelente curso #PythonWebAPI da #LinuxTips ministrado pelo fantástico @rochacbruno e #VamosQueVamos #Python #fastAPI #API #AprenderSempre
#pythonwebapi #linuxtips #vamosquevamos #python #fastapi #api #aprendersempre
Alguém aqui tb sente que a parte mais complexa ao se pensar um sistema, por mais simples que ele seja, é a modelagem de dados?? Surra dessas normalizações! #Python #PostgreSQL #SQLModel #fastAPI
#python #postgresql #sqlmodel #fastapi