简体   繁体   English

Appengine REST库 - Python和Django

[英]Appengine REST library - Python and Django

I want to provide a REST API for my Django application which will run on Google App engine. 我想为我的Django应用程序提供一个REST API,它将在Google App引擎上运行。 I stumbled upon appengine-rest-server and found to be useful. 我偶然发现了appengine-rest-server ,发现它很有用。 But i would like to get some real world usage examples if any, and any gotchas. 但我想得到一些真实世界的用法示例,如果有的话,以及任何陷阱。 Is there any better alternatives to consider? 还有更好的选择吗?

I'm using django-nonrel with tastypie. 我正在使用django-nonrel和tastypie。 I needed to make a couple of small code changes at the time, but I think the latest versions in the repos work together. 我当时需要做一些小代码更改,但我认为repos中的最新版本可以协同工作。

http://eatdev.tumblr.com/post/12076483835/tastypie-on-django-nonrel-on-app-engine http://eatdev.tumblr.com/post/12076483835/tastypie-on-django-nonrel-on-app-engine

Because of the lack of many-to-many relations, I've been using ListProperties, and they seem to work fine with tastypie. 由于缺乏多对多的关系,我一直在使用ListProperties,它们似乎与tastypie一起工作正常。

tastypie APIs are designed to match models. tastypie API旨在匹配模型。 If your API will be creating/getting/updating/deleting instances of your models, tastypie will require less code. 如果您的API将创建/获取/更新/删除模型的实例,则tastypie将需要更少的代码。

django-piston is very popular too, but I haven't tried it on app engine. django-piston也非常受欢迎,但我没有在app引擎上试过它。

更新我建议看一下: django-tastypie ,结果比django-piston更好用,它还可以帮助你对你的API版本化和mamange多个端点

我认为目前编写REST API的最佳选择是django-piston https://bitbucket.org/jespern/django-piston ,我认为它应该与Google AppEngine完美配合,尽管我从未尝试过。

目前,appengine-rest-server不支持ndb模型。

I've used restlet on app engine without any issues. 我在app引擎上使用了restlet而没有任何问题。 http://www.restlet.org/ http://www.restlet.org/

I stopped using it in favor of just using basic HttpServlet for posts and gets of json data. 我停止使用它,只支持使用基本的HttpServlet发布帖子和获取json数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM