3👍
Remember, REST does not equal JSON. If I require your representation in text/html
, you should be able to provide me with that, or else throw a 415.
A better solution, then you are currently using, is to use the middleware functionality that Django provides. Whatever your view replies, use Djangos middleware functionality for the response to encode into JSON, XML or whatever.
2👍
I personally prefer defining my own ajax views and json objects. Using some already apis developed may be or may not be of much use. Some don’t exactly fulfill the requirements some may have features which are redundant (And I don’t like a code to be present which is not being used).
Also writing ajax functionality is not that difficult either. The inbuilt serializers
/ request.is_ajax
features are there for your help.
Some examples for ajax implementation with django/jquery: http://webcloud.se/log/AJAX-in-Django-with-jQuery/ (You most probably have seen it already)
- [Django]-How do I html format my blog post in django?
- [Django]-Show children nodes depending on selected parent
- [Django]-Django Many-To-One relationship filter set
- [Django]-Check if a non-nullable field is null
- [Django]-How to use check_password function in django