【问题标题】:Python (Django) based website not loading in browser基于 Python (Django) 的网站未在浏览器中加载
【发布时间】:2015-02-19 08:42:55
【问题描述】:

我正在尝试在虚拟机的服务器上启动一个预先构建的网站。 虚拟机中加载了Windows 2008 server

我正在尝试启动的网站名为 RapidPro。它是开源的,部署它进行开发的步骤在下面的链接中给出:

http://rapidpro.github.io/rapidpro/docs/development/

虽然链接中给出的指令适用于 Linux (Ubuntu),但我已经在 Windows 中执行了相同的步骤并执行了链接中给出的所有命令。

执行最后一条命令后,即:

 python manage.py runserver

我在命令提示符下收到以下日志:

C:\Users\zax\Desktop\RAPIDPRO\rapidpro>python manage.py runserver
modeltranslation: Registered 0 models for translation ().
Raven is not configured (logging is disabled). Please see the documentation for
more information.
INFO 2015-02-18 23:38:13,438 base 2872 1300 Raven is not configured (logging is
disabled). Please see the documentation for more information.
Generating LALR tables
modeltranslation: Registered 0 models for translation ().
Raven is not configured (logging is disabled). Please see the documentation for
more information.
INFO 2015-02-18 23:38:14,970 base 3520 2480 Raven is not configured (logging is
disabled). Please see the documentation for more information.
Generating LALR tables
Performing system checks...

System check identified no issues (0 silenced).
February 18, 2015 - 23:38:17
Django version 1.7.1, using settings 'temba.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

所以在这里我假设命令已成功执行,我可以使用地址http://127.0.0.1:8000/从浏览器启动网站

在我的网络浏览器中输入这个地址(在Internet ExplorerGoogle Chrome 浏览器上都试过),即使等待很长时间(15-20 分钟),页面也没有加载。

在浏览器选项卡上我收到消息:

 Waiting for 127.0.0.1

如果有人对我缺少什么有任何想法,请您提供它作为相同的答案。

提前致谢。

【问题讨论】:

  • 你的虚拟机IP是多少?

标签: python django python-2.7


【解决方案1】:

我敢打赌防火墙有问题。如果请求会到达开发服务器,您会在终端中看到这一点。

尝试在防火墙中打开端口,或者(如果没有重要的其他应用程序)尝试禁用防火墙一分钟,只是为了检查。

【讨论】:

    【解决方案2】:

    有一个参数需要在启动应用时传递

    python manage.py runserver 0.0.0.0:8000
    

    这将启动服务器在端口 8000 上的所有可用地址上运行

    【讨论】:

      猜你喜欢
      • 2013-05-27
      • 2017-06-02
      • 1970-01-01
      • 1970-01-01
      • 2021-05-18
      • 1970-01-01
      • 2017-09-03
      • 2016-02-18
      • 2017-08-16
      相关资源
      最近更新 更多