How do you create a superuser in Django?

How do you create a superuser in Django?

a) By adding a user manually in the admin interface
b) By editing the database directly
c) By running the command python manage.py createsuperuser
d) By editing the settings.py file

Answer:

c) By running the command python manage.py createsuperuser

Explanation:

To create a superuser with administrative access to the Django admin panel, you run the python manage.py createsuperuser command.

Reference:

Django Quiz – MCQ Questions and Answers

Scroll to Top