3 ms·
Yes, you can get djangorestframework to be used without being tied to any model, or even without tying it to a resource. In its current incarnation, djangorestf
by rglullis 15y ago
Yes, you can get djangorestframework to be used without being tied to any model, or even without tying it to a resource. In its current incarnation, djangorestframework just follows the principle from generic class-based views.
You just define a view that inherits from djangorestframework.views.View, and implement the action methods (get/post/put/delete) that you want. These methods must return a dictionary, and the framework handles the part of dispatch and render the view in the proper format.
- buss 15y agoThat was a really helpful answer, thanks! I'll be taking another look at djangorestframework; hopefully I didn't miss anything else.