I am learning django and I am stuck with this problem.
How do I get the email address of all the users in Django. The user can be of any type like superuser, general user etc.
I tried the following but I am not getting email address of all the users.
user = User.objects.get(id=2)
user_email = user. Email
print(user_email)
I want something like a list of all the email addresses. Can someone please help me with it?