djangorestframework-admin
介绍
基于DRF开发的后台管理
原则
模块依赖
搜索限制
- 被依赖对象不能根据依赖对象过滤 比如角色依赖用户,那用户就不能根据角色进行搜索;
删除限制
- 删除上级时默认解除与下级的关联;
- 删除下级时需要先解除与上级的关联;
权限管理
- 整体区分为两种类型
- 应用类型:适用于管理的角度,仅分为
- 创建者
- 管理员
- 用户
- 业务类型:适用于业务的角度,具体需要业务区分
- 应用类型:适用于管理的角度,仅分为
API管理区分
- 主要分两种类型:
- 管理端,RESTFUL风格,
- 用户端,仅限于搜索(即list)使用的是RESTFUL风格,后缀me;比如:
- 我创建的
- 我加入的
- ……
- 示例
- 用户组列表
- 管理端是
user/groups - 用户端是
user/me/groups/
- 管理端是
- 租户列表
- 管理端
tenant/tenants - 用户端
- 所有
tenant/me/tenants - 我创建的
tenant/me/tenants/owned - 我加入的
tenant/me/tenants/joined
- 所有
- 管理端
软件架构
软件架构说明
-
auth,身份认证与管理模块
- jwt,基于JWT的登录与校验
- model,基于models.Model的登录
-
user,用户管理
- group, 用户组
-
role,角色管理
- permission,权限管理(RBAC模型)
-
static,静态资源
- swagger-ui,swagger文档的静态资源
-
system,系统配置管理模块
使用
- 新建DRF项目(以
backend为例); - 安装
- 重置配置文件
cd backend/backend
mv settings.py default_settings.py
cp .../rest_framework_admin/template/settings.py ./
cp .../rest_framework_admin/template/urls.py ./
- 根据需要更新
Metadata
Release files for djangorestframework-admin 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| djangorestframework-admin-0.0.8.tar.gz | 37.6 kB | Without provenance | Details for djangorestframework-admin-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| djangorestframework_admin-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for djangorestframework_admin-0.0.8-py3-none-any.whl |
Total release size: 109.3 kB
Release files / djangorestframework-admin-0.0.8.tar.gz
| Download URL | djangorestframework-admin-0.0.8.tar.gz |
|---|---|
| Size | 37.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7879b4660a335380e36641d4a098b1651ef127b78ee495dc95fa6d5e5563ca97
|
|
BLAKE2b-256 checksum How to use checksums |
0684a6a7653b48e2b15a3f7171d811de4eae80127e0dcb412000405650ed95b8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.14
|
Release files / djangorestframework_admin-0.0.8-py3-none-any.whl
| Download URL | djangorestframework_admin-0.0.8-py3-none-any.whl |
|---|---|
| Size | 71.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d626dfbb45cc9b04c81a9b749a4ac6cd373ba6add937645ab1af4b6ee5d1abdc
|
|
BLAKE2b-256 checksum How to use checksums |
b097dd618076c9cc75c36fa585f1f94275587d1e1850faec574738e0e9957971
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.10.14
|
Security for djangorestframework-admin 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.