Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How is python manage.py createsuperuser useful?

Tags:

python

django

I am a new in Django. I have found this piece of code

python manage.py createsuperuser

How is this useful? In what kind of situation is it necessary?

like image 207
DanielTheRocketMan Avatar asked Jul 05 '26 17:07

DanielTheRocketMan


1 Answers

From the django-docs (emphasis mine):

This command is only available if Django’s authentication system (django.contrib.auth) is installed.

Creates a superuser account (a user who has all permissions). This is useful if you need to create an initial superuser account or if you need to programmatically generate superuser accounts for your site(s).

When run interactively, this command will prompt for a password for the new superuser account. When run non-interactively, no password will be set, and the superuser account will not be able to log in until a password has been manually set for it.

like image 160
Anshul Goyal Avatar answered Jul 07 '26 05:07

Anshul Goyal