HTTP Error 500 when attempting to access localhost

只谈情不闲聊 提交于 2019-12-10 20:26:20

问题


I just built my first "web app" for a class using Google App Engine, and it deployed correctly, and works perfectly well on Google's servers. However, when I try to access it on localhost, I get a 500 error:

"Server error The website encountered an error while retrieving http://localhost:8081/. It may be down for maintenance or configured incorrectly."

I have tried using various ports, and none of them seem to work. I am 100% positive I am using the correct port and that the app is actually running with no errors.

I am using Google Chrome and Python 2.7.2 on Mac OS 10.6.8

Any ideas on how to correct this or what configurations to check?


回答1:


Turns out, the issue was that GAE was accessing an older version of python on my computer.

I was able to fix this by opening up the python launcher, copying the path from "Interpreter", and pasting it into GAE under Preferences/Python Path. In my case, the correct path is /usr/local/bin/pythonw

It is important to note that as there is no "ok" or "apply" button here, you must hit enter to apply the path change.




回答2:


"Error 500" is generic for "I asked the server to do something, and it failed".

1) Look in your web server's error logs

2) Debug your "hello world" application

ALSO:

3) Make sure you can run this "hello world":

https://developers.google.com/appengine/docs/python/gettingstarted/helloworld

4) If you can't, then review the setup instructions here:

http://googcloudlabs.appspot.com/setup.html



来源:https://stackoverflow.com/questions/10221165/http-error-500-when-attempting-to-access-localhost

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!