Django contrib admin default admin and password
This may be a silly question. I start a new Django project as Document says, which only included an admin page. I start the server and use a web browser accessing the page. What can I enter in the username and password? Is their any place for me to config the default admin account?
You can config using following command line in shell
python manage.py createsuperuser
Basically you're creating superuser who can access the django admin panel.
First you need to run migrate to change the admin username and password. Run
python manage.py migrate
Then edit the username and password using
python manage.py createsuperuser
Then give an username and password and a email.
you need to create a superuser to access django admin
python manage.py createsuperuser
just enter the username,email and password(password you entered is invisible to you in powershell but it saves the password)
use this command python
manage.py createsuperuser
You have 1 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): auth.
Run 'python manage.py migrate' to apply them.
Username (leave blank to use 'chatru'): admin
Email address: [email protected]
Password:
Password (again):
The password is too similar to the username.
This password is too short. It must contain at least 8 characters.
This password is too common.
Bypass password validation and create user anyway? [y/N]: y
Superuser created successfully.