Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/277.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/google-app-engine/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Google应用程序引擎python库验证Google地图引擎API_Python_Google App Engine_Google Maps Engine - Fatal编程技术网

使用Google应用程序引擎python库验证Google地图引擎API

使用Google应用程序引擎python库验证Google地图引擎API,python,google-app-engine,google-maps-engine,Python,Google App Engine,Google Maps Engine,我想谷歌应用程序引擎python后端与谷歌地图引擎服务。以下是我的代码片段: import os import urllib import webapp2 import jinja2 from apiclient import discovery import httplib2 from oauth2client.appengine import OAuth2Decorator decorator = OAuth2Decorator( client_id='<MY CLIEN

我想谷歌应用程序引擎python后端与谷歌地图引擎服务。以下是我的代码片段:

import os
import urllib
import webapp2
import jinja2

from apiclient import discovery
import httplib2 
from oauth2client.appengine import OAuth2Decorator

decorator = OAuth2Decorator(
    client_id='<MY CLIENT ID>',
    client_secret='<MY CLIENT SECRET>',
    scope='https://www.googleapis.com/auth/mapsengine.readonly')

service = discovery.build('mapsengine', 'v1')

JINJA_ENVIRONMENT = jinja2.Environment(
    loader=jinja2.FileSystemLoader(os.path.dirname(__file__)),
    extensions=['jinja2.ext.autoescape'],
    autoescape=True)


class PrintHandler(webapp2.RequestHandler):
    def render_response(self, **kwargs):
        template = JINJA_ENVIRONMENT.get_template('report.html')
        self.response.write(template.render(**kwargs))

    @decorator.oauth_aware
    def post(self):
        if decorator.has_credentials():
            request = service.tables().features().list(id='<TABLE ID>')
            if request is not None:
                response = request.execute(decorator.http())
                self.render_response(features=response['features'])         
        else:
            url = decorator.authorize_url()
            self.render_response(authorize_url=url)

app = webapp2.WSGIApplication([
    ('/', PrintHandler),
    (decorator.callback_path, decorator.callback_handler())
], debug=True)
看起来上面的脚本没有任何错误,但是没有返回任何信息。我已经在中通过oauth测试了请求,并且成功了

有人知道如何解决这个问题吗

谢谢