@@ -6,9 +6,9 @@ pip install django-minio-storage
66
77Add ` minio_storage ` to ` INSTALLED_APPS ` in your project settings.
88
9- The last step is setting ` DEFAULT_FILE_STORAGE ` to
10- ` " minio_storage.storage.MinioMediaStorage" ` , and ` STATICFILES_STORAGE ` to
11- ` " minio_storage.storage.MinioStaticStorage" ` .
9+ The last step is setting ` STORAGES['default']['BACKEND'] ` to
10+ ` ' minio_storage.storage.MinioMediaStorage' ` , and ` STORAGES['staticfiles']['BACKEND'] ` to
11+ ` ' minio_storage.storage.MinioStaticStorage' ` .
1212
1313## Django settings Configuration
1414
@@ -18,7 +18,7 @@ The following settings are available:
1818 ` minio.example.org:9000 ` (note that there is no scheme)).
1919
2020- ` MINIO_STORAGE_ACCESS_KEY ` and ` MINIO_STORAGE_SECRET_KEY ` (mandatory)
21-
21+
2222- ` MINIO_STORAGE_REGION ` : Allows you to specify the region. By setting this
2323 configuration option, an additional HTTP request to Minio for region checking
2424 can be prevented, resulting in improved performance and reduced latency for
@@ -34,18 +34,18 @@ The following settings are available:
3434- ` MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET ` : whether to create the bucket if it
3535 does not already exist (default: ` False ` )
3636
37- - ` MINIO_STORAGE_ASSUME_MEDIA_BUCKET_EXISTS ` : whether to ignore media bucket
38- creation and policy.
37+ - ` MINIO_STORAGE_ASSUME_MEDIA_BUCKET_EXISTS ` : whether to ignore media bucket
38+ creation and policy.
3939 (default: ` False ` )
4040
4141- ` MINIO_STORAGE_AUTO_CREATE_MEDIA_POLICY ` : sets the buckets public policy
4242 right after it's been created by ` MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET ` .
4343 Valid values are: ` GET_ONLY ` , ` READ_ONLY ` , ` WRITE_ONLY ` , ` READ_WRITE ` and
4444 ` NONE ` . (default: ` GET_ONLY ` )
45-
45+
4646- ` MINIO_STORAGE_MEDIA_OBJECT_METADATA ` : set default additional metadata for
4747 every object persisted during save operations. The value is a dict with
48- string keys and values, example: ` {" Cache-Control": " max-age=1000" } ` .
48+ string keys and values, example: ` {' Cache-Control': ' max-age=1000' } ` .
4949 (default: ` None ` )
5050
5151- ` MINIO_STORAGE_STATIC_BUCKET_NAME ` : the bucket that will act as ` STATIC `
@@ -55,18 +55,18 @@ The following settings are available:
5555 does not already exist (default: ` False ` )
5656
5757
58- - ` MINIO_STORAGE_ASSUME_STATIC_BUCKET_EXISTS ` : whether to ignore the static bucket
59- creation and policy.
58+ - ` MINIO_STORAGE_ASSUME_STATIC_BUCKET_EXISTS ` : whether to ignore the static bucket
59+ creation and policy.
6060 (default: ` False ` )
6161
6262- ` MINIO_STORAGE_AUTO_CREATE_STATIC_POLICY ` : sets the buckets public policy
6363 right after it's been created by ` MINIO_STORAGE_AUTO_CREATE_STATIC_BUCKET ` .
6464 Valid values are: ` GET_ONLY ` , ` READ_ONLY ` , ` WRITE_ONLY ` , ` READ_WRITE ` and
6565 ` NONE ` . (default: ` GET_ONLY ` )
66-
66+
6767- ` MINIO_STORAGE_STATIC_OBJECT_METADATA ` : set default additional metadata for
6868 every object persisted during save operations. The value is a dict with
69- string keys and values, example: ` {" Cache-Control": " max-age=1000" } ` .
69+ string keys and values, example: ` {' Cache-Control': ' max-age=1000' } ` .
7070 (default: ` None ` )
7171
7272- ` MINIO_STORAGE_MEDIA_URL ` : the base URL for generating urls to objects from
@@ -110,13 +110,19 @@ The following settings are available:
110110STATIC_URL = ' /static/'
111111STATIC_ROOT = ' ./static_files/'
112112
113- DEFAULT_FILE_STORAGE = " minio_storage.storage.MinioMediaStorage"
114- STATICFILES_STORAGE = " minio_storage.storage.MinioStaticStorage"
113+ STORAGES = {
114+ ' default' : {
115+ ' BACKEND' : ' minio_storage.storage.MinioMediaStorage' ,
116+ },
117+ ' staticfiles' : {
118+ ' BACKEND' : ' minio_storage.storage.MinioStaticStorage' ,
119+ },
120+ }
115121MINIO_STORAGE_ENDPOINT = ' minio:9000'
116122MINIO_STORAGE_ACCESS_KEY = ' KBP6WXGPS387090EZMG8'
117123MINIO_STORAGE_SECRET_KEY = ' DRjFXylyfMqn2zilAr33xORhaYz5r9e8r37XPz3A'
118124MINIO_STORAGE_USE_HTTPS = False
119- MINIO_STORAGE_MEDIA_OBJECT_METADATA = {" Cache-Control" : " max-age=1000" }
125+ MINIO_STORAGE_MEDIA_OBJECT_METADATA = {' Cache-Control' : ' max-age=1000' }
120126MINIO_STORAGE_MEDIA_BUCKET_NAME = ' local-media'
121127MINIO_STORAGE_MEDIA_BACKUP_BUCKET = ' Recycle Bin'
122128MINIO_STORAGE_MEDIA_BACKUP_FORMAT = ' %c /'
0 commit comments