title: How to call asynchronous function in Django?
body: <p>The following doesn't execute <code>foo</code> and gives
  <code>RuntimeWarning: coroutine 'foo' was never awaited</code></p>
  <pre><code># urls.py
  
  async def foo(data):
      # process data ...
  
  @api_view(['POST'])
  def endpoint(request):
      data = request.data.get('data')
      
      # How to call foo here?
      foo(data)
  
      return Response({})
  </code></pre>