Skip to content

Commit

Permalink
chore: make all backends point to S3 in the documentation example
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanboniface committed Dec 13, 2024
1 parent 45a0ec5 commit 7c80839
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions docs/config/storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,40 @@ Then, change the `STORAGES` settings with something like this:
```
STORAGES = {
"default": {
"BACKEND": "django.core.files.storage.FileSystemStorage",
"BACKEND": "storages.backends.s3.S3Storage",
"OPTIONS": {
"access_key": "xxx",
"secret_key": "yyy",
"bucket_name": "umap-pictograms",
"endpoint_url": "http://127.0.0.1:9000",
},
},
"data": {
# Whatch out, this is a dedicated uMap class!
"BACKEND": "umap.storage.s3.S3DataStorage",
"OPTIONS": {
"access_key": "xxx",
"secret_key": "yyy",
"bucket_name": "umap",
"region_name": "eu",
"bucket_name": "umap-data",
"endpoint_url": "http://127.0.0.1:9000",
},
},
"staticfiles": {
"BACKEND": "umap.storage.staticfiles.UmapManifestStaticFilesStorage",
"BACKEND": "storages.backends.s3.S3Storage",
"OPTIONS": {
"access_key": "xxx",
"secret_key": "yyy",
"bucket_name": "umapstatics",
"endpoint_url": "http://127.0.0.1:9000",
},
},
}
```

As you can see in this example, both `staticfiles` and `default` use the storage class provided
by `django-storages` (`storages.backends.s3.S3Storage`), but the `data` one uses a specific class
(`umap.storage.s3.S3DataStorage`).

In order to store old versions of a layer, the versioning should be activated in the bucket.

See more about the configuration on the [django-storages documentation](https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html).

0 comments on commit 7c80839

Please sign in to comment.