Metadata-Version: 2.5
Name: django-availfiles
Version: 0.2.0
Summary: A minimal, frontend-agnostic file library for Django: upload a file, get a URL back. No dashboard, no picker UI — just the model.
Project-URL: Homepage, https://github.com/hisie/django-availfiles
Project-URL: Repository, https://github.com/hisie/django-availfiles
Project-URL: Issues, https://github.com/hisie/django-availfiles/issues
Author-email: Diego Cebrian <diego@cebrian-it.fr>
License: BSD-3-Clause
Keywords: django,files,media-library
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Requires-Dist: django<5.3,>=5.2
Description-Content-Type: text/markdown

# django-availfiles

A minimal, frontend-agnostic file library for Django. `AvailFile` is a
flat model — upload a file, get a URL back — deliberately **not** related
to any other model via a foreign key. The point is a place to put a file
once and link to it from anywhere (a blog post body, a product
description, an email), not a structured per-model attachment relation.

## What this package does, and doesn't, do

- `AvailFile`: `file`, `original_filename` (captured automatically on
  save), an optional `label`, `uploaded_by`, `uploaded_at`.
- Registers with Django admin.
- It does **not** ship any views, URLs, upload endpoint, or picker UI —
  that's genuinely framework/host-specific (a dashboard page, a rich-text
  editor's file-picker, a plain form), and belongs in an integration
  layer. For an Oscar dashboard + TinyMCE integration, see
  [django-oscar-availfiles](https://github.com/hisie/django-oscar-availfiles).
- No opinion on which file types are allowed. A deployment might restrict
  this library to non-image files (if images already have their own
  upload flow elsewhere) — that's a policy decision for whichever upload
  view is actually used, not something this model enforces.

## Installation

```
uv add django-availfiles
```

```python
INSTALLED_APPS = [
    ...,
    "availfiles",
]
```

Run `manage.py migrate`.

## Development

```
uv sync
uv run pytest
```
