1

我正在使用谷歌应用程序引擎webapps run_wsgi_app实用程序来包装我的烧瓶应用程序实例,我认为这是一个 webapp 问题,因为只有烧瓶它才能正常工作。它发生在 API 路由上的 POST 请求之后

ERROR    2013-10-14 18:18:53,862 cgi.py:121] Traceback (most recent call last):
  File "/home/synod/Desktop/MedApp/GAE-app/main.py", line 4, in <module>
    run_wsgi_app(app)
  File "/usr/lib/google_appengine/google/appengine/ext/webapp/util.py", line 98, in run_wsgi_app
    run_bare_wsgi_app(add_wsgi_middleware(application))
  File "/usr/lib/google_appengine/google/appengine/ext/webapp/util.py", line 118, in run_bare_wsgi_app
    for data in result:
  File "/home/synod/Desktop/MedApp/GAE-app/werkzeug/wsgi.py", line 508, in next
    return self._next()
  File "/home/synod/Desktop/MedApp/GAE-app/werkzeug/wrappers.py", line 789, in iter_encoded
    for item in self.response:
TypeError: 'Response' object is not iterable

INFO     2013-10-14 18:18:53,869 module.py:599] default: "POST /api/betaMember/ HTTP/1.1" 500 -

@app.route('/api/betaMember/', methods=['POST'])
def betaMember():
    if not request.json:
        abort(400)

    if request.headers['Content-Type'] != 'application/json':
        abort(400)

    if not 'email' in request.json:
        abort(400)

    if not 'name' in request.json:
        abort(400)

    name = request.json.get('name')
    email = request.json.get('email')

    # person = Person(email = email,name = name)            
    # person.put()

    return make_response(jsonify({"OK": "Data Saved"}), 201)
4

0 回答 0