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
from django.contrib.auth.models import User
user = User.objects.get(id=2)
user_email = user.email
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With