5 ms·
What have you found to be the best way to implement a REST interface? I noticed the @ajax_request shortcut but nothing response code specific. I've been using D
by mikhuang 15y ago
What have you found to be the best way to implement a REST interface? I noticed the @ajax_request shortcut but nothing response code specific. I've been using Django-Piston which has been... challenging at best.
- jamie 15y agoYou might like tastypie: https://github.com/toastdriven/django-tastypie https://github.com/toastdriven/django-tastypie
- true_religion 15y agoIf your rest interface is deeply tied to the Django DB, I'd suggest TastyPie. Otherwise Django-Piston sadly is the way to go.
- niels 15y agoI find it to be exactly the opposite. Django Tastypie is in no way tied to the Django Orm.
- true_religion 15y agoIt's not intrinsically tied to the ORM. Sorry if I gave that impression. However it has many helpful shims and subclasses that interface with the ORM. I'm looking at ModelResource as my example. If you aren't working with a NoSQL database or a search engine, or grabbing data from an tertiary resource then the sheer complexity found in TastyPie might not be for you. Django-Piston doesn't offer many features, but its dead simple in its usage.
- niels 15y agoYep, I agree. Tastypie has a steeper learning curve, due to beeing more flexible. When I used Piston, jespern was not actively maintaining it, but using a private branch for bitbucket.
- deleted 15y ago[deleted]
- niels 15y agoI have used both Piston and Tastypie, and by far prefer Tastypie. Tastypie is actively maintained and super flexible. It gets you working out of the box with the django ORM, but also has the hooks to plug in everything you want.