django - 从PyCharm服务器运行的项目不可访问 [英] django - run project from PyCharm server not accessible
本文介绍了django - 从PyCharm服务器运行的项目不可访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我从PyCharm运行我的django服务器时,它无法从外部访问。
When I run my django server from PyCharm it is not accessible from the outside world.
我读过,可以像这样运行在cmd中。
I read that you can run in the cmd like that, and it works.
python manage.py runserver 0.0.0.0:8000
如何运行它,以便从 PyCharm 访问外部世界?
How do I run it to be accessible to the outside world from PyCharm?
我需要从命令调试。
谢谢!
推荐答案
在PyCharm的右上角(默认情况下),您可以编辑服务器的配置:
At the upper-right corner (by default) of PyCharm you can edit the configuration for your server:
在那里指定为主机 0.0.0.0
。
不要忘记照顾你的防火墙/ NAT通过打开和转发适当的端口。
Don't forget to take care of your firewall/NAT by opening and forwarding the appropriate ports.
这篇关于django - 从PyCharm服务器运行的项目不可访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文