Django打造在线教育平台_day_3:全局配置
1、主题设置:在users/adminx.py文件中
from xadmin import views class BaseSettings(object): enable_themes = True # 使用主题功能 use_bootswatch = True xadmin.site.register(views.BaseAdminView, BaseSettings)
效果如下:
2、修改与
在users/adminx.py文件中
from xadmin import views class GlobalSettings(object): site_title = u'后台管理系统' site_footer = u'学习网' xadmin.site.register(views.CommAdminView, GlobalSettings)
3、设置菜单缩放,添加一行代码
把App名称改为中文,在所有app文件夹内有一个apps.py文件和init.py文件
修改users/apps.py和users/init.py
#apps.py from django.apps import AppConfig class UsersConfig(AppConfig): name = 'users' verbose_name = u'用户信息'
#init.py default_app_config = 'users.apps.UsersConfig'
修改courses/apps.py和courses/init.py
#apps.py from django.apps import AppConfig class CoursesConfig(AppConfig): name = 'courses' verbose_name = u'课程管理' #init.py default_app_config = 'courses.apps.CoursesConfig'
修改operation/apps.py和operation/init.py
#apps.py from django.apps import AppConfig class OperationConfig(AppConfig): name = 'operation' verbose_name = u'用户操作' #init.py default_app_config = 'operation.apps.OperationConfig'
修改organization/apps.py和organization/init.py
#apps.py from django.apps import AppConfig class OrganizationConfig(AppConfig): name = 'organization' verbose_name = u'机构管理' #init.py default_app_config = 'organization.apps.OrganizationConfig'