在iPhone上测试Django网站

问题描述:

对于这样的初学者问题,我深表歉意,但我被困住了。我开始学习网络开发,并想使用Django runserver命令测试我在本地托管的内容。我想在我的iPhone上进行测试。根据这个问题,我只需要指出我的iPhone转到我的Windows 7 ip地址(通过ipconfig找到)。尝试执行此操作时,出现错误消息:由于服务器停止响应,Safari无法打开页面(超时)。

I apologize for such a beginner question, but I'm stuck. I'm starting learn web development and I want to test out something I am hosting locally using Django runserver command. I would like to test it on my iPhone. According to this question, I just need to point my iPhone to my Windows 7 ip address (which I found through ipconfig). When I try to, I get the error: "Safari could not open the page because the server stopped responding" (a time-out).

还有其他内容吗?我需要做吗?

Is there anything else that I need to do?

除了使用正确的IP,您的runserver命令还应该侦听0.0.0.0(所有IP )。

In addition to using the correct IP, your runserver command should listen on 0.0.0.0(all IPs).

runserver 0.0.0.0:8000