Metadata-Version: 2.1
Name: dj-bucket
Version: 0.1.3
Summary: Use your database as a S3 storage
Author-Email: Benjamin Hirschfield <me@bennybarry.com>
License: MIT
Classifier: Development Status :: 5 - Production/Stable
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: <4,>=3.11
Requires-Dist: django<6.0,>=4.1
Description-Content-Type: text/markdown

# dj-bucket

Store blobs into a database table.

## Setup

In your configuration add the dj-bucket app to the installed apps:

```python
INSTALLED_APPS: = [
    "dj_bucket",
]

# Bucket base path no starting and no ending slash
BUCKET_PATH="bucket"
```

Then make sure a database backend is setup, for testing you can use the SQLite:

```python
DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": BASE_DIR / "db.sqlite3",
    }
}
```

Add the bucket URL to your `urls.py`:

```python
from dj_bucket.urls import urlpatterns as dj_bucket_urls

urlpatterns = [
    path("", include(dj_bucket_urls)),
    ...
]
```

Run the Django database migrations to create the table that will store the
blobs.

## Wagtail

With wagtail you need to declare the storage in the `STORAGES` variable:

```python
STORAGES = {
    "default": {
        "BACKEND": "dj_bucket.models.Bucket",
    }
}
```
