4 ms·
You can directly implement views based on the request method with django's class based views (View) in 1.3. The dispatch method does almost exactly what your re
by izak30 15y ago
You can directly implement views based on the request method with django's class based views (View) in 1.3.
The dispatch method does almost exactly what your restful function does.
Just inherit from View, and define get(), post(), etc.
- deleted 15y ago[deleted]
- joshontheweb 15y agoI was going to suggest this as well. Each resource can be a class that has a function defined for each method.
- rlander 15y agoOr you could create restful APIs simply with django-piston, django-tastypie or (my new personal favorite) django-dagny.
- izak30 15y agoYes, and there is already a decent wrapper for backbone and tastypie http://joshbohde.com/blog/backbonejs-and-django http://joshbohde.com/blog/backbonejs-and-django This is my personal favorite.
- rlander 15y agoNice tutorial, thanks!
- numix 15y agoThanks for the recommendation! I'm glad you like it. As far as wrappers for backbone and tastypie, I think https://github.com/PaulUithol/backbone-tastypie https://github.com/PaulUithol/backbone-tastypie is a pretty good starting point, and a little more complete than what I wrote there.
- izak30 15y agoOh, I thought they were related until now. This one is actually what I _use_. Yours is what came up in a search.
- jsdalton 15y agoI'll throw Django REST Framework in the mix there as well: http://django-rest-framework.org/ http://django-rest-framework.org/ Why? See http://django-rest-framework.org/howto/alternativeframeworks.html#why-use-django-rest-framework http://django-rest-framework.org/howto/alternativeframeworks...