Skip to content

Instantly share code, notes, and snippets.

@vinyll
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinyll/9136230 to your computer and use it in GitHub Desktop.
Save vinyll/9136230 to your computer and use it in GitHub Desktop.
from django.contrib.auth.models import User
username = "me"
user = User.objects.get_or_create(username=username)[0]
user.email = username+"@mozilla.com"
user.set_password(user.email)
user.is_verified = True
user.is_staff = True
user.is_superuser = True
user.userprofile_set.get_or_create(email=user.email,)
profile = user.get_profile()
profile.set_password(user.email)
user.save()
profile.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment