appengine-rest-server的基本设置

时间:2013-12-06 21:33:41

标签: python google-app-engine

我下载appengine-rest-server(1.0.8)并尝试在我的应用程序中使用此模块,但在测试时出现“404错误”:

http://localhost:8080/rest/metadata
http://localhost:8080/rest/metadata/GPSLog

有没有人使用python 2.7.2的工作示例?

按照我的代码初始化模块:

rest.Dispatcher.base_url = '/rest'
rest.Dispatcher.add_models({
  "GPSLog": models.GPSLog})
application = webapp.WSGIApplication([<Some other Routs> ,
                                  ('/rest/.*', rest.Dispatcher)], debug=True)

日志说它正在加载我的模型。关于app.yaml应该是什么样子的任何想法?

1 个答案:

答案 0 :(得分:0)

当您使用python 2.7时,您的app.yaml处理程序条目将类似于:

application: yourapp
version: 1
runtime: python27
api_version: 1
threadsafe: true

handlers:

- url: /rest/.*
  script: your_module.application
相关问题