Successfully created an admin user using py manage.py createsuperuser
. Entered username, e-mail, password but whenever I try to access this link http://127.0.0.1:8000/admin/ it says “This site can’t be reached” and “127.0.0.1 refused to connect, ” How do I fix this error and access the administrator site ?
I’m using Windows 10 with the latest version of Django.
before accessing admin page
Now as soon as I access the admin page (you can see I’ve put the URL in the address bar) the server stops automatically. See the image below you’ll find the page loading but the server automatically quit itself.
Advertisement
Answer
visit your root directory (having manage.py file)
python manage.py check
if no errors
python manage.py runserver
make sure you access admin site at localhost:8000/admin/
and your server keeps on running.
EDIT : If you are facing this issue in Django version-3, then it is a issue reported here and here you need to switch to python version 3.8 or either downgrade your django.