Skip to content
Advertisement

Cannot access Django administrator site in Django-3

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

enter image description here

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.

enter image description here

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.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement