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

10,775
from django.contrib.auth.models import User

user = User.objects.get(id=2)
user_email = user.email
Share:
10,775

Related videos on Youtube

Ramakrishna
Author by

Ramakrishna

I am a full stack developer with 5.5 years of experience. Currently working as a senior software engineer in CGI, Hyderabad, India. Skill set: Python, Kafka, Spark, Hadoop, Hive, MachineLearning, PHP, Javascript, Jquery Project Experience Python Kafka applications to produce and consume data Python Impala/Hive applications to execute queries Python spark applications for ETL process, data profiling, Report ready data, apply business rules and store the data at each layer like inbound, outbound, Corporate warehouse Python Machine learning applications to classify the data Web applications on Django/PHP(Laravel) along with Javascript

Updated on September 14, 2022

Comments

  • Ramakrishna
    Ramakrishna over 1 year

    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