# djangorestframework-admin
## 介绍
基于DRF开发的后台管理
## 原则
### 模块依赖
### 搜索限制
1. 被依赖对象不能根据依赖对象过滤
比如角色依赖用户,那用户就不能根据角色进行搜索;
### 删除限制
1. 删除上级时默认解除与下级的关联;
2. 删除下级时需要先解除与上级的关联;
### 权限管理
* 整体区分为两种类型
* 应用类型:适用于管理的角度,仅分为
* 创建者
* 管理员
* 用户
* 业务类型:适用于业务的角度,具体需要业务区分
### API管理区分
1. 主要分两种类型:
* 管理端,RESTFUL风格,
* 用户端,仅限于搜索(即list)使用的是RESTFUL风格,后缀me;比如:
* 我创建的
* 我加入的
* ……
2. 示例
* 用户组列表
* 管理端是`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,系统配置管理模块
## 使用
1. 新建DRF项目(以`backend`为例);
2. 安装
3. 重置配置文件
```shell
cd backend/backend
mv settings.py default_settings.py
cp .../rest_framework_admin/template/settings.py ./
cp .../rest_framework_admin/template/urls.py ./
```
4. 根据需要更新
Raw data
{
"_id": null,
"home_page": "https://gitee.com/iamfengdy/djangorestframework-admin",
"name": "djangorestframework-admin",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": null,
"keywords": "djangorestframework admin",
"author": "fengdy",
"author_email": "iamfengdy@126.com",
"download_url": "https://files.pythonhosted.org/packages/06/84/a6a7653b48e2b15a3f7171d811de4eae80127e0dcb412000405650ed95b8/djangorestframework-admin-0.0.8.tar.gz",
"platform": null,
"description": "# djangorestframework-admin\n\n## \u4ecb\u7ecd\n\u57fa\u4e8eDRF\u5f00\u53d1\u7684\u540e\u53f0\u7ba1\u7406\n\n## \u539f\u5219\n### \u6a21\u5757\u4f9d\u8d56\n\n### \u641c\u7d22\u9650\u5236\n1. \u88ab\u4f9d\u8d56\u5bf9\u8c61\u4e0d\u80fd\u6839\u636e\u4f9d\u8d56\u5bf9\u8c61\u8fc7\u6ee4\n \u6bd4\u5982\u89d2\u8272\u4f9d\u8d56\u7528\u6237\uff0c\u90a3\u7528\u6237\u5c31\u4e0d\u80fd\u6839\u636e\u89d2\u8272\u8fdb\u884c\u641c\u7d22\uff1b\n\n### \u5220\u9664\u9650\u5236\n1. \u5220\u9664\u4e0a\u7ea7\u65f6\u9ed8\u8ba4\u89e3\u9664\u4e0e\u4e0b\u7ea7\u7684\u5173\u8054\uff1b\n2. \u5220\u9664\u4e0b\u7ea7\u65f6\u9700\u8981\u5148\u89e3\u9664\u4e0e\u4e0a\u7ea7\u7684\u5173\u8054\uff1b\n\n\n### \u6743\u9650\u7ba1\u7406\n* \u6574\u4f53\u533a\u5206\u4e3a\u4e24\u79cd\u7c7b\u578b\n * \u5e94\u7528\u7c7b\u578b\uff1a\u9002\u7528\u4e8e\u7ba1\u7406\u7684\u89d2\u5ea6\uff0c\u4ec5\u5206\u4e3a\n * \u521b\u5efa\u8005\n * \u7ba1\u7406\u5458\n * \u7528\u6237\n * \u4e1a\u52a1\u7c7b\u578b\uff1a\u9002\u7528\u4e8e\u4e1a\u52a1\u7684\u89d2\u5ea6\uff0c\u5177\u4f53\u9700\u8981\u4e1a\u52a1\u533a\u5206\n\n### API\u7ba1\u7406\u533a\u5206\n1. \u4e3b\u8981\u5206\u4e24\u79cd\u7c7b\u578b\uff1a\n * \u7ba1\u7406\u7aef\uff0cRESTFUL\u98ce\u683c\uff0c\n * \u7528\u6237\u7aef\uff0c\u4ec5\u9650\u4e8e\u641c\u7d22\uff08\u5373list\uff09\u4f7f\u7528\u7684\u662fRESTFUL\u98ce\u683c\uff0c\u540e\u7f00me\uff1b\u6bd4\u5982\uff1a\n * \u6211\u521b\u5efa\u7684\n * \u6211\u52a0\u5165\u7684\n * \u2026\u2026\n2. \u793a\u4f8b\n * \u7528\u6237\u7ec4\u5217\u8868\n * \u7ba1\u7406\u7aef\u662f`user/groups`\n * \u7528\u6237\u7aef\u662f`user/me/groups/`\n * \u79df\u6237\u5217\u8868\n * \u7ba1\u7406\u7aef`tenant/tenants`\n * \u7528\u6237\u7aef\n * \u6240\u6709`tenant/me/tenants`\n * \u6211\u521b\u5efa\u7684`tenant/me/tenants/owned`\n * \u6211\u52a0\u5165\u7684`tenant/me/tenants/joined`\n\n\n## \u8f6f\u4ef6\u67b6\u6784\n\u8f6f\u4ef6\u67b6\u6784\u8bf4\u660e\n* auth\uff0c\u8eab\u4efd\u8ba4\u8bc1\u4e0e\u7ba1\u7406\u6a21\u5757\n * jwt\uff0c\u57fa\u4e8eJWT\u7684\u767b\u5f55\u4e0e\u6821\u9a8c\n * model\uff0c\u57fa\u4e8emodels.Model\u7684\u767b\u5f55\n* user\uff0c\u7528\u6237\u7ba1\u7406\n * group, \u7528\u6237\u7ec4\n* role\uff0c\u89d2\u8272\u7ba1\u7406\n * permission\uff0c\u6743\u9650\u7ba1\u7406\uff08RBAC\u6a21\u578b\uff09\n \n* static\uff0c\u9759\u6001\u8d44\u6e90\n * swagger-ui\uff0cswagger\u6587\u6863\u7684\u9759\u6001\u8d44\u6e90\n* system\uff0c\u7cfb\u7edf\u914d\u7f6e\u7ba1\u7406\u6a21\u5757\n\n## \u4f7f\u7528\n1. \u65b0\u5efaDRF\u9879\u76ee\uff08\u4ee5`backend`\u4e3a\u4f8b\uff09\uff1b\n2. \u5b89\u88c5\n3. \u91cd\u7f6e\u914d\u7f6e\u6587\u4ef6\n ```shell\n cd backend/backend\n mv settings.py default_settings.py\n cp .../rest_framework_admin/template/settings.py ./\n cp .../rest_framework_admin/template/urls.py ./\n ```\n4. \u6839\u636e\u9700\u8981\u66f4\u65b0\n\n\n\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "Admin Backend Web APIs for DjangoRestFramework, made easy.",
"version": "0.0.8",
"project_urls": {
"Homepage": "https://gitee.com/iamfengdy/djangorestframework-admin",
"Source": "https://gitee.com/iamfengdy/djangorestframework-admin"
},
"split_keywords": [
"djangorestframework",
"admin"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b097dd618076c9cc75c36fa585f1f94275587d1e1850faec574738e0e9957971",
"md5": "2ca7855fce18338688bdee27d8fde2d6",
"sha256": "d626dfbb45cc9b04c81a9b749a4ac6cd373ba6add937645ab1af4b6ee5d1abdc"
},
"downloads": -1,
"filename": "djangorestframework_admin-0.0.8-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2ca7855fce18338688bdee27d8fde2d6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 71726,
"upload_time": "2024-04-18T03:38:47",
"upload_time_iso_8601": "2024-04-18T03:38:47.202404Z",
"url": "https://files.pythonhosted.org/packages/b0/97/dd618076c9cc75c36fa585f1f94275587d1e1850faec574738e0e9957971/djangorestframework_admin-0.0.8-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0684a6a7653b48e2b15a3f7171d811de4eae80127e0dcb412000405650ed95b8",
"md5": "e69aa9a3a52f815ee055368b1db1ba4e",
"sha256": "7879b4660a335380e36641d4a098b1651ef127b78ee495dc95fa6d5e5563ca97"
},
"downloads": -1,
"filename": "djangorestframework-admin-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "e69aa9a3a52f815ee055368b1db1ba4e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 37591,
"upload_time": "2024-04-18T03:38:48",
"upload_time_iso_8601": "2024-04-18T03:38:48.782323Z",
"url": "https://files.pythonhosted.org/packages/06/84/a6a7653b48e2b15a3f7171d811de4eae80127e0dcb412000405650ed95b8/djangorestframework-admin-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-18 03:38:48",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "djangorestframework-admin"
}