Metadata-Version: 2.4
Name: django-saas-attachments
Version: 0.1.0
Summary: The attachments module for building a SaaS product with Django
Author-email: Hsiaoming Yang <me@lepture.com>
License: BSD-3-Clause
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.0
Classifier: Framework :: Django :: 5.1
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.12
Requires-Dist: boto3
Requires-Dist: django
Requires-Dist: django-saas
Requires-Dist: djangorestframework
Description-Content-Type: text/markdown

# Django SaaS Attachments

The attachments module for building a SaaS product with Django.

## Install

```
pip install django-saas-attachments
```

Then add it into your Django project `settings.py`:

```python
INSTALLED_APPS = [
    # ...
    "saas",
    "saas_attachments",
]

SAAS_ATTACHMENTS = {
    "PROVIDERS": [
        {
            "backend": "saas_attachments.providers.s3.S3Provider",
            "options": {
                "name": "default",
                "bucket_name": "my-bucket",
                "region_name": "us-east-1",
                "access_key_id": "secret:AWS_ACCESS_KEY_ID",
                "secret_access_key": "secret:AWS_SECRET_ACCESS_KEY",
            }
        }
    ]
}
```

## Features

- **Tenant Isolation**: All attachments are linked to a tenant.
- **Async Uploads**: Uses presigned URLs for direct-to-storage uploads.
- **Media Types**: Specialized models for Image, Audio, and Video.
- **Provider Support**: Extensible storage provider system (S3 included).
- **Cleanup**: Built-in management command to clean up abandoned uploads.