Page MenuHome

__init__.py
No OneTemporary

__init__.py

"""Storage backends.
To obtain a storage backend, use either of the two forms:
>>> bucket = default_storage_backend('bucket_name')
>>> BucketClass = Bucket.for_backend('backend_name')
>>> bucket = BucketClass('bucket_name')
"""
from .abstract import Bucket
# Import the other backends so that they register.
from . import local
from . import gcs
def default_storage_backend(name: str) -> Bucket:
"""Returns an instance of a Bucket, based on the default backend.
Depending on the backend this may actually create the bucket.
"""
from flask import current_app
backend_name = current_app.config['STORAGE_BACKEND']
backend_cls = Bucket.for_backend(backend_name)
return backend_cls(name)

File Metadata

Mime Type
text/x-python
Expires
Mon, Aug 10, 2:45 PM (2 d)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b3/7f/cefe319d46222e1868b5be8246c9

Event Timeline