Skip to main content

django app for Adding table CRUD rest api with admin ui and without coding.

Project description

django_rest_admin

Adding table CRUD rest api with admin ui and without coding.

requirements:

  1. django
  2. djangorestframework
  3. django-filter

install:

  1. pip install django_rest_admin
  2. add django app: in django project setttings.py file: INSTALLED_APPS list, add:
    'rest_framework',
    'django_filters',
    'django_rest_admin',
  1. add path in project urls.py:
from django.contrib import admin
from django.urls import path,include
urlpatterns = [
    path('admin/', admin.site.urls),
    path('rest_admin/', include('django_rest_admin.urls')), <<--this line is what you should add
]

use:

  1. add table in your db: this could be down in navicat or some other db editors. of course you could coding in django,too.

  2. open admin page: http://127.0.0.1/admin/

    admin-page

    after login, their should be a table:Table-REST-CRUD. press Add.

    the option MUST be filled:

    A. route: the route name. eg: /Danwei
    B. Table big name: the model name of a table. eg: Danwei
    C. Table name: the table name. eg: danwei. ONLY needed if inspected_from_db=1
    D. Inspected from db: set to 1 if table is just from db, not from django model. otherwise set to 0.
    

    press Save

  3. press RefreshRestAPI BUTTON in the list.

  4. the django project will restart automaticly if you use debug mode. and then the rest api is generated already. press OpenApi button to test the api.

    admin-page

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_rest_admin-0.1.0.tar.gz (432.3 kB view details)

Uploaded Source

Built Distribution

django_rest_admin-0.1.0-py3-none-any.whl (441.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_rest_admin-0.1.0.tar.gz
  • Upload date:
  • Size: 432.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for django_rest_admin-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6481b46a555c23f3b7b3c802722161b592d9551b26e271a192dc2a9eb49b9b36
MD5 38e375cc25738256f3e21cb5beefb23e
BLAKE2b-256 81c956f670297d6cfcc480795f62305c53d5caab177d40a1ee857ed2367c0b9e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_rest_admin-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 441.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.0

File hashes

Hashes for django_rest_admin-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c3b42f4a0fbbb58732dab18ce9fc5baa2663c9afce25705a98265360e5fd0af
MD5 3b7feee8901fa2b7222e1890c5a2c400
BLAKE2b-256 fbb05eb35c9eea14d6ac3c732fbe8e81c1fc11f70b6d37911b8615263d7026e7

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