Storing files is a necessary function of any modern web application. This page describes how to store files on different storage backends using GeniePy.
GeniePy supports storing files through a few different service providers. This works primarily through setting a few core environment variables followed by setting a few environment variables specific to the service provider you're using.
STORAGE_BACKEND environment variable to tell GeniePy what kind of
storage backend you're planning to use.
This variable supports the following values:
disk: configures GeniePy to store data on local disk
s3: configures GeniePy to store data on an Amazon S3 storage bucket of your choice
gcs: configures GeniePy to store data on a Google Cloud Storage bucket of your choice
With this environment variable in place, we can move on to configuring the individual storage providers.
Specify a valid value for the
This environment variable is how GeniePy knows where on disk to store all the
data. The default value is set to
Specify valid values for the following four environment variabes:
STORAGE_BACKEND_S3_REGION: the geographical region your S3 bucket is configured to be in
STORAGE_BACKEND_S3_BUCKET: your bucket's name
STORAGE_BACKEND_S3_ACCESS_KEY_ID: your API access key ID
STORAGE_BACKEND_S3_SECRET_ACCESS_KEY: your API secret access key
Google Cloud Storage
Specify valid values for the following two environment variables:
STORAGE_BACKEND_GCS_APPLICATION_CREDENTIALS: the application credentials file issued by Google that is allowed to access data on your bucket
STORAGE_BACKEND_GCS_BUCKET: your bucket's name