@@ -6,9 +6,9 @@ pip install django-minio-storage
6
6
7
7
Add ` minio_storage ` to ` INSTALLED_APPS ` in your project settings.
8
8
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' ` .
12
12
13
13
## Django settings Configuration
14
14
@@ -18,7 +18,7 @@ The following settings are available:
18
18
` minio.example.org:9000 ` (note that there is no scheme)).
19
19
20
20
- ` MINIO_STORAGE_ACCESS_KEY ` and ` MINIO_STORAGE_SECRET_KEY ` (mandatory)
21
-
21
+
22
22
- ` MINIO_STORAGE_REGION ` : Allows you to specify the region. By setting this
23
23
configuration option, an additional HTTP request to Minio for region checking
24
24
can be prevented, resulting in improved performance and reduced latency for
@@ -34,18 +34,18 @@ The following settings are available:
34
34
- ` MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET ` : whether to create the bucket if it
35
35
does not already exist (default: ` False ` )
36
36
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.
39
39
(default: ` False ` )
40
40
41
41
- ` MINIO_STORAGE_AUTO_CREATE_MEDIA_POLICY ` : sets the buckets public policy
42
42
right after it's been created by ` MINIO_STORAGE_AUTO_CREATE_MEDIA_BUCKET ` .
43
43
Valid values are: ` GET_ONLY ` , ` READ_ONLY ` , ` WRITE_ONLY ` , ` READ_WRITE ` and
44
44
` NONE ` . (default: ` GET_ONLY ` )
45
-
45
+
46
46
- ` MINIO_STORAGE_MEDIA_OBJECT_METADATA ` : set default additional metadata for
47
47
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' } ` .
49
49
(default: ` None ` )
50
50
51
51
- ` MINIO_STORAGE_STATIC_BUCKET_NAME ` : the bucket that will act as ` STATIC `
@@ -55,18 +55,18 @@ The following settings are available:
55
55
does not already exist (default: ` False ` )
56
56
57
57
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.
60
60
(default: ` False ` )
61
61
62
62
- ` MINIO_STORAGE_AUTO_CREATE_STATIC_POLICY ` : sets the buckets public policy
63
63
right after it's been created by ` MINIO_STORAGE_AUTO_CREATE_STATIC_BUCKET ` .
64
64
Valid values are: ` GET_ONLY ` , ` READ_ONLY ` , ` WRITE_ONLY ` , ` READ_WRITE ` and
65
65
` NONE ` . (default: ` GET_ONLY ` )
66
-
66
+
67
67
- ` MINIO_STORAGE_STATIC_OBJECT_METADATA ` : set default additional metadata for
68
68
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' } ` .
70
70
(default: ` None ` )
71
71
72
72
- ` MINIO_STORAGE_MEDIA_URL ` : the base URL for generating urls to objects from
@@ -110,13 +110,19 @@ The following settings are available:
110
110
STATIC_URL = ' /static/'
111
111
STATIC_ROOT = ' ./static_files/'
112
112
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
+ }
115
121
MINIO_STORAGE_ENDPOINT = ' minio:9000'
116
122
MINIO_STORAGE_ACCESS_KEY = ' KBP6WXGPS387090EZMG8'
117
123
MINIO_STORAGE_SECRET_KEY = ' DRjFXylyfMqn2zilAr33xORhaYz5r9e8r37XPz3A'
118
124
MINIO_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' }
120
126
MINIO_STORAGE_MEDIA_BUCKET_NAME = ' local-media'
121
127
MINIO_STORAGE_MEDIA_BACKUP_BUCKET = ' Recycle Bin'
122
128
MINIO_STORAGE_MEDIA_BACKUP_FORMAT = ' %c /'
0 commit comments