简体   繁体   English

升级至Python 2.7 Google App Engine 500服务器错误

[英]Upgrading to Python 2.7 Google App Engine 500 server error

I just started using Google App Engine and I am very new to Python. 我刚刚开始使用Google App Engine,对Python还是很陌生。 I may have made a stupid mistake or a fatal error, I don't know, but I realized that the basic "template" I downloaded from a website was old and used Python 2.5. 我可能不知道我犯了一个愚蠢的错误或一个致命错误,但是我意识到从网站下载的基本“模板”已经过时并且使用了Python 2.5。

So, I decided to update to Python 2.7 (after recieving a warning in the site's dashboard). 因此,我决定更新到Python 2.7(在站点的仪表板中收到警告后)。

I have no idea how to do this, but I blindly followed some instructions on how to update but I'm not sure what I did wrong. 我不知道如何执行此操作,但是我盲目地遵循了有关如何更新的一些说明,但是我不确定自己做错了什么。

I know that I downloaded Python 2.7 (as the download path is C:/Python27/ ), so there shouldn't be a problem there. 我知道我下载了Python 2.7(因为下载路径为C:/Python27/ ),所以那里应该没有问题。 Can anybody tell what I'm doing wrong? 有人可以告诉我我做错了吗?

I'm submitting as an answer because I'm relatively new to SO and don't have enough rep to comment, so sorry about that... But line 7 of your new main.py uses webapp instead of webapp2 , so that may be causing some troubles, but likely isn't the reason that it's not working. 我正在提交答案,因为我对SO相对较新,并且没有足够的代表发表评论,所以对此表示抱歉。但是,新main.py的第7行使用webapp而不是webapp2 ,因此可能造成一些麻烦,但可能不是它不起作用的原因。 Could you also provide the contact.html template? 您还可以提供contact.html模板吗?

I'm not sure if this is your formatting when you loaded your code here, but where you define app in main.py should not be part of the contacts class. 我不确定在此处加载代码时这是否是您的格式,但是在main.py中定义app的位置不应该是contacts类的一部分。 If it is, your reference to main.app in your app.yaml won't work and your page won't load. 如果是这样,则您对app.yaml中的main.app的引用将不起作用,并且您的页面也将无法加载。

Thank you everyone for your respective answers and comments, but I recently stumbled upon GAE boilerplate and decided to use that and everything's fine. 谢谢大家的答复和评论,但是最近我偶然发现了GAE样板并决定使用它,一切都很好。 I kept having very odd problems with GAE beforehand, but the boilerplate is simple and seems to be working fine so far. 之前我一直对GAE遇到非常奇怪的问题,但是样板很简单,到目前为止似乎运行良好。 Anyways, thanks again. 无论如何,再次感谢。 (Note: I would delete the question but two people have already answered and received rep from +1s, and they are in fact helpful answers, so I'll leave it be). (请注意:我会删除问题,但两个人已经回答了+1并收到了+1的答覆,他们实际上是有帮助的答案,因此我将其保留)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM