1.迁移数据同步
python manage.py makemigrations
python manage.py migrate
2.创建超级管理员账户
python manage.py createsuperuser
3.安装集成simpleui
pip install django-simpleui
配置settings,应用simpleui
INSTALLED_APPS = [
"simpleui", #添加内容,一定要加在admin前
'......',
]
SUMMERNOTE_CONFIG = {
# Using SummernoteWidget - iframe mode
'iframe': True, # or set False to use SummernoteInplaceWidget - no iframe mode
# Using Summernote Air-mode
'airMode': False,
# Use native HTML tags (`<b>`, `<i>`, ...) instead of style attributes
'styleWithSpan': False,
# Change editor size
'width': '80%',
'height': '480',
# Use proper language setting automatically (default)
'lang': 'zh-CN',
}
4.配置基础菜单
SIMPLEUI_CONFIG = {
'system_keep': False,
'menus': [{
'app': 'auth',
'name': '权限管理',
'icon': 'fas fa-user-shield',
'models': [{
'name': '用户',
'icon': 'fa fa-user',
'url': 'auth/user/'
}, {
'name': '用户组',
'icon': 'fas fa-users-cog',
'url': 'auth/group'
}]
}, {
'app': 'test',
'name': '测试管理',
'icon': 'fas fa-blog',
'models': [{
'name': '白盒测试',
'icon': 'fas fa-users',
'url': '/admin/blog/user/',
}, {
'name': '灰盒测试',
'icon': 'fas fa-list',
'url': '/admin/blog/category/',
}, {
'name': '黑盒测试',
'icon': 'fas fa-book-open',
'url': '/admin/blog/article/',
}, {
'name': '专项测试',
'icon': 'fas fa-tags',
'url': '/admin/blog/tag/',
}]
}]
}