File transfer between application and media server

I have a multi-server setup, with two mailboxes serving dynamic requests via Django, and a static / media file serving NginX.

My question is: what is the recommended way to transfer downloaded media files from django fields to a media server?

The main problem is files downloaded through the administrator. All content created by users is placed in the celery queue, which retrieves files using sftp and resizes them. However, files uploaded to the administrator must be processed in the request so that they are ready when the contents change.

I tried two options:

  • Using the sftp backend of django repositories. This gives me errors at the heart of paramiko.
  • Using NFS mount, which gave me a lot of headaches with permissions.

So what is the recommended way? Or how do other people do it? SFTP, SCP, SSHFS, NFS, CIFS, WebDav, etc.

+3
source share
1 answer

Are your files uploaded to any models? If so, install the media on your media server, and when you create / save the object defined in the models.py file, which has a FileField with the downloaded file, it will automatically save it to the specified media. Here are the docs: https://docs.djangoproject.com/en/dev/topics/files/#the-built-in-filesystem-storage-class

0
source

All Articles