{"id":23591,"library":"django-private-storage","title":"django-private-storage","description":"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.","status":"active","version":"3.1.3","language":"python","source_language":"en","source_url":"https://github.com/edoburu/django-private-storage","tags":["django","storage","private-files","media"],"install":[{"cmd":"pip install django-private-storage","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core framework","package":"Django","optional":false}],"imports":[{"wrong":"from private_storage.storage.filesystem import PrivateStorage","symbol":"PrivateStorage","correct":"from private_storage.storage import PrivateStorage"}],"quickstart":{"code":"INSTALLED_APPS = [\n    'private_storage',\n    ...\n]\n\nPRIVATE_STORAGE_ROOT = '/path/to/private/media/'\nPRIVATE_STORAGE_AUTH_FUNCTION = 'private_storage.permissions.allow_authenticated'\n\nfrom private_storage.storage.filesystem import PrivateStorage\nprivate_storage = PrivateStorage()","lang":"python","description":"Add to INSTALLED_APPS, configure root and auth function, then use PrivateStorage as the storage backend."},"warnings":[{"fix":"Set the auth function explicitly in Django settings.","message":"The 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'`.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from private_storage.storage.filesystem import PrivateStorage` as the storage class.","message":"PrivateStorage does not work with the default Django file storage; it requires a custom storage backend. Do not use `DefaultStorage` or `FileSystemStorage` for private files.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `from private_storage.storage.filesystem import PrivateStorage`.","message":"Before version 3, the import path was `from private_storage.storage import PrivateStorage`. In v3, the storage classes moved to submodules.","severity":"deprecated","affected_versions":">=3.0.0"}],"env_vars":null,"search_vec":"'3.1.3':26 'allow':13 'authent':20 'cadenc':30 'check':24 'current':28 'django':2,11,33 'django-private-storag':1 'file':8,14,37 'irregular':32 'media':7,38 'permiss':23 'privat':3,6,36 'private-fil':35 'project':12 'provid':5 'releas':29 'serv':17 'storag':4,9,34 'user':21 'version':25","created_at":"2026-05-01T08:08:35.180916+00:00","updated_at":"2026-05-01T08:08:35.180916+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmplscg5pwd/venv/lib/python3.12/site-packages/private_storage/storage/__init__.py\", line 4, in <module>\n    from django.utils.module_loading import import_string\nModuleNotFoundError: No module named 'django'"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"3.1.3","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/edoburu/django-private-storage","docs":null,"changelog":null,"pypi":"https://pypi.org/project/django-private-storage/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","auth-security","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}