-
Notifications
You must be signed in to change notification settings - Fork 1
Setup
Install the simple-storage package:
pip install simple-storageSelect the storage type by setting the STORAGES_BACKEND environment variable to one of the following values:
-
storages.backends.file_system.FileSystemStorage- for File System Storage -
storages.backends.amazon_s3.AmazonS3Storage- for AWS S3 Storage -
storages.backends.google_cloud.GoogleCloudStorage- for Google Cloud Storage
Example:
export STORAGES_BACKEND=storages.backends.file_system.FileSystemStorageFor this storage you need to point the existing path in your file system, where all the data would be stored.
To do so you need to set the STORAGES_PATH environment variable to the existing path of your choice.
Example
export STORAGES_PATH=/app/mediaFor this storage you need to set the following environment variables:
-
STORAGES_AWS_ACCESS_KEY_ID- Your AWS access key ID. -
STORAGES_AWS_SECRET_ACCESS_KEY- Your AWS secret access key. -
STORAGES_AWS_BUCKET_NAME- The bucket name that you want to use.
Example:
export STORAGES_AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export STORAGES_AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
export STORAGES_AWS_BUCKET_NAME=your-example-bucket-nameIn case you encounter any problems with finding your AWS credentials please read this page as a reference.
For this storage you need to set the following environment variables:
-
STORAGES_GOOGLE_CLOUD_CREDENTIALS- Your Google Cloud credentials Base64-encoded -
STORAGES_GOOGLE_CLOUD_BUCKET_NAME- The bucket name that you want to use.
Example:
export STORAGES_GOOGLE_CLOUD_CREDENTIALS=h5vn7nht4nhv547bghw75vbt5nhtp5wn
export STORAGES_GOOGLE_CLOUD_BUCKET_NAME=your-example-bucket-nameIn case you encounter any problems with finding your Google Cloud credentials JSON file please follow this guide.
© Merixstudio 2021