My favorites | Sign in
Project Home Wiki Issues Source
Project Information
Members
Featured
Wiki pages
Links

What

The Django REST interface makes it easy to offer private and public APIs for existing Django models. New generic views simplify data retrieval and modification in a resource-centric architecture and provide model data in formats such as XML, JSON and YAML with very little custom code.

How

1. Checkout from source control:

  hg clone https://django-rest.googlecode.com/hg/ django-rest 

2. Run the install:

   python setup.py install

3. Add these lines to your urls.py:

  from django_restapi.model_resource import Collection
  from django_restapi.responder import XMLResponder

4. For every model you want to be part of the API, create a Collection instance in urls.py (see more elaborate examples):

  mymodel_resource = Collection(
      queryset = MyModel.objects.all(),
      responder = XMLResponder()
  )

5. Add the resource to your URL patterns:

  urlpatterns = patterns('',
     # ...
     url(r'^xml/mymodel/(.*?)/?$', mymodel_resource)
   )

Voilà! Your XML API is ready at http://yourhost/xml/mymodel/.

Support

Means to get support, in order of preference:

  1. Official google group: http://groups.google.com/group/django-rest/topics
  2. Raise an issue with the issue tracker: http://code.google.com/p/django-rest/issues/list
  3. Clone the repository and make the changes yourself (and I would love to integrate them)
  4. Contact me, Andriy Drozdyuk, directly through drozzy with gmail com

About

This is a clone of django-rest-interface: http://code.google.com/p/django-rest-interface/

Why

Hopefully this clone will allow for quicker and easier patch integration, because it is hosted with mercurial.

Original Credit

Andreas Stuhlmüller

Powered by Google Project Hosting