I plan on having multiple Django (Wagtail) apps on my DigitalOcean stack each handling hundreds of large images (media files in general). Normally, I use the default Django media storage settings which stores all of it on the disk of the DO Droplet inside the project directory, but I want to dip my toes into implementing S3 with DO Spaces.
DO Spaces offers 250GB shared between the amount of Spaces instances you create and also offers a CDN which seems quite easy to set up (at least on DO’s side).
I am concerned that my Django projects may eat up a lot of this storage allocation, therefore I want to be able to limit each of my Django apps to only use a maximum of 25GB. I will create a management command which will delete old media files and will be run by the DO Droplet as a cron job.
Is there a way to limit the maximum storage limit for one “space”?
Is there a way to set the maximum storage limit for each Django project with django-storages?
What is the best way to achieve this?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.