I am implementing a feature in django where file uploaded by user should be saved in both local system and remote server location also.
I am able to do both the process individually but not together.
Is there any way we can upload a file to both the location local and remote?
Django version - 3.0
You can specify storage for each FileField (doc) So create two FileField fields in your model and set required storage for each one.
Example if your default storage is local and your remote storage's name is S3Storage:
class MyModel(models.Model):
local_copy = models.FileField(upload_to="uploads")
remote_copy = models.FileField(upload_to="uploads", storage=S3Storage)