Media Files
Start by creating an object storage on Sevalla. Settings contains all the values needed for your storages settings.Install
Before your media files can be uploaded to object storage, thedjango-storages library must be added to your dependencies. Sevalla’s object storage is S3-compatible, so the s3 extra should be included when installing, which installs boto3 for you.
Settings
You need to add the storages settings tosettings.py. Both the signature version of s3v4 and the storages.backends.s3.S3Storage are necessary for Django to properly use the object storage.
You can use your preferred method for defining configuration values for access_key, secret_key, bucket_name, and endpoint_url. django-environ is used for this example.
custom_domain to your storages settings dictionary.
Static Files
Static files can also be placed in an object storage instead of being served directly from your app with WhiteNoise. If you will have both media files and static files served from an object store, you should use a separate object storage for each type. Start by creating a new object storage on Sevalla. To fully support all the static files used for the admin dashboard, you should make your static file object store public.Settings
Add separate settings forstaticfiles in the STORAGES dictionary.
STATIC_URL setting when STORAGES is set but still requires it, so for clarity, you may want to add the proper STATIC_URL to settings.py .
The collectstatic command will take longer to run because the static files need to be uploaded to the object storage.