#26029: Provide an API to configure arbitrary file storage backends
-------------------------------------+-------------------------------------
Reporter: Aymeric Augustin | Owner: Jarosław
| Wygoda
Type: New feature | Status: assigned
Component: File | Version: dev
uploads/storage |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Jarosław Wygoda):
I'd like to introduce a file storage registry similar to
BaseConnectionHandler (django/utils/connection.py) and EngineHandler
(django/template/utils.py).
Example settings.py snippet:
{{{
STORAGES = { # rename to FILE_STORAGES to make it more explictit?
'example': {
'BACKEND': 'django.core.files.storage.FileSystemStorage',
'OPTIONS': {
'location': '/example',
'base_url': '/example/',
},
},
}
}}}
Changes introduced by this pr are backward compatible. Users can still use
existing settings to configure static and media storages.
Currently storages can be retrieved from the following objects:
django/core/files/storage.py:
* get_storage_class
* DefaultStorage
* default_storage
django/contrib/staticfiles/storage.py:
* ConfiguredStorage
* staticfiles_storage
What do you think about deprecating them?
I'll write tests and docs if this approach is acceptable.
https://github.com/django/django/pull/15610
--
Ticket URL: <https://code.djangoproject.com/ticket/26029#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018041d601cf-ba891204-1ac6-436d-9e21-e683d0073e40-000000%40eu-central-1.amazonses.com.