Registry / web-framework / django-private-storage

django-private-storage

JSON →
library3.1.3pypypiunverified

Provides private media file storage for Django projects, allowing files to be served only to authenticated users with permission checks. Version 3.1.3 is current. Release cadence is irregular.

pip install django-private-storage
INSTALL
IMPORT
SIG · DJANGO-PRIVATE-STO
D
django-private-storage
web-frameworkpythonv3.1.3
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.1.3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.1MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PrivateStorage
from private_storage.storage import PrivateStorage
from private_storage.storage.filesystem import PrivateStorage

Add to INSTALLED_APPS, configure root and auth function, then use PrivateStorage as the storage backend.

INSTALLED_APPS = [ 'private_storage', ... ] PRIVATE_STORAGE_ROOT = '/path/to/private/media/' PRIVATE_STORAGE_AUTH_FUNCTION = 'private_storage.permissions.allow_authenticated' from private_storage.storage.filesystem import PrivateStorage private_storage = PrivateStorage()
Debug
Known issues
gotchaThe default auth function is `allow_staff` (only staff users). If you want all authenticated users, set `PRIVATE_STORAGE_AUTH_FUNCTION = 'private_storage.permissions.allow_authenticated'`.
fix
Set the auth function explicitly in Django settings.
affects: all
gotchaPrivateStorage does not work with the default Django file storage; it requires a custom storage backend. Do not use `DefaultStorage` or `FileSystemStorage` for private files.
fix
Use `from private_storage.storage.filesystem import PrivateStorage` as the storage class.
affects: all
deprecatedBefore version 3, the import path was `from private_storage.storage import PrivateStorage`. In v3, the storage classes moved to submodules.
fix
Use `from private_storage.storage.filesystem import PrivateStorage`.
affects: >=3.0.0
Upgrade
Version history
3.1.3latest on PyPI · released Oct 5, 2025
Audit
Dependencies
DjangorequiredCore framework
Agent activity
22 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
django-private-storage — pip install django-private-storage · libregistry