[英]Can't connect to localhost:8080 when trying to run Google App Engine program
I'm trying to run the Google App Engine Python 2.7 Hello World program and view it in a browser via Google App Engine Launcher. 我正在尝试运行Google App Engine Python 2.7 Hello World程序,并通过Google App Engine启动器在浏览器中查看它。 I followed the install and program instructions to the letter. 我按照安装和程序说明进行操作。 I copied and pasted the code in the instructions to the helloworld.py file and app.yam1 and verified that they are correct and in the directory listed as the application directory. 我将指令中的代码复制并粘贴到helloworld.py文件和app.yam1中,并验证它们正确无误,并在列为应用程序目录的目录中进行了验证。 I hit run on the launcher and it runs with no errors, although I get no sign that is has completed (orange clock symbol next to app name). 我在启动器上运行了run,并且运行没有错误,尽管我没有收到任何已完成的标志(应用程序名称旁边的橙色时钟符号)。 I get the following from the logs: 我从日志中得到以下内容:
When I try to open in the browser via the GAE Launcher, the 'browse' icon is grayed out and the browser won't open. 当我尝试通过GAE启动器在浏览器中打开时,“浏览”图标显示为灰色,并且浏览器无法打开。 I tried opening localhost:8080 in Firefox and Chrome as the tutorial suggests, but I get unable to connect errors from both. 如本教程所述,我尝试在Firefox和Chrome中打开localhost:8080,但无法同时连接两者。
How can I view Hello World in a browser? 如何在浏览器中查看Hello World? Is there some configuration I need to make on my machine? 我需要在机器上进行一些配置吗?
I had the same problem. 我有同样的问题。 This seemed to fix it: 这似乎解决了它:
cd to google_appengine, run cd到google_appengine,运行
python dev_appserver.py --port=8080 --host=127.0.0.1 /path/to/application python dev_appserver.py --port = 8080 --host = 127.0.0.1 / path / to / application
at this point there is a prompt to allow updates on running, I said Yes. 此时,系统会提示您允许运行中的更新,我说是。
At this point the app was running as it should, also when I quit this and went in using the launcher again, that worked too. 此时,该应用程序已按预期运行,并且当我退出并再次使用启动器时,该应用程序也正常运行。
I have to manually start python and make it point to my app folder, for instance in a command line window on Windows I am using python. 我必须手动启动python,并将其指向我的应用程序文件夹,例如在Windows上的命令行窗口中,我正在使用python。 I installed python in C:\\Python27 and my sample app is in c:\\GoogleApps\\guestbook 我在C:\\ Python27中安装了python,而我的示例应用程序在c:\\ GoogleApps \\ guestbook中
C:\\Python27>dev_appserver.py c:\\GoogleApps\\guestbook C:\\ Python27> dev_appserver.py c:\\ GoogleApps \\ guestbook
and then I can start my app in the Google App Engine Launcher and hit localhost 8080 然后我可以在Google App Engine启动器中启动我的应用,然后点击localhost 8080
How about specifying --host argument? 如何指定--host参数? You can find it at the bottom of following doc. 您可以在以下文档的底部找到它。
https://developers.google.com/appengine/docs/python/tools/devserver https://developers.google.com/appengine/docs/python/tools/devserver
This might be a little late. 这可能会晚一点。 But still someone might find it useful. 但是仍然有人会觉得它有用。
When ever you go and try changing the port number from 8080 to something else, it will not get updated. 每当您尝试将端口号从8080更改为其他名称时,它都不会更新。 So the best option is: 因此最好的选择是:
7: Access the application using: http://localhost:NewPort/ 7:使用以下程序访问应用程序: http:// localhost:NewPort /
This can be used to change ports both run port and admin port for your individual projects running locally. 这可用于更改本地运行的单个项目的运行端口和管理端口。 Hope this helps! 希望这可以帮助!
The 8080 portion of your url is a port number. 网址的8080部分是端口号。 Firefox disables visiting url's of other ports by default. Firefox默认禁用其他端口的访问URL。 You have to enable them by doing the following: http://blog.christoffer.me/post/2012-02-20-how-to-remove-firefoxs-this-address-is-restricted/ 您必须通过执行以下操作启用它们: http : //blog.christoffer.me/post/2012-02-20-how-to-remove-firefoxs-this-address-is-restricted/
Paraphrasing that website: 解释该网站:
It's likely if this continues to not work that your browser is behaving properly (8080 is a fairly standard port). 如果浏览器无法正常运行(8080是相当标准的端口),则可能仍然无法正常工作。 That means that its a problem with the server and we'd have to do some more debugging. 这意味着服务器存在问题,我们必须进行更多调试。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.