Creating the superuser for Django
Now, we will run the necessary command to create the superuser for Django that will allow us to authenticate our requests. We will create other users later.
Make sure you are in the restful01 folder that includes the manage.py file in the activated virtual environment. Execute the following command that executes the createsuperuser subcommand for the manage.py script to allow us to create the superuser:
python manage.py createsuperuserThe command will ask you for the username you want to use for the superuser. Enter the desired username and press Enter. We will use djangosuper as the username for this example. You will see a line similar to the following one:
Username (leave blank to use 'gaston'):Then, the command will ask you for the email address. Enter an email address and press Enter. You can enter djangosuper@example.com:
Email address:Finally, the command will ask you for the password for the new superuser. Enter your desired password and press Enter...