summaryrefslogtreecommitdiff
path: root/docs/ref
diff options
context:
space:
mode:
Diffstat (limited to 'docs/ref')
-rw-r--r--docs/ref/contrib/staticfiles.txt1
-rw-r--r--docs/ref/files/storage.txt6
-rw-r--r--docs/ref/settings.txt38
3 files changed, 45 insertions, 0 deletions
diff --git a/docs/ref/contrib/staticfiles.txt b/docs/ref/contrib/staticfiles.txt
index 7ca3584c33..08fc23bdb1 100644
--- a/docs/ref/contrib/staticfiles.txt
+++ b/docs/ref/contrib/staticfiles.txt
@@ -23,6 +23,7 @@ Settings
See :ref:`staticfiles settings <settings-staticfiles>` for details on the
following settings:
+* :setting:`STORAGES`
* :setting:`STATIC_ROOT`
* :setting:`STATIC_URL`
* :setting:`STATICFILES_DIRS`
diff --git a/docs/ref/files/storage.txt b/docs/ref/files/storage.txt
index fa79a4f91a..d5daccf834 100644
--- a/docs/ref/files/storage.txt
+++ b/docs/ref/files/storage.txt
@@ -9,6 +9,12 @@ Getting the default storage class
Django provides convenient ways to access the default storage class:
+.. data:: storages
+
+ .. versionadded:: 4.2
+
+ Storage instances as defined by :setting:`STORAGES`.
+
.. class:: DefaultStorage
:class:`~django.core.files.storage.DefaultStorage` provides
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index b1a8e2444d..d1b638f4b6 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -2606,6 +2606,43 @@ Silenced checks will not be output to the console.
See also the :doc:`/ref/checks` documentation.
+.. setting:: STORAGES
+
+``STORAGES``
+------------
+
+.. versionadded:: 4.2
+
+Default::
+
+ {}
+
+A dictionary containing the settings for all storages to be used with Django.
+It is a nested dictionary whose contents map a storage alias to a dictionary
+containing the options for an individual storage.
+
+Storages can have any alias you choose.
+
+The following is an example ``settings.py`` snippet defining a custom file
+storage called ``example``::
+
+ STORAGES = {
+ # ...
+ "example": {
+ "BACKEND": "django.core.files.storage.FileSystemStorage",
+ "OPTIONS": {
+ "location": "/example",
+ "base_url": "/example/",
+ },
+ },
+ }
+
+``OPTIONS`` are passed to the ``BACKEND`` on initialization in ``**kwargs``.
+
+A ready-to-use instance of the storage backends can be retrieved from
+:data:`django.core.files.storage.storages`. Use a key corresponding to the
+backend definition in :setting:`STORAGES`.
+
.. setting:: TEMPLATES
``TEMPLATES``
@@ -3663,6 +3700,7 @@ File uploads
* :setting:`FILE_UPLOAD_TEMP_DIR`
* :setting:`MEDIA_ROOT`
* :setting:`MEDIA_URL`
+* :setting:`STORAGES`
Forms
-----