Metadata-Version: 2.4
Name: django-admin-deux-rest2
Version: 0.1.0
Summary: REST API plugin for django-admin-deux - Auto-generated RESTful endpoints for all ModelAdmins
Author: django-admin-deux contributors
License: MIT
Project-URL: Homepage, https://django-admin-deux.readthedocs.io/
Project-URL: Documentation, https://django-admin-deux.readthedocs.io/plugins/rest2/
Project-URL: Repository, https://codeberg.org/emmaDelescolle/django-admin-deux
Project-URL: Issues, https://codeberg.org/emmaDelescolle/django-admin-deux/issues
Project-URL: Changelog, https://codeberg.org/emmaDelescolle/django-admin-deux/releases
Keywords: django,admin,rest,api,rest-api,django-admin,plugin,crud
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: Django
Classifier: Framework :: Django :: 5.2
Classifier: Framework :: Django :: 6.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: django>=5.2
Requires-Dist: django-admin-deux>=0.1.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-django>=4.5; extra == "dev"
Requires-Dist: factory-boy>=3.3; extra == "dev"
Dynamic: license-file

# django-admin-deux-rest2

REST API plugin for [django-admin-deux](https://github.com/yourusername/django-admin-deux).

Automatically adds RESTful API endpoints to all registered ModelAdmins, providing full CRUD operations via JSON.

## 📚 Documentation

See the [full documentation](djadmin_rest2/README.md) for:
- Installation instructions
- Configuration options
- API endpoint reference
- JavaScript examples with CSRF handling
- Testing with BaseCRUDTestCase
- Advanced usage

## 🚀 Quick Start

```bash
pip install django-admin-deux-rest2
```

```python
# settings.py
from djadmin import djadmin_apps

INSTALLED_APPS = [
    # ... Django apps
    'myapp',
    *djadmin_apps(),  # Auto-discovers and registers djadmin-rest2
]
```

```python
# myapp/djadmin.py
from djadmin import ModelAdmin, register
from djadmin.plugins.permissions import AllowAny

@register(Task)
class TaskAdmin(ModelAdmin):
    fields = ['title', 'description', 'status']
    permission_class = AllowAny()  # Public API
```

That's it! Your model now has REST API endpoints at:
- `GET/POST /djadmin/api/myapp_task/`
- `GET/PUT/DELETE /djadmin/api/myapp_task/<pk>/`

## 🎨 Demo Application

This repository includes a complete demo:

```bash
cd djadmin-rest2
python manage.py runserver
```

- **JavaScript Todo App**: http://localhost:8000/
- **Admin Interface**: http://localhost:8000/djadmin/todo/item/
- **REST API**: http://localhost:8000/djadmin/api/todo_item/

## 📦 Development

See [DEVELOPMENT.md](DEVELOPMENT.md) for development setup and testing instructions.

## 🤝 Contributing

Contributions are welcome! This is part of the django-admin-deux plugin ecosystem.

## 📄 License

MIT License - see [LICENSE](LICENSE) for details.
