title: Django/Python: execute code (sending email) without waiting for it to finish then immediately response to the client side
body: <p>My question is basically the Python version of <a href="https://stackoverflow.com/questions/12941168/send-email-without-waiting-for-the-action-to-finish-execution">this question</a>:</p>
  <p>code structure:</p>
  <pre><code>def save(request):
      if request.method == 'POST':
          ...
          email_obj.save()  # write data into database
  
          # the below sendmail step takes too long to finish
          # how to execute it without waiting for it to finish
          # then immediately run the last step: return render(request, 'success.html')
          sendmail(email_obj)  # 
  
          return render(request, 'success.html')
  </code></pre>