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:
- django
- djangorestframework
- django-filter
install:
- pip install django_rest_admin
- add django app: in django project setttings.py file: INSTALLED_APPS list, add:
'rest_framework',
'django_filters',
'django_rest_admin',
- 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:
-
add table in your db: this could be down in navicat or some other db editors. of course you could coding in django,too.
-
open admin page: http://127.0.0.1/admin/
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
-
press RefreshRestAPI BUTTON in the list.
-
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file django_rest_admin-0.0.3.tar.gz
.
File metadata
- Download URL: django_rest_admin-0.0.3.tar.gz
- Upload date:
- Size: 15.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632968b2aed87227b5ca556a4e7f8a3b541540d85d5d6837d53341b6e3a7850b |
|
MD5 | 2ca6e73e35c1a0361f80c540b332da70 |
|
BLAKE2b-256 | 118dee25c284e39350f39496efcae6b79122f3b867c943b820735d7df9922eed |
File details
Details for the file django_rest_admin-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: django_rest_admin-0.0.3-py3-none-any.whl
- Upload date:
- Size: 23.0 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa82ab2f84932eaf87cf6436f66316769646c01b9608136e050d2b5de2d5e2ea |
|
MD5 | ce173107b00d350981a9af7a628575e0 |
|
BLAKE2b-256 | e4543faa5aab73b66677947948a22b798b96a42ffba301ac467a652dd390326f |