Sorry to digress a bit here, but I would
disagree that remote method invocations as described here is
"SOAP-style". It is not "RESTful", but by no means does it need to be
anything like SOAP (
https://en.wikipedia.org/wiki/SOAP ).
I
think the technical term for this kind of style of "method invocation"
over an API would be similar to "RPC" - or Remote-Procedure-Calls,
something like
https://en.wikipedia.org/wiki/JSON-RPC
I
think debating the pros and cons of these styles can be endless :-) -
personally, I like to stick to RESTful patterns wherever possible, but
for the case described here where the user just wants to pass in some
parameters and get a response, and this is not tied to a data model per
se, I also think forcing a RESTful approach on something that you
really want to think about as "I want to pass in two parameters to a URL
and get a response" often adds complexity.
In
this case, Hanz, personally my advice would be to start with a very
simple implementation of this so you understand how the parts work, and
then add framework as needed.
IMHO, the
"simplest" implementation would be to just use plain django, have an
entry in your urls.py that points to a view function. In your view
function, you simply read your GET or POST parameters from the request,
perform your computations in python code, and return some JSON as
response (you can use a JsonResponse object:
https://docs.djangoproject.com/en/1.11/ref/request-response/#jsonresponse-objects
) .
When doing something similar with Django
Rest Framework, I have used the api_view decorator:
https://www.django-rest-framework.org/api-guide/views/#api_view - this
lets one write simple functions mapped to URLs, and reduces boilerplate
you may have across these different view functions. Hopefully the examples there make sense to get you started.