Well, first of all you can use django-piston , as @Tudorizer already mentioned.
But then again, as I see it (and I could be wrong!), REST is more of a set of design guidelines, not a specific API. In essence, this means that interaction with your service should not be based on “things you can do” (typical RPC style methods), but rather “things you can act in predictable ways organized in a certain way” (resource object and http verbs).
You don’t need to do anything extra to write REST-style services with django.
Consider the following:
from django.conf.urls.defaults import patterns, url
urlpatterns = patterns('',
url(r'^tickets$', 'myapp.views.tickets', name='tickets'),
url(r'^ticket/(?P<id>\d+)$', 'myapp.views.tickets', name='ticket'),
url(r'^ticket$', 'myapp.views.tickets', name='ticket'),
)
def tickets(request):
tickets = Ticket.objects.all()
return render_to_response('tickets.html', {'tickets':tickets})
def ticket(request, id=None):
if id is not None:
ticket = get_object_or_404(Ticket, id=id)
if request.method == 'POST':
else:
...
... etc.
, , //.