Access to the Python service Http://127.0.0.1:8000/denied our connection request. A way to solve

Source: Internet
Author: User
Latest Solutions Click this link to view

In the last article http://blog.csdn.net/wang725/article/details/73698455, described the situation of this problem, after several days of attempts to finally find a solution hair way.
In the process of trying to resolve:
Set the virtual machine static IP: "192.168.1.17", but in the Windows native computer can not ping the virtual machine IP, found that the host IP is "192.168.56.1", their two IP is not a network segment, resulting in the host can not access the virtual machine.
Workaround:
Modify Vagrantfile to change the IP of the virtual machine to "192.168.56.2"

Config.vm.network "Private_network", IP: "192.168.56.2"

Restart the virtual machine

Vagrant Reload

Restart Service

(env27) vagrant@precise64:/vagrant$ python manage.py runserver 0.0.0.0:8000 performing
system checks ...

System Check identified no issues (0 silenced).
June, 2017-11:37:02
Django version 1.8.3, using Settings ' ops_master.settings '
starting development Server at Http://0.0.0.0:8000/
Quit the server with Control-c.

Visit again: http://192.168.56.2:8000/ops/hello/successful
Previously built environment has never encountered such http://127.0.0.1:8000/rejected our connection request problem, through the past few days to try to solve the problem in this way, and then find other better ways to share the blog.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.