[Fixed]-How i can get User id by student id?

1👍

Try this:

student = Student.objects.first()
# or this
student = Student.objects.get(id=34)
user_id = student.user.id
# or this
user_id = student.user_id

And i suggest you to read Django Tutorial which answers most of questions like this one.

Leave a comment