--- id: django-private-storage version: "3.1.3" license: License-Expression :: OSI Approved :: Apache-2.0 license_treatment: permissive maintenance: aging --- # django-private-storage — Private media file storage for Django projects License: permissive · Maintenance: aging · Downloads: 74.2K/mo ## What it is and what it does django-private-storage adds a custom file storage backend to Django that keeps uploaded files outside the web-accessible directory and gates access through authentication. It provides model fields that work seamlessly with Django's admin and form rendering, automatically enforcing access control based on configurable permission functions. The package supports local filesystem storage by default, with optional backends for Amazon S3 and MinIO object storage; you define which users can download files via a simple auth function, and the package handles serving files through a protected view. The module integrates directly into Django's storage API, meaning existing form widgets and admin interfaces work without modification. You configure a root directory for private files, add the app to INSTALLED_APPS, include its URL patterns, and then use the provided field types in your models just like a regular FileField. Access control is pluggable—built-in options include allow_authenticated, allow_staff, and allow_superuser, or you can write a custom function that receives the request and file metadata. Use it for: - Restrict document downloads to logged-in users in a SaaS application - Store confidential user uploads (contracts, invoices) behind authentication - Serve images or media only to staff members via the admin interface - Implement object-level access control by subclassing the provided detail view - Offload private file storage to S3 or MinIO while maintaining Django model integration ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a Django storage backend that restricts file uploads and downloads to authenticated users, integrating with Django's model fields and admin interface. Yes. The package solves a common Django problem (protecting user uploads behind login) with minimal install friction, no runtime dependencies, and a stable API across modern Django versions. The aging maintenance status (313 days since last release) is acceptable for a mature, production-stable feature; no known vulnerabilities. Use it when you need to gate file access by user authentication without building custom storage logic. ## Install pip install django-private-storage uv add django-private-storage poetry add django-private-storage ## Installing django-private-storage Before you install: Low friction install with no runtime dependencies. Last commit was 313 days ago; the project is in aging maintenance status but remains archived=false and carries a production/stable classifier across Django 2.2 through 5.2. License in practice: Apache-2.0 permissive license allows commercial and private use with minimal restrictions; suitable for most production deployments. Quickstart: pip install django-private-storage # In settings.py INSTALLED_APPS += ('private_storage',) PRIVATE_STORAGE_ROOT = '/path/to/private-media/' PRIVATE_STORAGE_AUTH_FUNCTION = 'private_storage.permissions.allow_staff' # In urls.py import private_storage.urls urlpatterns += [path('private-media/', include(private_storage.urls))] Requires Django to be installed and configured; no explicit Python version minimum stated in fact sheet. Verify before relying: - Whether the package works with Django versions prior to 2.2 despite classifiers listing 2.2 as earliest - Performance characteristics when serving large files through the private storage proxy - Whether S3 and MinIO storage backends require additional package dependencies beyond what is listed ## Package facts - License: License-Expression :: OSI Approved :: Apache-2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: aging - Downloads: 74.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django private file storage, protected user uploads django, login-required file downloads, django private media files, authenticated file access django, django file permissions storage, secure user uploads django, django-storage, file-permissions, s3-minio-support [View on SkillFed](https://skillfed.io/packages/django-private-storage) · [View on PyPI](https://pypi.org/project/django-private-storage/)