title: Django and REST API to serve calculation-based requests
body: <p>I wrote a machine learning application in Django so a user can specify in a form some parameters and train a model. Once the model is trained, I want to serve requests like:</p>
  
  <pre><code>curl http://localhost:8000/.../?model_input='XYZ' 
  </code></pre>
  
  <p>and I want Django returns the output of the model given the input XYZ. Every example I saw from Tastypie or REST framework builds its response from a queryset. How can I proceed if the response is not the result of a queryset but the result of in-memory pure calculation? In my case, the response is the result of a matrix multiplication (the trained model) by a vector (the input) and this result is not stored in a table.</p>
  
  <p>What is the recommended way to manage such requests?
  Any help is greatly appreciated.
  Regards,
  Patrick</p>