Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Django-piston - A mini-framework for Django for creating RESTful APIs (bitbucket.org/jespern)
50 points by jespern on May 1, 2009 | hide | past | favorite | 9 comments


Awesome! I've been using django-oauth for sometime now, been looking at django-restapi and so on. But this takes the best of both worlds. And I especially like that it is not tied to the data models, so this means we can build in some business logic.


And I especially like that it is not tied to the data models, so this means we can build in some business logic.

Can you elaborate? I'm doing my first big django project now and am looking for lessons from others!


See Jacob's post here: http://jacobian.org/writing/rest-worst-practices/

Basically, it's a bad idea to couple something like django-piston too tightly to the underlying models because in any even moderately useful API there will be plenty of resources you want to expose that are actually cobbled together from various different models (or even other storage locations such as a search index or external web service).


FWIW, I switch from django-rest-interface to django-piston. The models are very similar, but I think piston is a little cleaner. It also seems to be a little more actively developed (at least, according to the source histories).


Well, a lot of the requested changes now require a re-write. And I don't have time for it, unless a project comes along and requires just that. I am not sure what to do about it other than hope someone would help.


I was just looking at Django REST apis last night but didn't find this one. This seems really similar to django-rest-interface, except for the oauth. Anybody know the potential upside/downside to this versus djang-rest-interface?


"The Django REST interface makes it easy to offer private and public APIs for existing Django models."

Piston doesn't tie you to a model (although it can), which is very important for any decent sized API. Exposing models is something you want half the time, but there's a lot more to it.


Haven't tried this out yet, but I'm very optimistic from reading the documentation.


Yo dawg, I heard you like frameworks.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: