Add

1
2
3
4
5
6
from django.contrib.auth.models import Group, User

new_user = User(username="foo", password="bar")

example_group = Group.objects.get(name="<GROUP_NAME>")
example_group.user_set.add(new_user)

More like this

  1. create or update, then get, model instances from JSON/py dict by anentropic 1 year, 6 months ago
  2. is_dirty and dict of changed values by jaredthane 3 years, 10 months ago
  3. group_required decorator by msanders 3 years, 9 months ago
  4. More information about users and groups in user admin by ramusus 3 years, 10 months ago
  5. Technical 500 by group membership by jdunck 3 years, 9 months ago

Comments

(Forgotten your password?)