Michal Čihař - Adding API to Django application

Adding API to Django application

One of Django applications I maintain is our internal tool used at SUSE used for managing incoming L3 requests. Recently request to add some API arose (read only for now). Looking at available solutions, I came to conclusion that django-piston should be the best choice for me.

Adding simple model based API with it is indeed quite simple, all basic information you need is written in getting started part of their documentation.

On the other side, things can never go without problems, so I was hit by well known bug. Fortunately fix exists, though it is not yet merged upstream. While digging so deep into problem anyway, I've submitted a request to include this patch in devel:languages:python OBS repo.

Comments

Ewoud Kohl van Wijngaarden wrote on Jan. 6, 2012, 12:31 p.m.

At an internal project at my employer we started with django-piston, but in my experience that gets annoying very fast. I highly prefer django-rest-framework (http://django-rest-framework.org/). It has a more active upstream and the generated HTML view proves to be very useful while developing.

wrote on Jan. 6, 2012, 12:58 p.m.

Thanks for the tip, I'll look at it soon (it's still early enough to completely change implementation without much effort).

Ivo Majić wrote on Jan. 6, 2012, 2:20 p.m.

Also something you should look into is django-tastypie...it's more actively developed than Pistons...

wrote on Jan. 6, 2012, 3:09 p.m.

That one also looks interesting ... why there are so many? :-)