I tried following Code with the help of the django.contrib.auth.User and django.contrib.auth.Group
for g in request.user.groups
user.groups.all()[0].name == "groupname"