Django的REST的API - Django的活塞与Django的tastypie [英] Django RESTful API - django-piston vs. django-tastypie

查看:317
本文介绍了Django的REST的API - Django的活塞与Django的tastypie的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在寻找我们的Django项目一般的RESTful API的解决方案。我们将使用API​​最初对Ajax的移动应用,外部应用之类的东西在网站上呼吁及更高版本。

We're looking for a general RESTful API solution for our Django project. We would use the API at first for Ajax calls on the web site and later for mobile apps, external apps and things like that.

我发现了两个模块,这似乎得到广泛的应用。 Django的活塞和的 Django的tastypie

I found two modules which seem to be widely used. django-piston and django-tastypie

从我读,活塞似乎是旧的,从而更加成熟,但也许有点过时?
虽然tastypie是比较新的,很好的证明。

From what I read, piston seems to be older and thus more mature but maybe a bit outdated?! While tastypie is relatively new and nicely documented.

什么是一起去的最好的事情? Django的活塞 Django的tastypie
重要的是我们(按优先级排序):连续维修的来源,文档,稳定性,易用性

What would be the best thing to go with? django-piston or django-tastypie? Important for us (ordered by priority): Continuous maintenance of the source, documentation, stability, ease of use.

修改(2013 7月16日):

现在过了一年之后,我们有一个明显的赢家。起初,我们就跟着tastypie。我们还挺喜欢的。不过半年左右的时间,我们切换到当时即将 Django的REST的架构和永不回头。

Now over a year later we have a clear winner. At first we went with tastypie. Which we kinda liked. But after half a year or so we switched to the then upcoming django-rest-framework and never looked back.

我们最喜欢什么吧:


  • 尼斯文档

  • Nice documentation

活跃的社区

清洁设计(建立在Django的基于类视图)

Clean design (build upon django's class based views)

有关开发和调试可浏览API

Browsable API for development and debugging

我们依靠大量的API支持这样(未来)是我们的主要关切之一。我们遇到的维护者 - 汤姆·克里斯蒂 - (在线或离线),他似乎非常致力于该项目。所以,我们觉得很舒服使用Django的REST的框架。

We rely on the API heavily so support (in the future) is one of our main concerns. We met the maintainer - Tom Christie - (on and offline) and he seems very committed to the project. So we feel very comfortable using the django-rest-framework.

推荐答案

一个很好的资源对它们进行比较是 HTTP:/ /www.djangopackages.com/grids/g/api/

A good resource to compare them is http://www.djangopackages.com/grids/g/api/

Django的tastypie肯定的是保存的选择现在。

Django-tastypie sure is the save choice right now.

我个人倒主张看看 Django的休息框架的,如果你使用Django 1.3,因为它使用了新的基于类的观点。 djangopackages.com的对比页显示其具有良好的参与和活动。而且,哇,它肯定有一个不错的可浏览界面到API。

Personally I'd advocate a look at django-rest-framework if you use django 1.3, because it uses the new class based views. djangopackages.com's comparison page shows it has good participation and activity. And, wow, it sure has a nice browsable interface to the API.

这篇关于Django的REST的API - Django的活塞与Django的tastypie的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆