Open edX Django PyFilesystem Integration

raw JSON →
4.0.0 verified Mon Apr 27 auth: no python

A Django integration for PyFilesystem that allows Django sites to use PyFilesystem filesystems (e.g., local, S3) for storage. Current version 4.0.0 drops Python 3.11 support and may have breaking changes from earlier versions. Releases are periodic, driven by Open edX maintenance.

pip install openedx-django-pyfs
error ModuleNotFoundError: No module named 'django_pyfs'
cause Wrong import path or library not installed.
fix
Install the package: pip install openedx-django-pyfs
error django.core.exceptions.ImproperlyConfigured: ... PyfsConfiguredStorage requires a 'url' setting
cause Missing required configuration in Django settings.
fix
Ensure you have set PYFS_URL or django-pyfs specific settings in your Django settings file.
breaking Dropped Python 3.11 support in v4.0.0. Python 3.12+ is required.
fix Upgrade Python to 3.12 or later.
deprecated The old boto backend was removed in v3.3.0. Use boto3 instead.
fix Switch your S3 configuration to use the boto3 backend.
gotcha If you are upgrading from v2.x to v3.x, the default storage URL format changed. You may need to update your settings.
fix Review the storage URL format in documentation.

Set up a PyFilesystem storage backend for Django.

from django_pyfs import PyfsConfiguredStorage
from django_pyfs.storage import create_storage
# Use default configuration
storage = PyfsConfiguredStorage()
# Or with explicit settings
storage = create_storage('s3', {'key': os.environ.get('AWS_ACCESS_KEY_ID', ''), 'secret': os.environ.get('AWS_SECRET_ACCESS_KEY', ''), 'bucket': 'my-bucket'})