RESTful interfaces in Django
I'm willing to build a restful service using Django, I'm coming form RoR background and facing some problems that could be defined using the following questions:
- What package do you recom开发者_JAVA百科mend to use to have RESTful interfaces?
- Is there a way to make nested resources like a post HTTP request to /posts/post_id/comments that adds a new comment ?
- Is there a way to add some extra actions out of the CRUD set, like having extra method called
notify
onPost
resource that works on post HTTP request.
Cheers,
1) Check out django piston. 2) Yes, you set it up in your urls list. 3) Yes, this is straightforward to do in your view.
Django Piston: http://bitbucket.org/jespern/django-piston/wiki/Home
I would say that you can do a lot just by implementing your own views that present theirselfs in a RESTful way.
But, there is a project called piston that seems to be exactly what you're looking for: "A mini-framework for Django for creating RESTful APIs".
精彩评论