Skip to main content

Expose django.contrib.admin as a restful service. useful for adding new features to django admin or writing a new admin.

Project description

django-api-admin

Expose django.contrib.admin as a restful service. useful for adding new features to django admin or writing a new admin.

Features ⚡

  • Expose all django.contrib.admin views as a restful api.
  • Similar to django.contrib.admin.
  • Customizable AdminSite and ModelAdmin.
  • Supports InlineModelAdmins.
  • Provides data to dynamically create forms on clients from serializers.
  • Supports Arabic Language.
  • Extensively tested

Requirements 📄

Python 3.7+

This package depends on

Installation 📲

Install django-api-admin package.

$ pip install django-api-admin

In your settings.py make sure you have django.contrib.admin and rest_framework in your installed apps. and add django_api_admin.

INSTALLED_APPS = [
    'django.contrib.admin',
    'rest_framework',
    'django_api_admin',
]

Example 💡

1. create some models.

models.py

from django.db import models


class Author(models.Model):
    name = models.CharField(max_length=100)

    def __str__(self):
        return self.name


class Book(models.Model):
    title = models.CharField(max_length=100)
    author = models.ForeignKey(Author, on_delete=models.CASCADE)

    def __str__(self):
        return self.title

2. register them using the admin site.

admin.py

from django_api_admin.sites import site
from .models import Author, Book

site.register(Author)
site.register(Book)

3. include admin urls.

urls.py

from django_api_admin.sites import site

urlpatterns = [
    path('api_admin/', site.urls),
]

4. run your development server.

$ python manage.py runsever

visit your localhost to see the browsable api.

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-api-admin-1.0.1.tar.gz (17.9 kB view details)

Uploaded Source

Built Distribution

django_api_admin-1.0.1-py3-none-any.whl (21.9 kB view details)

Uploaded Python 3

File details

Details for the file django-api-admin-1.0.1.tar.gz.

File metadata

  • Download URL: django-api-admin-1.0.1.tar.gz
  • Upload date:
  • Size: 17.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.3

File hashes

Hashes for django-api-admin-1.0.1.tar.gz
Algorithm Hash digest
SHA256 9ac8b77806c13644a866c745948c71c999c43083fb28cb1cb9ff69f2fb06aa1c
MD5 da1923c68bb23a74cdf839b4ac2700e3
BLAKE2b-256 610c787c01dc7838f8b945610f59890f07b6972051776148c41449c8dc05de9f

See more details on using hashes here.

File details

Details for the file django_api_admin-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: django_api_admin-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 21.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.3

File hashes

Hashes for django_api_admin-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 062ebe89728996dc7f609cb3ff24f514e127a8fc6e5108ae1f73d0097aa8db12
MD5 27165a51565a4c65c1e6be8cb6330baf
BLAKE2b-256 022796ccade5a7b5fdc6f898ddbca4522d9abc3a83e9069fc1f996aa44dbbaa8

See more details on using hashes here.

Supported by

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