【发布时间】:2013-11-10 21:05:05
【问题描述】:
开发人员您好,我正在使用 Google App Engine、Python Flask 制作应用程序,但在趋势事件页面上出现 Aw Snap 错误,我正在页面上运行此视图
@app.route('/events/', methods=['POST','GET'])
def trending_events():
events= model.Event.query()
return render_template('trending_events.html', events=events)
这是托管应用程序的链接:http://gcdc2013-eventus.appspot.com/events/
我可以在 localhost 上完美运行此页面,但我只在应用引擎服务器上遇到问题,另一方面,我可以在 Google App Engine 的用户配置文件中查看事件。
我是否需要定义索引(但由于查询中没有过滤器可以)但是为了更好的方法,请查看我的事件 NDB 模型
class Event(Base,modelx.EventX):
'''
Refering Google + and Facebook Event model , also
customizing to generate team based events performance reports and visualizations
'''
name = ndb.StringProperty(indexed=True,required=True)
creator = ndb.KeyProperty(kind="User", required=True)
creator_id = ndb.IntegerProperty(required=True)
event_type = ndb.StringProperty(required=True)
teamSize = ndb.IntegerProperty()
manager = ndb.StringProperty()
event_url = ndb.StringProperty()
description=ndb.StringProperty(default='')
phone = ndb.IntegerProperty(default=0000000000)
venue = ndb.StringProperty(required=True)
sdate = ndb.DateProperty()
edate = ndb.DateProperty()
googleplus_page = ndb.StringProperty(default='')
facebook_page = ndb.StringProperty(default='')
twitter_id = ndb.StringProperty(default='')
access = ndb.StringProperty(required=True)
【问题讨论】:
-
在调试模式下运行应用程序,以便您可以看到错误的堆栈跟踪。
-
调试模式设置为真,我在本地机器上得到
WARNING in toolbar [/home/chitrank/Documents/Google_App_Engine/GoogleCloudPlatform/uscore-stiteration/uscore/src/lib/flask_debugtoolbar/toolbar.py:48]: Disabled SQLAlchemyDebugPanel due to ImportError: cannot import name json可能是由于json,我使用import json应该是用户from flask import json -
您可以禁用调试工具栏并在启用常规调试模式的情况下运行应用程序吗?如果这工作正常,那么问题出在调试工具栏中。如果您获得堆栈跟踪,那么这可能是您自己的代码中的问题,而不是工具栏上的警告。
-
你做对了 Miguel 实际上我使用的是 Google App Engine Mini Profiler 和 Flask-DebugToolbar,它们有一些未满足的 json 数据依赖关系,我从我的应用程序中删除了它们,现在我的应用程序运行得非常好谢谢
标签: python google-app-engine flask