什么是Django的tastypie和djangorestframework之间的区别是什么? [英] What are the differences between django-tastypie and djangorestframework?
问题描述
为什么要使用一个比其他,对暴露的API为您的Django应用程序?
Why would you use one over the other, for exposing an API for your Django app?
<一个href=\"http://pypi.python.org/pypi/djangorestframework/\">http://pypi.python.org/pypi/djangorestframework/
<一个href=\"http://pypi.python.org/pypi/django-tastypie\">http://pypi.python.org/pypi/django-tastypie
推荐答案
由于Django的休息框架的作者,我有一个明显的偏差;),但我对这个希望,相当目标的看法是这样的:
As the author of django-rest-framework, I've got an obvious bias ;) but my hopefully-fairly-objective opinion on this is something like:
- 作为托斯滕指出,你不会去远矣与同一偷看写成真棒 Django的草垛东西。从我看到了他们的邮件列表中的丹尼尔·林赛等都是超有帮助,Tastypie稳定,COM prehensive,有据可查
- 擅长给你一个合理的一套默认行为,并作出了建设与风格的API非常容易。
- As Torsten noted, you're not going to go far wrong with something written by the same peeps as the awesome django-haystack. From what I've seen on their mailing list Daniel Lindsey et al are super-helpful, and Tastypie is stable, comprehensive and well documented
- Excels in giving you a sensible set of default behaviour and making building an API with that style incredibly easy.
- 为您提供了HTML浏览的自我描述的API。 (EG,请参见教程API 。)能够进行导航和直接在浏览器的API进行交互是一个很大的可用性胜利。
- 试图贴近Django的成语全 - 建立在Django的基于类的观点,等等顶......(虽然TastyPie出现之前,Django的CBVS存在,所以使用它自己的基于类的视图实现)
- 我想认为,底层的架构是pretty很好地建立,脱钩等...
- Gives you HTML browse-able self-describing APIs. (EG, see the tutorial API.) Being able to navigate and interact with the API directly in the browser is a big usability win.
- Tries to stay close to Django idioms throughout - built on top of Django's class based views, etc... (Whereas TastyPie came along before Django's CBVs existed, so uses it's own class-based views implementation)
- I'd like to think that the underlying architecture is pretty nicely built, decoupled etc...
在任何情况下,两者都是良好的。我可能会描述Tastypie为给你一个合理的默认设置的开箱和REST框架所非常漂亮的分离和灵活。如果你在API中投入了大量的时间规划,我建议DEF通过文档和浏览;每个codeBase的,并试图获得适合你更多的感受。
In any case, both are good. I would probably characterise Tastypie as giving you a sensible set of defaults out of the box, and REST framework as being very nicely decoupled and flexible. If you're planning on investing a lot of time in the API, I'd def recommend browsing through the docs & codebase of each and trying to get a feel for which suits you more.
显然,另外还有为什么TastyPie?'它部分的README和的REST框架2公布
Obviously, there's also the 'Why TastyPie?' section in it's README, and the 'REST framework 2 announcement'.
另请参阅丹尼尔格林菲尔德的博客文章选择了Django的的API框架,从2012年5月(值得注意的是,仍然是一个几个月大的REST框架2.0发布之前)。
See also Daniel Greenfeld's blog post on Choosing an API framework for Django, from May 2012 (Worth noting that this was still a few months before the big REST framework 2.0 release).
另外一对夫妇在Reddit上的线程与家人问这个同样的问题,从 2013年12月和<一个href=\"http://www.reddit.com/r/django/comments/1i9qt5/ask_rdjango_tastypie_or_django_rest_framework/\">July 2013 。
Also a couple of threads on Reddit with folks asking this same question, from Dec 2013 and July 2013.
的上次更新2014年2月的
这篇关于什么是Django的tastypie和djangorestframework之间的区别是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!