简体   繁体   中英

Django admin site login error -“This site can’t be reached127.0.0.1 refused to connect.”

I am developing a web app using Django 3.0.1 and python 3.7 for my college's final year project. Whenever I try to login to the admin page in the local host in google chrome, link "http://127.0.0.1:8000/admin/" I got this error in the terminal GET / HTTP/1.1" 200 2926

and the ports that are started in XAMPP are: ** 80, 443(Apache), 3306(MySQL)**

And in google chrome I get this error: "This site can't be reached 127.0.0.1 refused to connect. Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED"

link of the error image [1]: https://i.stack.imgur.com/y9VdU.png

I know this may not be due to wrong username and password. I have done lots of research on this topic but couldn't find a solution.

I have found that updating python version would solve this problem but haven't tried that one cause I have been developing other projects in the same version.

I have tried using other ports 8080, 9000 that also did not work.

So, if anyone can answer this problem it would help me a lot. And thankyou in advance.

can you please share that error image? and try to run site on another port!

exec ./manage.py runserver 0.0.0.0:<your_port>

You can try with this command to

python manage.py runserver 0.0.0.0:8080 (WINDOWS)

or

python3 manage.py runserver 0.0.0.0:8080 (LINUX)

It will run on port 8080 you can check on 127.0.0.1:8080

After trying many processes that were available to me the project did not work. So, i uninstalled my python version 3.7 and installed python 3.8.7 which worked for me. But still i could not figure out the problem, but installing newer version worked for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM