|
Project Information
Featured
Links
|
WhatThe 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. How1. 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/. SupportMeans to get support, in order of preference:
AboutThis is a clone of django-rest-interface: http://code.google.com/p/django-rest-interface/ WhyHopefully this clone will allow for quicker and easier patch integration, because it is hosted with mercurial. Original CreditAndreas Stuhlmüller |