I have been using django-rest-framework for creating services that work with the models. Now I need to create a service that receives some data, evaluates it and sends a notification email. It has been difficult to find such use case in django-rest-framework documentation and I think Function based views(at http://www.django-rest-framework.org/api-guide/views#function-based-views) would be the best approach but not sure if it is. There is very few documentation of it around. Which would be the best way to implement such service?
0
votes
Just to clarify: your function will be receiving data from an external API? Will it be initiated by some sort of request by a user or more of an automated background task?
– Alex
The function I want to publish as a service will be receiving data from an angularJS application and process it in order to send a notification.
– Orlando
1 Answers
0
votes
The default DRF APIView
knows nothing about models, as ViewSet
and GenericViewSet
.
The DRF function based views are only syntactic sugar on the default APIView
.
The one you should use depends on your functionality, perhaps have a look at the docs for clarity.