

Django-piston - A mini-framework for Django for creating RESTful APIs - jespern
http://bitbucket.org/jespern/django-piston/wiki/Home

======
swaroop
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.

~~~
j2d2
_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!

~~~
simonw
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).

------
TJensen
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).

~~~
scorpioxy
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.

------
TJensen
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?

~~~
jespern
"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.

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

------
henning
Yo dawg, I heard you like frameworks.

