Guest User

Untitled

a guest
Oct 19th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. from django.contrib.auth.models import User
  2. u, created = User.objects.get_or_create(username='admin')
  3. print dir(u.__class__)
  4. if created:
  5. u.set_password('password')
  6. u.is_superuser = True
  7. u.is_staff = True
  8. u.save()
Add Comment
Please, Sign In to add comment