Skip to main content

REST API plugin for django-admin-deux - Auto-generated RESTful endpoints for all ModelAdmins

Project description

django-admin-deux-rest2

REST API plugin for django-admin-deux.

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

📚 Documentation

See the full documentation for:

  • Installation instructions
  • Configuration options
  • API endpoint reference
  • JavaScript examples with CSRF handling
  • Testing with BaseCRUDTestCase
  • Advanced usage

🚀 Quick Start

pip install django-admin-deux-rest2
# settings.py
from djadmin import djadmin_apps

INSTALLED_APPS = [
    # ... Django apps
    'myapp',
    *djadmin_apps(),  # Auto-discovers and registers djadmin-rest2
]
# 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:

cd djadmin-rest2
python manage.py runserver

📦 Development

See 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 for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_admin_deux_rest2-0.1.0.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_admin_deux_rest2-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file django_admin_deux_rest2-0.1.0.tar.gz.

File metadata

  • Download URL: django_admin_deux_rest2-0.1.0.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for django_admin_deux_rest2-0.1.0.tar.gz
Algorithm Hash digest
SHA256 10093d450d34639e2092cba6d0bc13f781f8202ce65a1a31bbf09e5cbf836849
MD5 4360cf627b016773be284d383c8a8faf
BLAKE2b-256 98ba31d5da411d054c05950ead642a08f991ae9f8c3ccb773eb0272a590a8436

See more details on using hashes here.

File details

Details for the file django_admin_deux_rest2-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_admin_deux_rest2-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2c70dac15ded26acfef851bdac085c72eff49aa6d59fd39f8facbae2e1d6344
MD5 7e1ce60738e4e7c7e30d3fe8cb58e9c4
BLAKE2b-256 3a8ef863dc1d30831b2ccfed3bf54ce5d58bcfae8471650083eb1a2679e6a996

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page