在iPhone上测试Django网站 [英] Testing Django website on iphone

查看:87
本文介绍了在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

这篇关于在iPhone上测试Django网站的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆