Bootstrap 4 使Flask管理支持Bootstrap4

Bootstrap 4 使Flask管理支持Bootstrap4,bootstrap-4,flask-admin,Bootstrap 4,Flask Admin,我正在使用bootstrap4模板开发一个flask应用程序,如何使flask管理支持bootstrap4 admin = Admin(app, template_mode='bootstrap3') # define UserView class UserView(ModelView): can_view_details = True column_exclude_list = ['password', ] column_searchable_list = [

我正在使用bootstrap4模板开发一个flask应用程序,如何使flask管理支持bootstrap4

    admin = Admin(app, template_mode='bootstrap3')
# define UserView
class UserView(ModelView):

    can_view_details = True
    column_exclude_list = ['password', ]
    column_searchable_list = ['email',]

admin.add_view(UserView(User, db.session))

# define RoleView
class RoleView(ModelView):

    can_view_details = True
    column_searchable_list = ['name',]

admin.add_view(RoleView(Role, db.session))
2020年10月更新:Flask Admin 1.5.7包括Bootstrap 4

Flask Admin现在支持Bootstrap 4。请注意,参数模板_模式:

要使用以下方法构造管理类实例:

admin = Admin(app, template_mode='bootstrap4')

阅读本期文章-在Flask Admin repository.asnow 3。2020年9月没有bootstrap4的发行版,因此您需要从repo或类似软件安装它。e、 g.pip安装git+https://github.com/flask-admin/flask-admin.git@最大值-在v1.5.7中发布
admin = Admin(app, template_mode='bootstrap4')