Skip to main content

Swift storage backend for munch-core.

Project description

This module contains Swift storage backends to be used with Munch.

Install

Todo.

SwiftPrivateStorage

This one is meant to be used as the default Django storage backend. It merely wraps django-storage-swift by:

  • providing an extra Django setting for the container name

  • ensuring a blank URL is returned for the file (since container is private)

  • forcing auto_overwrite of files

We prefer to use a different setting for the container name rather than upstream’s SWIFT_CONTAINER_NAME so that we can cleanly configure multiple Swift backends.

Usage

# Add the following in Django settings
DEFAULT_FILE_STORAGE = 'munch_storage_swift.SwiftPrivateStorage'
DEFAULT_SWIFT_CONTAINER_NAME = 'private'

SWIFT_AUTH_URL = 'https://auth.cloud.ovh.net/v2.0'
SWIFT_AUTH_VERSION = '2.0'
SWIFT_USERNAME = 'username'
SWIFT_KEY = 'XXXXXXXXXX'
SWIFT_TENANT_NAME = 'tenant_name'
SWIFT_TENANT_ID = 'tenant_id'

SwiftUploadStorage

This one will do all of most of the above, except returning a blank URL. Instead, we will return a URL using the provided base_url, regardless of the URL computed by upstream.

Usage

# Add the following in Django settings
UPLOAD_STORE_BACKEND = 'munch_storage_swift.SwiftUploadStorage'
UPLOAD_STORE_SWIFT_CONTAINER_NAME = 'upload'

SWIFT_AUTH_URL = 'https://auth.cloud.ovh.net/v2.0'
SWIFT_AUTH_VERSION = '2.0'
SWIFT_USERNAME = 'username'
SWIFT_KEY = 'XXXXXXXXXX'
SWIFT_TENANT_NAME = 'tenant_name'
SWIFT_TENANT_ID = 'tenant_id'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

munch-storage-swift-0.1.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

munch_storage_swift-0.1.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file munch-storage-swift-0.1.0.tar.gz.

File metadata

File hashes

Hashes for munch-storage-swift-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1649e2afa7ce4007fa795be7965dc671c176b17b085308e15d1a86c6c7c34486
MD5 0b02552c3d6b33f3e6e813e7f185db23
BLAKE2b-256 bb627eec9a8fe4ee676d2e30d987d5e53ae0abbbd9a3505119cb2f9969223526

See more details on using hashes here.

File details

Details for the file munch_storage_swift-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for munch_storage_swift-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8bd31f73660305c904afcba1cd7da2240c7f3bbf12d3a8854c12bdeab1b90c1d
MD5 5b1df7ad9287694e57807ef61b1f3ed1
BLAKE2b-256 74c5c77f0865af3f1c3c9fb5e056d16b24a4284e1eee2b58f42d08c93b2a0763

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page