I'm using django-rest-framework-jwt in my project. I would like to get user_id from the request object in a view.
I've tried request.user
but it returns AnonymousUser.
request.user.user_id
You're just missing the .user_id part of your model user id. You almost had it. Congrats :)