0👍
You need to set the STATICFILES_STORAGE setting
STATICFILES_STORAGE = 'path/to/custom_storages.StaticStorage'
If you are using wagtail (which I assume you do since you are tagging this question with it), you can place it in the default home/ directory and refer to it like so: ‘home/custom_storages.StaticStorage’
The content of custom_storages.py are stated in the guide you are following:
# custom_storages.py
from django.conf import settings
from storages.backends.s3boto import S3BotoStorage
class StaticStorage(S3BotoStorage):
location = settings.STATICFILES_LOCATION
Edit:
I have a GitHub repo (also a wagtail project) in which I am using this code, but only for my media files. You can check it here.
3👍
You can put custom_storages.py anywhere on your Python path. Django will try to find the class using the value of the STATICFILES_STORAGE setting, which in the example is ‘custom_storages.StaticStorage’. So Django will, in effect “import custom_storages” and use “custom_storages.StaticStorage” as the storage class. Just make sure you can “import custom_storages” and it should work.