Flask-FS expose both global and by storage settings.

Global configuration


default: DEBUG

A boolean whether or not Flask-FS should serve files


default: {app.instance_path}/fs

The global local storage root. Each storage will have its own root as a subdirectory unless not local or overridden by configuration.


default: None

An optionnal URL path prefix for storages (ex: '/fs').


default: None

An optionnal URL on which the FS_ROOT is visible (ex: '').


default: 'local'

The default backend used for storages. Can be one of local, s3, gridfs or swift


default: False

Whether or not image should be compressedd/optimized by default.

Storages configuration

Each storage configuration can be overriden from the application configuration. The configuration is loaded in the following order:

  • FS_{BACKEND_NAME}_{KEY} (backend specific configuration)
  • {STORAGE_NAME}_FS_{KEY} (specific configuration)
  • FS_{KEY} (global configuration)
  • default value

Given a storage declared like this:

import flask_fs as fs

avatars = fs.Storage('avatars', fs.IMAGES)

You can override its root with the following configuration:

AVATARS_FS_ROOT = '/somewhere/on/the/filesystem'

Or you can set a base URL to all storages for a given backend:

FS_S3_URL = ''
FS_S3_REGION = 'us-east-1'