title: Execute code after Response using Django's Async Views
body: <p>I'm trying to execute a long running function (ex: sleep(30)) after a Django view returns a response. I've tried implementing the solutions suggested to similar questions:</p>
  <ul>
  <li><a href="https://stackoverflow.com/questions/56200432/how-to-execute-code-in-django-after-response-has-been-sent-to-the-client-on-pyt">How to execute code in Django after response has been sent</a></li>
  <li><a href="https://stackoverflow.com/questions/4313508/execute-code-in-django-after-response-has-been-sent-to-the-client">Execute code in Django after response has been sent to the
  client</a></li>
  </ul>
  <p>However, the client's page load only completes after the long running function completes running when using a WSGI server like gunicorn.</p>
  <p>Now that Django <a href="https://docs.djangoproject.com/en/3.1/releases/3.1/#asynchronous-views-and-middleware-support" rel="nofollow noreferrer">supports asynchronous views</a> is it possible to run a long running query asynchronously?</p>