Django 的 HTTP 服务器默认拒绝远程请求吗?
我已经在开发者上运行 django 了。我希望能够向其他开发人员提出请求。我的局域网上的盒子。尽管我可以正常 ping 通,但我根本没有收到任何响应,但没有防火墙在运行等。Django
中是否有某个设置默认阻止它响应远程请求?
谢谢
I've got django running on a dev. box that I'd like to be able to make requests to from another dev. box on my LAN. I'm getting no response at all though, even though I can ping just fine, no firewalls are operating, etc.
Is there a setting in Django somewhere that prevents it from responding to remote requests by default?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否将 Django 服务器绑定到 127.0.0.1?或者您是否绑定到分配给另一台计算机可访问的接口的 IP 地址?
要将服务器绑定到另一个地址,请使用
python manage.py runserver:
,如 StackOverflow 问题中的回答:Google 代码 + 临时服务器?另请参阅manage.py 文档来自姜戈。
请注意,这会对性能产生影响,开发服务器不适合并发访问,如果多人同时浏览,性能会很差。
Are you binding the Django server to 127.0.0.1 perchance? Or are you binding to the IP addres assigned to an interface that is reachable by the other computer?
To bind the server to another address look at using
python manage.py runserver <ip address>:<port>
as answered in this StackOverflow question: google code + temp server?Also see the manage.py documentation from Django.
Do note that there is going to be a performance impact, the dev server is not meant for concurrent access and will perform poorly if multiple people are browsing at the same time..