django users groups permissions code example
Example 1: login system in django
LOGOUT_REDIRECT_URL = 'your_url'
Example 2: django add user to group
from django.contrib.auth.models import Group, User
tonystark=User.objects.get(id=pk)
hulk=Group.objects.get(name='groupname')
hulk.user_set.add(tonystark)