Skip to main content

This package helps to maintain Wagtail documents hosted on S3.

Project description

This package helps to maintain Wagtail documents hosted on S3.

This is currently only proof of concept. Do not use on the production.

Features

  • Serve public documents straight from S3.

  • Service private documents straight from S3 using signed URLs.

  • Purge documents from front-end cache when needed.

Requirements

  • You use django-storages with S3Boto3Storage as your storage backend and you have configured it.

  • Your S3 user can set files’ ACLs in the bucket you use.

  • Front-end cache purging uses Wagtail’s frontendcache contrib module, so you need to configure that beforehand.

  • You don’t cache your Wagtail’s documents view, since that would make it impossible to have private files.

  • AWS_QUERYSTRING_AUTH = False is set if you want to serve public files without querystring auth.

Rationale

The reason this package was developed is that currently Wagtail has to read all of your file in the Python view and return it from Python. It turns out to be fairly inefficient and may result in long response times. Also there’s no solution out there to efficiently serve private files from Wagtail and S3.

Management command

There’s a management command that sets all the documents’ ACLs according to the their collection permissions. This may be useful if you started using wagtail-storages after you uploaded documents.

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

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

wagtail-storages-0.0.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

wagtail_storages-0.0.1-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file wagtail-storages-0.0.1.tar.gz.

File metadata

  • Download URL: wagtail-storages-0.0.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for wagtail-storages-0.0.1.tar.gz
Algorithm Hash digest
SHA256 cfa040bcbb55672210f13ba613f828e2a5e8d91f3fdd086f3154e3cc13c8cda1
MD5 1bbe31e4e760adb3c20903daf7d0aee0
BLAKE2b-256 4c5d2482ae68a5655e8297e6859fde0c70a7e77ec3ca7d3c2f4d6be984ed0174

See more details on using hashes here.

Provenance

File details

Details for the file wagtail_storages-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: wagtail_storages-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 15.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.2 pkginfo/1.4.2 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.37.0 CPython/3.7.5

File hashes

Hashes for wagtail_storages-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb4ab62f48fa637ec4b1f6964b2d163bedf164f52c74a53c1e796a488a0c26d0
MD5 8a24d13fa0ae71d5e4cb572535a1918f
BLAKE2b-256 08bf027f4a27c4b13c196de35028fc4682e8e2e5bb12e297ddcfe54505917085

See more details on using hashes here.

Provenance

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