File Storage¶
Gandom uses Django's STORAGES setting for file storage. Create a bucket in a S3-compatible cloud service, and set the following configuration options:
STORAGE_ENDPOINT_URL: S3 endpoint URL. Default:https://s3.ir-thr-at1.arvanstorage.irSTORAGE_KEY: Access key. Default: emptySTORAGE_SECRET: Secret key. Default: emptySTORAGE_BUCKET_NAME: Bucket name. Default:gandom
Separating Buckets¶
It is recommended to use multiple buckets with specific configurations for each class of files. For example the bucket containing backups should be separated from the bucket used for serving profile pictures, with more strict security options and versioning guarantees. By default Gandom uses a top-level folder for each class of files, so a single bucket can be used for all files for convenience, but it is strongly advised to at least separate the bucket used for each class of files. The classes of files used in Gandom are described below:
- STATICFILES: Used for serving frontend assets for web pages (public).
- LOGOS: Used for storing avatar pictures and logos for parties (private).
- BACKUPS: Used for storing backup files of the system data (sensitive).
For each class of files, you can set a specific option using the class name as prefix. For example setting BACKUPS_STORAGE_BUCKET_NAME changes the bucket for storing backup files. Any unset option for a class defaults to the shared configuration options.