How to remove superuser from Django Project

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

Note: Replace 'project' with your directory name.

Now execute these commands:
$ python manage.py 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.
Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s