0

I'm trying to add the email variable to an request in Django. I've tried

request.session['email'] = my_email

and

request.email = my_email

and none of them seem to work. How can this be done?

4
  • Those two do completely different things. What exactly are you trying to do? What do you mean when you say "none of them seem to work"? In what way do they not work? What happens? What doesn't happen that should? Commented Sep 26, 2014 at 9:55
  • I need to add the user email to the request.POST variable received on the server. Commented Sep 26, 2014 at 10:09
  • Why would you want to do that? The server already has access to the email, via request.user.email. Commented Sep 26, 2014 at 10:12
  • On my website I use allauth to user authentication.. The user passes the mail and password and allauth does the login and email verification. On the mobile app, I need to call allauth functions to get the job done. So, a.e., the Login WebService calls a function on the server that builds the request on the format that allauth needs to authenticate the user. Does it make sense now? Or am I over complicating it? Commented Sep 26, 2014 at 10:38

1 Answer 1

4

The set is correct, try getting the email with this :

request.session['email']
Sign up to request clarification or add additional context in comments.

1 Comment

And if i want to add one field to a submitted form throught POST.. is it possible? Or is it immutable?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.