Skip to main content
https://github.com/torchbox/wagtail-storages/raw/main/logo.png

wagtail-storages

https://img.shields.io/pypi/v/wagtail-storages.svg https://img.shields.io/pypi/dm/wagtail-storages.svg https://travis-ci.org/torchbox/wagtail-storages.svg?branch=master

This package fills the missing gap in using AWS S3 together with Wagtail. This package will be useful if you want to:

  • Use AWS S3 bucket for hosting Wagtail documents.

  • Put the bucket behind the CDN so that the bucket is not called directly each time.

  • Allow editors to use privacy controls on documents, whilst using CDN.

  • Avoid time-outs because of downloads being proxied through Wagtail views.

    Note: you cannot use the document redirect view if you want your documents to be truly private.

What does it do?

The package is a collection of signal handlers and Wagtail hooks.

  • Sets per-object ACLs on S3 whenever privacy settings change on a Wagtail document.

  • Replaces the current document view with a redirect. Either to a signed S3 bucket URL for private documents or public custom domain URL for public ones.

  • Purges CDN for documents that have changed.

Requirements

  • django-storages with the S3Boto3Storage storage backend configured in a Wagtail project.

  • CDN supported by Wagtail front-end cache invalidator.

Management commands

django-admin fix_document_acls

The package provider a management command that sets all the documents’ ACLs according to the their collection permissions. This must be called if there had been documents in a bucket before the package was used to make sure the ACLs in the bucket are correct.

Settings

WAGTAIL_STORAGES_DOCUMENTS_FRONTENDCACHE

Using the same format as Wagtail’s WAGTAILFRONTENDCACHE setting, but to be only used by the wagtail-storages to purge the documents. If not set, the purge won’t happen. Read more on how to format it in the Wagtail docs, e.g.

WAGTAIL_STORAGES_DOCUMENTS_FRONTENDCACHE = {
    'cloudfront': {
        'BACKEND': 'wagtail.contrib.frontend_cache.backends.CloudfrontBackend',
        'DISTRIBUTION_ID': 'your-distribution-id',
     },
}

WAGTAIL_STORAGES_DOCUMENT_HOOK_ORDER

Set a custom order for the document hook order. It’s set to 100 by default. It’s important that it runs after any of your hooks since it returns a response, e.g.

WAGTAIL_STORAGES_DOCUMENT_HOOK_ORDER = 900

Metadata

Release files for wagtail-storages 2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wagtail-storages 2.0
File Size Uploaded
wagtail_storages-2.0.tar.gz 14.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wagtail-storages 2.0
File Interpreter ABI Platform
wagtail_storages-2.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.0 kB

Release files / wagtail_storages-2.0.tar.gz

Download URL wagtail_storages-2.0.tar.gz
Size 14.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ba3da585d4ffeb8acd828adbed905cbe3db1e799d41318afbd953a472afd1b38
BLAKE2b-256 checksum
How to use checksums
1f8f311fbcb455f9fa558a1adc727a9bff0224d3b31c10a9b7d413015800d8e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5

Release files / wagtail_storages-2.0-py3-none-any.whl

Download URL wagtail_storages-2.0-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4664d11b918bad3a656b4d9071d67566c1aa84aae0a3e630cc1d05383bef572c
BLAKE2b-256 checksum
How to use checksums
465991a5cea8f5ea2efe66733e30cbdeb00da8181c4361ef4b6f6b22004fbef2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page