diff --git a/docs/admin/guides/configure-pulp/configure-storages.md b/docs/admin/guides/configure-pulp/configure-storages.md index 75a22a2ad60..5dde211ad74 100644 --- a/docs/admin/guides/configure-pulp/configure-storages.md +++ b/docs/admin/guides/configure-pulp/configure-storages.md @@ -75,6 +75,7 @@ Here is an example configuration that will use a bucket called `pulp3` that is h region `eu-central-1`: ```python +MEDIA_ROOT = "" STORAGES = { "default": { "BACKEND": "storages.backends.s3.S3Storage", @@ -88,7 +89,6 @@ STORAGES = { }, }, } -MEDIA_ROOT = "" ``` Compreheensive options for Amazon S3 can be found in @@ -125,20 +125,20 @@ pip install django-storages[azure] #### Configure ```python +MEDIA_ROOT = "" STORAGES = { "default": { "BACKEND": "storages.backends.azure_storage.AzureStorage", "OPTIONS": { "account_name": '', - "container": '', # As created within the blob service of your storage account + "azure_container": '', # As created within the blob service of your storage account "account_key": '', # From the access keys of your storage account - "url_expiration_secs": 60, + "expiration_secs": 60, "overwrite_files": 'True', "location": '' # The folder within the container where your pulp objects will be stored }, }, } -MEDIA_ROOT = "" ``` Compreheensive options for Azure Blob can be found in diff --git a/docs/admin/reference/settings.md b/docs/admin/reference/settings.md index bb4d3082241..09a884f073e 100644 --- a/docs/admin/reference/settings.md +++ b/docs/admin/reference/settings.md @@ -71,10 +71,17 @@ For a zero downtime key rotation you can follow the slightly more complex recipe By default Pulp uses PostgreSQL on localhost. PostgreSQL is the only supported database. For instructions on how to configure the database, refer to `database installation `. +### DEFULT_FILE_STORAGE + +!!! warning "Removed in `3.70`" + The `DEFAULT_FILE_STORAGE` setting was deprecated in + [django `4.2`](https://docs.djangoproject.com/en/4.2/ref/settings/#default-file-storage). + Use [`STORAGES`](#STORAGES) instead. + ### STORAGES -!!! warning "Changed in `3.70`" - This replaces `DEFAULT_FILE_STORAGE` which [was deprecated in django `4.2`](https://docs.djangoproject.com/en/4.2/ref/settings/#default-file-storage). +!!! note "Added in `3.70`" + Replaces [`DEFAULT_DJANGO_STORAGES`](#DEFULT_FILE_STORAGE). Pulp uses [django-storages](https://django-storages.readthedocs.io/en/latest/index.html) to support multiple storage backends. If no backend is configured, Pulp will by default use the local filesystem (`pulpcore.app.models.storage.FileSystem`). diff --git a/pulpcore/app/settings.py b/pulpcore/app/settings.py index 2ac34a94a08..38ca4b23f6d 100644 --- a/pulpcore/app/settings.py +++ b/pulpcore/app/settings.py @@ -369,10 +369,10 @@ # Validators storage_validator = ( Validator("REDIRECT_TO_OBJECT_STORAGE", eq=False) - | Validator("STORAGES.default", eq="pulpcore.app.models.storage.FileSystem") - | Validator("STORAGES.default", eq="storages.backends.azure_storage.AzureStorage") - | Validator("STORAGES.default", eq="storages.backends.s3boto3.S3Boto3Storage") - | Validator("STORAGES.default", eq="storages.backends.gcloud.GoogleCloudStorage") + | Validator("STORAGES.default.BACKEND", eq="pulpcore.app.models.storage.FileSystem") + | Validator("STORAGES.default.BACKEND", eq="storages.backends.azure_storage.AzureStorage") + | Validator("STORAGES.default.BACKEND", eq="storages.backends.s3boto3.S3Boto3Storage") + | Validator("STORAGES.default.BACKEND", eq="storages.backends.gcloud.GoogleCloudStorage") ) storage_validator.messages["combined"] = ( "'REDIRECT_TO_OBJECT_STORAGE=True' is only supported with the local file, S3, GCP or Azure"