db: Depends(get_db_session)
leads to TypeError (issubclass() arg 1 must be a class
)
#7664
Unanswered
mymindwentblvnk
asked this question in
Questions
Replies: 2 comments
-
Oh my god. I hassle for some weeks with this error and now I see it at a glance: Using the right syntax with changing Thanks for your patience. And thanks for FastAPI :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Great! Thanks for reporting back and closing issue 👍 🚀 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Dear @tiangolo,
the following thing drives me nuts. I started to develop my first FastAPI based REST API and there is something which I cannot solve since some time.
I implemented user authentication based on your tutorial and I get the following error:
This happens only when
get_current_user
has the following signature.If I do not inject
db
viaDepends()
, everything is fine. But for working with a real database I assume to inject the Session object intoget_current_user
. Am I wrong here?To see the whole code, have a look below.
If you uncomment line 111 and comment 112 (definition of
get_current_user
), everything works fine.Beta Was this translation helpful? Give feedback.
All reactions