Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Framework for Implementing REST web service in Django

Tags:

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.

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

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.

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?

like image 843
Laizer Avatar asked Mar 21 '10 19:03

Laizer


People also ask

What is Django REST framework?

The Django REST framework (DRF) is a toolkit built on top of the Django web framework that reduces the amount of code you need to write to create REST interfaces. In this course you'll learn about: The REST protocol. DRF Serializers and how to use them with Django objects.

Is Django rest framework a framework?

Django REST framework is a powerful and flexible toolkit for building Web APIs. Some reasons you might want to use REST framework: The Web browsable API is a huge usability win for your developers. Authentication policies including packages for OAuth1a and OAuth2.

Which Django use REST framework?

Who uses Django REST framework? 337 companies reportedly use Django REST framework in their tech stacks, including Robinhood, UpstageAI, and BirdView.


1 Answers

NOTE: Since this post was written, django-piston is no longer actively maintained. As others have mentioned, look into tastypie or django-rest-framework.

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

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.

like image 116
Daniel Naab Avatar answered Oct 08 '22 18:10

Daniel Naab