Skip to content

Instantly share code, notes, and snippets.

@ekiara
Created October 14, 2019 16:14
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 ekiara/a17d014d951bc31b714179e6cc6432b4 to your computer and use it in GitHub Desktop.
Save ekiara/a17d014d951bc31b714179e6cc6432b4 to your computer and use it in GitHub Desktop.
make-django-user-a-superuser-in-shell
# To make a user a superuser in Django via the shell
from django.contrib.auth.models import User
user = User.objects.filter(username="the_username").first()
user.is_staff = True
user.is_superuser = True
user.save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment