Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

point to docs for all configuration #1288

Merged
merged 1 commit into from
Sep 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 1 addition & 43 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,49 +25,7 @@ hasn't been released yet) then the magic incantation you are looking for is:

pip install -e 'git+https://github.com/jschneier/django-storages.git#egg=django-storages'

Once that is done, if using Django 4.1 or earlier, set ``DEFAULT_FILE_STORAGE`` to the backend of your choice.
If, for example, you want to use the boto3 backend you would set:

.. code-block:: python

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'

For Django 4.2 or later, set the ``default`` value in ``STORAGES`` to the backend of your choice. For example:

.. code-block:: python

STORAGES = {
'default': {
'BACKEND': 'storages.backends.s3boto3.S3Boto3Storage',
},
'staticfiles': {
# Leave whatever setting you already have here, e.g.:
'BACKEND': 'django.contrib.staticfiles.storage.StaticFilesStorage',
}
}


If you are using the ``FileSystemStorage`` as your storage management class in your models ``FileField`` fields, remove them
and don't specify any storage parameter. That way, the ``DEFAULT_FILE_STORAGE`` class will be used by default in your field.
For example, if you have a `photo` field defined as:

.. code-block:: python

photo = models.FileField(
storage=FileSystemStorage(location=settings.MEDIA_ROOT),
upload_to='photos',
)

Set it to just:

.. code-block:: python

photo = models.FileField(
upload_to='photos',
)

There are also a number of settings available to control how each storage backend functions,
please consult the documentation for a comprehensive list.
For detailed instructions on how to configure the backend of your choice please consult the documentation.

About
=====
Expand Down
Loading