title: Django rest framework execute custom function without viewset (remote procedure call)
body: <p>I'm triying to do a remote procedure call  (regular call to server by ajax) from AJAX to a Django server with <strong>Django Rest Framework (DRF)</strong> for maintenance tasks.</p>
  
  <h2>Problem</h2>
  
  <p>I only have model viewsets and only need to execute a basic server task, for example, delete all items in one model.</p>
  
  <h2>Solution</h2>
  
  <p>Use generic apiview from DRF. See code on answer below.</p>