When you ran django-admin startproject mysite
in Chapter 1, Introduction to Django and Getting Started, Django created and configured the default admin site for you. All that you need to do is create an admin user (superuser) and then you can log into the admin site.
Note
If you are using Visual Studio, you don't need to complete this next step at the command line, you can just add a superuser from the Project menu tab within Visual Studio.
To create an admin user, run the following command:
python manage.py createsuperuser
Enter your desired username and press enter.
Username: admin
You will then be prompted for your desired email address:
Email address: [email protected]
The final step is to enter your password. You will be asked to enter your password twice, the second time as a confirmation of the first.
Password: ********** Password (again): ********* Superuser created successfully.