简体   繁体   中英

python, django, vagrant and access error on windows host machine

Well, I'm trying to access a python server (for django development) in a Virtual Box VM via vagrant, but I can't connect with it in my windows browsers. I'll try to describe all the things I've done to make this work, so maybe it can help you guys.

My configurations:

  1. I set my vagrant file to allow connections in port 8000 (guest and host)
  2. I have disabled my windows firewall.
  3. I have turned off the firewall on the VM
  4. I have disabled all chrome extensions (including addblock)
  5. I have disabled almost all apps in my windows to minimize the chances that some program could use port 8000
  6. I have unchecked "automatically detect settings" and "use a proxy server for your lan" in the lan settings (windows internet options), then done the ip /release, ip /renew and rebooted my machine
  7. Yes, the python server is running well on the vm
  8. I tried the default 127.0.0.1:8000 (no success) and changed to 0.0.0.0:8000 using the command "python manage.py runserver 0.0.0.0:8000", but still ... :(
  9. I have a nginx server in the vm running well for my php apps in port 80, and i cant access them with no problems
  10. I use pycharm for python development and it starts my server normally in the vm either using 127.0.0.1:8000 or 0.0.0.0:8000

I think that's it, but the error persists, I can't access my python server in my ip 192.168.56.101 in port 8000, this ip is my private network on the vm that runs good with nginx.

But the result is always the same Whenever I try access http://192.168.56.101:8000/ all my browsers (IE, Firefox, Chrome) cannot complete the request, in Chrome the error is ERR_CONNECTION_TIMED_OUT

Thanks in advance for any help !

My problem was the firewall rules. I dont really need it since its a development environment, so I delete all the rules in /etc/iptables/rules.v4 and save the file. That solve it all. Tks.

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