首页 > 解决方案 > 从 protoRPC 迁移(Python 2.7 到 Python 3)Google App 引擎

问题描述

我们有一个谷歌应用引擎 py2.7 标准。我们使用云端点框架来制作 web api。我们还使用 protopc 来进行数据的序列化和反序列化。

例如

@cloud_endpointapi.api_class(resource_name="validateteacherpin")    
class ValidateTeacherPin(remote.Service):   

    MULTIPLY_METHOD_RESOURCE = endpoints.ResourceContainer(API_Validate_Teacher_Pin_Request)

    @endpoints.method(MULTIPLY_METHOD_RESOURCE, 
        API_Validate_Teacher_Pin_Response,      
        http_method='POST',
        name='teacher.validateteacherpinentered')



from protorpc import messages
from protorpc import message_types
from protorpc import remote


class API_Validate_Teacher_Pin_Request(messages.Message):
    field_1    = messages.StringField(1)
    field_2    = messages.StringField(2)
    

我们现在正在将应用程序迁移到 Google App 引擎标准中的 Python 3.7。Python 3.7 不支持 protopc。我们如何迁移代码?

标签: python-3.xpython-2.7google-app-engineprotorpc

解决方案


推荐阅读