19、利用 django-simpleui 模板在管理后台添加自定义的菜单和自定义的页面、设置访问权限

利用 django-simpleui 模板在管理后台添加自定义的菜单和自定义的页面、设置访问权限

  • settings.py

SIMPLEUI_CONFIG = {
    'system_keep': True,
    'menu_display': ['Cloudflare', '用户扩展', '权限认证', ],
    'dynamic': True,
    'menus': [{
        # 'app': 'DrfApi',
        'name': 'Cloudflare',
        'icon': 'fa fa-file',
        'models': [
            {
                'name': 'CF账号',
                'icon': 'far fa-surprise',
                'url': 'DrfApi/cloudflare/'
            },
            {
                'name': '内网穿透',
                'url': 'https://www.wezoz.com',
                'icon': 'fab fa-github'
            },
            {
                'name': '自定义页面',         # 新加的 url 页面
                'url': 'testhtml/',
                'icon': 'fab fa-github'
            }
        ]
    },

        {
        'app': 'test_jwt',
        'name': '用户扩展',
        'icon': 'fas fa-user-shield',
        'models': [
                {
                    'name': '用户',
                    'icon': 'fa fa-user',
                    'url': 'test_jwt/userinfo/'
                }
        ]
    },

        {
        'app': 'auth',
        'name': '权限认证',
        'icon': 'fas fa-user-shield',
        'models': [
            {
                'name': '组',
                'icon': 'fa fa-user',
                'url': 'auth/group/'
            }
        ]
    },


    ]
}
  • views.py

  • testhtml

  • urls.py

Last updated