Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the email address from auth_user table of requested user id in django 1.5?

I tried following line

appraiser_email = auth_user.objects.get(id__exact=2)

when i am executing above line it is saying

global name 'auth_user' is not defined

do i want to define a model auth_user in models.py or is there any other way?

thanks in advance

like image 949
Ramakrishna Avatar asked Dec 05 '13 13:12

Ramakrishna


1 Answers

from django.contrib.auth.models import User

user = User.objects.get(id=2)
user_email = user.email
like image 102
H H H Avatar answered Oct 11 '22 17:10

H H H