在Django中实现REST Web服务的框架 [英] Framework for Implementing REST web service in Django

查看:124
本文介绍了在Django中实现REST Web服务的框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为Django应用程序实现RESTful接口。它主要是一个数据服务应用程序 - 接口将(在这一点上)是只读的。

I'm looking to implement a RESTful interface for a Django application. It is primarily a data-service application - the interface will be (at this point) read-only.

问题是哪个Django工具集/框架对此任务最有意义。

The question is which Django toolsets / frameworks make the most sense for this task.

我看到Django休息和Django活塞。还有可以滚动自己的选项。

I see Django-rest and Django-piston. There's also the option of rolling my own.

这个问题在这里被问到,但是两年前好了。我想知道现在的状态是什么。

The question was asked here, but a good two years back. I'd like to know what the current state of play is.

此问题大约在2008年,绝大多数投票是根本不使用任何框架 - 只需创建Django视图,例如回复JSON。 (这个问题也被解决了,2008年的crica,这里)。

In this question, circa 2008, the strong majority vote was to not use any framework at all - just create Django views that reply with e.g. JSON. (The question was also addressed, crica 2008, here.)

在当前的景观中,最有意义的是什么?

In the current landscape, what makes the most sense?

推荐答案


注意:自从写了这篇文章以来, django-piston 不再是
积极维护。如其他人所提到的,请查看 tastypie
django-rest-framework

的确,你可以自己滚动,但是有很多样板涉及。

Indeed, you can roll your own, but there's a lot of boilerplate involved.

<一个href =http://bitbucket.org/jespern/django-piston/wiki/Home =noreferrer> django-piston 是一个非常易于使用和可扩展的微框架。除了模拟所有必要的视图和URL模式之外,它还支持直接将模型映射到REST界面,如果您有一个简单的用例,这是很好的。我建议研究一下。

django-piston is an exceptionally easy to use, and extensible, micro-framework. In addition to mocking up all the necessary views and url patterns, it supports directly mapping models to a REST interface, which is nice if you have a simple use case. I'd suggest looking into it.

这篇关于在Django中实现REST Web服务的框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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