django tree permisson
Project description
django-tree-perm
django-tree-perm is implemented by Django and provides interfaces and pages for managing tree data structure nodes.
django-tree-perm 是 Django 实现的,提供了树形数据结构结点管理的接口和页面。
主要应用场景有:
- CMDB 服务树的管理;
- web 项目页面权限的管理控制;
具体使用说明可以查看 readthedocs 或者直接查看源码注释。
1. 安装
pip install django-tree-perm
可查看版本变更记录 ChangeLog
2. 使用
在项目 settings.py
中配置引入:
INSTALLED_APPS = [
# ...
"django_tree_perm",
]
在项目 urls.py
中加入接口配置:
path("tree/", include("django_tree_perm.urls")),
执行数据库变更:
python manage.py migrate django_tree_perm
运行服务: python manage.py runserver 0.0.0.0:8000
可通过浏览器访问展示及管理页面 http://localhost:8000/tree/
3. 配置项
Django settings
额外扩展的配置项有:
配置项 | 类型 | 说明 | 默认值 |
---|---|---|---|
TREE_DATETIME_FORMAT | str | 用于接口返回的 JSON 数据格式化时间 | %Y-%m-%d %H:%M:%S UTC%z |
4. Demo 示例
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
django_tree_perm-1.0.2.tar.gz
(357.9 kB
view details)
Built Distribution
File details
Details for the file django_tree_perm-1.0.2.tar.gz
.
File metadata
- Download URL: django_tree_perm-1.0.2.tar.gz
- Upload date:
- Size: 357.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f24b1c54ba37d4d9389cb1c093de489c530df50bbdef7f5183a2e1ae62091031 |
|
MD5 | 62d77ae869a2552c9da71d302fd10698 |
|
BLAKE2b-256 | f56c40aa7d8b496d6f712b9501be39a179da53a00535adc19ebf4dbcc2402359 |
File details
Details for the file django_tree_perm-1.0.2-py3-none-any.whl
.
File metadata
- Download URL: django_tree_perm-1.0.2-py3-none-any.whl
- Upload date:
- Size: 354.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63b5dd92acd87778ebf85372173e5f5a7621bcec2632c33c139a70906770cfda |
|
MD5 | dff16708e4172aefa45b3a23d2a4538d |
|
BLAKE2b-256 | fe8c845e3fedbffd69dacb44dd4adc79b6046168353a1415f87a5d25ec55a246 |