How to remove superuser from Django Project

Open Terminal(Ctrl+Alt+T).
Browse to your project source directory(where '' exists):
$ cd project

Note: Replace 'project' with your directory name.

Now execute these commands:
$ python shell

Then the interactive python shell with django powers will appear. Then type in:
$ from django.contrib.auth.models import User
$ User.objects.get(username="NameHere", is_superuser=True).delete()

You should replace the name of the superuser you created with NameHere in the last command.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this:
search previous next tag category expand menu location phone mail time cart zoom edit close