Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

Django REST interface

License: New BSD License URL: http://code.google.com/p/django-rest-interface/ Contact: Andreas StuhlmŸller <andreas@stuhlmueller.info>

The django-rest-interface project includes two parts:

  1. The REST interface: django_restapi

resource.Resource is the generic class for REST resources. Use this class for resources that don't necessarily map 1:1 to Django models. model_resource.Collection and model_resource.Entry are specific implementations that map resources 1:1 to Django models.

receiver contains classes that allow you to modify the content type that is expected by model resources for PUT/POST submissions (e.g. form submission MIME types, XML, JSON, ...).

responder contains classes you can use to choose which type of output format model resources return. For instance, add "responder = XMLResponder()" to the constructor call of a resource in urls.py in order to use XML as a data format.

authentication contains classes you can use to choose which type of authentication is required to access your API. For instance, add "authentication = HttpBasicAuthentication()" to the constructor call of a resource in urls.py in order to use HTTP Basic authentication. The default authfunc authenticates username and password against django.contrib.auth.models.User.

  1. Tests: django_restapi_tests

Contains API tests. Run "python ./manage.py test" in order to execute the REST interface unit tests.

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.