[Answer]-User session object is not available on POST in django?

0👍

The user is never in request.session. It’s directly on the request object as request.user.

1👍

Your view gets the request object so it has the “user” attribute, as such => request.user

if your problem is getting this user object while in the form you can override the save method of the form so it gets a user object and do whatever you need there with it.

def save(self, user):
     # do something with user

and when calling the method:

form.save(request.user)

Leave a comment