Rafał Safin

Results 20 comments of Rafał Safin
trafficstars

You can use `request.state` https://www.starlette.io/requests/ `request` is reserved parameter in FastAPI and accessible in every route. ```python from fastapi import FastAPI, Request, Response import time app = FastAPI() @app.middleware("http") async...

Sorry, it was obvious for me ;) You probably already have dependency (you mentioned it in first post), I would add the code there. ```python from fastapi import Depends ......

Unfortunately yup, I suppose it's kinda dead and tiangolo is obviously a busy man now. @mbnoimi There was the discussion about alternatives/templates based on this one in this issue https://github.com/tiangolo/full-stack-fastapi-postgresql/issues/422...

Hi @mbnoimi Hmm, are you using Python 3.10?? This syntax (`str | int`) requires it. Template was written with python 3.10 in mind. And by the way it has sort...

Waited like 1-2years for this new sytax to work, really cool stuff But unfortunately template doesn't have something like backward compatible types based on `typing` module since it has not...

I believe it is working just fine with 404 Not Found in response, please double check this piece of code. Request (-v for verbose) ```bash curl -v 'http://localhost:8000/items?item_id=123' -H 'accept:...

Hi, it's directly `localhost:8000`. You can change that behaviour in `main.py` using `docs_url`, I belive default one in FastAPI is `/docs` if I remember correctly, this is just my opinionated...

@smolendawid Umm that's another thing if you dont mind. It's because threre is trusted host middleware from fastapi, it's to prevent host header attacks and by you control it like...

Anyway I think your concerns are quite correct, I will try to update README a bit with maybe extra libraries upgrade, didn't find anything about this topic in current README...

Added `127.0.0.1` to .env and mentioned it in docs, sorry about that, im used to write **localhost** like an automat