Search code examples
pythondjangoapirestdjango-piston

RESTful APIs for Django projects/apps


What do you prefer when you want to "RESTify" your Django project in Django?

I came to the conclusion that there are really three options to do that:

Right way to do this for me would be to try all of'em and pick the one that is best for me, so meanwhile I'd like to hear yours...

Thanks.


Solution

  • I'm most familiar with django-piston, so I would naturally steer you in that direction.

    A quick glance at the other two, though, indicates that django-rest-interface does nothing more than expose models as resources, and that django-restful-resources is some guy's one-off attempt at the same.

    Piston, if I recall correctly, grew out of bitbucket.org's own site development, and allows a lot of flexibility - you can return almost any object from your resource's access methods, not just model instances, and it will be properly encoded. It also has built-in support for some nice features, like form validation (if you can get it to work right, anyway) and request throttling, among other things.