1

I will be uploading files using a cron job on a server. If my server gets full, I will add another hard disk to add the new files there. I am building a metadata file for these uploaded files. At any point of time I would like to be able to download these files from the model form using MEDIA_URL.

At such a point of time the MEDIA_ROOT needs to be able to access both the paths if the 2 disks are added. How could this be resolved? I am aware of the urls where dynamic folders can be created to add the files at run time but not change the MEDIA_ROOT.

Is there any alternate solution? Using django 1.6.5, I have referred to the following urls:

Changing Django settings at runtime

how to access media root in py file

Community
  • 1
  • 1
user956424
  • 1,611
  • 2
  • 37
  • 67
  • 3
    Write your own file storage backend, don't try to hack like this as how globals work depend on your web server process/thread model. – Mikko Ohtamaa Jul 20 '15 at 07:07
  • @MikkoOhtamaa thank you for your response, can you please elaborate. I am working on linux where the destination folder can be configured using GUI for storing the uploaded files – user956424 Jul 20 '15 at 07:17
  • 1
    Please see https://docs.djangoproject.com/en/1.8/howto/custom-file-storage/ - it's a complex topic so you need to split it to smaller subproblems – Mikko Ohtamaa Jul 20 '15 at 18:02

0 Answers0