Skip to content

Instantly share code, notes, and snippets.

@JanKoppe
Forked from Brachamul/command
Created April 5, 2018 11:01
Show Gist options
  • Save JanKoppe/eca78eba1346a934743cf692938d089b to your computer and use it in GitHub Desktop.
Save JanKoppe/eca78eba1346a934743cf692938d089b to your computer and use it in GitHub Desktop.
Set an existing user to superuser using Django shell
python manage.py shell
from django.contrib.auth.models import User
user = User.objects.get(username="myname")
user.is_staff = True
user.is_admin = True
user.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment