title: Hooking Django model intstance's save method to celery
body: <p>I am using S3 as a media storage in Django. The thing is, If the video is uploaded it takes too long to return the response in a view. I know there should be a way to make it async.</p>
  
  <p>snippet of <strong>view.py</strong></p>
  
  <pre><code>with transaction.atomic():
      media = Media(
          med_user_id=account,
          med_path=file,
          med_thumbnail=thumbnail,
          med_assoc_data=data,
      )
  
     save_async.delay(media)
  </code></pre>
  
  <p>variable <strong>file</strong> is a video with this class<code>&lt;class 'django.core.files.uploadedfile.TemporaryUploadedFile'&gt;</code></p>
  
  <p>when I am saving this by <code>media.save()</code> it takes 12-20 seconds to complete. I thought to create a celery task that could handle it. </p>
  
  <pre><code>@app.task(bind=True)
  def save_async(self, instance):
      instance.save()
  </code></pre>
  
  <p>I know this doesn't make any sense because it throws a serialization error. 
  <code>Object of type Media is not JSON serializable</code>
  so the question is. how should I make <code>model.save()</code> function async with celery?</p>
  
  <p>Thank you in advance.</p>