未提供项目描述
项目描述
django-smart-admin
SmartAdmin 是一组小型Django Admin实用工具,旨在消除一些常见的烦人配置问题
它不是为了完全替代官方Admin,而是提供一套通常(至少对我来说)需要在每个项目中复制/粘贴的 mixin/utilities。
额外功能
- 可以按上下文而不是按应用分组模型
- 显示任何用户的admin日志条目
- 显示组成员
- 显示用户权限
- 显示权限所有者
- 显示所有列ModelAdmin mixin
- 记录User/Group添加/删除权限
- 记录User添加/删除组
- 可以设置
readonly_fields = ('__all__',)
(ReadOnlyMixin) - 在
changelist
中显示所有模型字段(DisplayAllMixin) - 自动为每个索引字段创建过滤器(SmartAutoFilterMixin)
- 改进的fieldset允许使用
__others__
包含其他fieldset中未包含的任何字段(FieldsetMixin) - 可以自定义Autocomplete标签
- 用户定义的“站点面板”
演示可在 https://django-smart-admin.herokuapp.com/ 找到。(接受任何用户/密码组合)
组件
- LinkedObjectsMixin
- ReadOnlyMixin
- FieldsetMixin
- DisplayAllMixin
安装
pip install django-smart-admin
或(如果您想安装额外的管理员功能)
pip install django-smart-admin[full]
在您的 settings.py
文件中
INSTALLED_APPS = [
# "django.contrib.admin", # removes standard django admin
'django_sysinfo', # optional
'adminactions', # optional
'adminfilters', # optional
'admin_extra_buttons', # optional
'smart_admin.apps.SmartTemplateConfig', # templates
'smart_admin', # use this instead of 'django.contrib.admin'
'smart_admin.apps.SmartLogsConfig', # optional: log application
'smart_admin.apps.SmartAuthConfig', # optional: django.contrib.auth enhancements
]
SMART_ADMIN_SECTIONS = {
'Demo': ['demo', ],
'Security': ['auth',
'auth.User',
],
'Logs': ['admin.LogEntry',
],
'Other': [],
'_hidden_': ["sites"]
}
# add some bookmark
SMART_ADMIN_BOOKMARKS = [('GitHub', 'https://github.com/saxix/django-smart-admin')]
# no special permissions to see bookmarks
SMART_ADMIN_BOOKMARKS_PERMISSION = None
# add 'profile' link on the header
SMART_ADMIN_PROFILE_LINK = True
# display all users action log, not only logged user
SMART_ADMIN_ANYUSER_LOG = True
在您的 urls.py
文件中
from django.contrib import admin
from django.urls import include, path
import adminactions.actions as actions
from django.contrib.admin import site
admin.autodiscover()
actions.add_to_site(site)
urlpatterns = [
path('', admin.site.urls),
path('adminactions/', include('adminactions.urls')),
]
项目链接
项目详情
下载文件
下载适用于您平台的项目文件。如果您不确定选择哪个,请了解有关 安装软件包 的更多信息。
源分布
django-smart-admin-2.6.0.tar.gz (40.5 kB 查看哈希值)
关闭
django-smart-admin-2.6.0.tar.gz 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 9ac878433c57eb285360e0c019258fc7fef9d5557805dafb55d2f965e4fe02e2 |
|
MD5 | e5bf0dd15f75a78bf5e1f2a4533a56cf |
|
BLAKE2b-256 | a08ef43d154a9b84a10cdb635d5a1c4845cdea7b3d54e3f63b172a4d56a150f0 |