In Django, how do I check if a user is in a certain group?
User.objects.filter(username='tom', groups__name='admin').exists()
That query will inform you user : "tom" whether belong to group "admin " or not
I created a custom group in Django's admin site.
In my code, I want to check if a user is in this group. How do I do that?