Git Product home page Git Product logo

flask-adminlte3's Introduction

Flask-AdminLTE3

Flask-AdminLTE3 packages AdminLTE3 into an extension that mostly consists of a blueprint named 'adminlte'. It is Admin Theme for Flask-Admin.

Installation

Installation using pip:

pip install Flask-AdminLTE3

Compatibility

This package is compatible Python versions 2.7, 3.4, 3.5 and 3.6.

Usage

Here is an example:

from flask_adminlte3 import AdminLTE3

[...]

AdminLTE3(app)

Admin Theme for Flask-Admin

from flask_admin.contrib.sqla import ModelView
from flask_admin.contrib.fileadmin import FileAdmin


class AdminLTEModelView(ModelView):
    list_template = 'flask-admin/model/list.html'
    create_template = 'flask-admin/model/create.html'
    edit_template = 'flask-admin/model/edit.html'
    details_template = 'flask-admin/model/details.html'

    create_modal_template = 'flask-admin/model/modals/create.html'
    edit_modal_template = 'flask-admin/model/modals/edit.html'
    details_modal_template = 'flask-admin/model/modals/details.html'


class AdminLTEFileAdmin(FileAdmin):
    list_template = 'flask-admin/file/list.html'

    upload_template = 'flask-admin/file/form.html'
    mkdir_template = 'flask-admin/file/form.html'
    rename_template = 'flask-admin/file/form.html'
    edit_template = 'flask-admin/file/form.html'

    upload_modal_template = 'flask-admin/file/modals/form.html'
    mkdir_modal_template = 'flask-admin/file/modals/form.html'
    rename_modal_template = 'flask-admin/file/modals/form.html'
    edit_modal_template = 'flask-admin/file/modals/form.html'


class MyAdminIndexView(AdminIndexView):
    @expose('/', methods=['GET', 'POST'])
    def index(self):
        return self.render('myadmin3/my_index.html')


from flask_admin import Admin
admin = Admin(name='Admin Dashboard',
            base_template='myadmin3/my_master.html',
            template_mode='bootstrap4',
            index_view=MyAdminIndexView())

base template myadmin3/my_master.html code:

{% extends 'flask-admin/base.html' %}
[...]

index template myadmin3/my_index.html code:

{% extends 'myadmin3/my_master.html' %}
[...]

Screenshots

Admin Area:

  • Demo Model :model screenshot

  • Demo List Model: model list

  • Demo Creating Model: model create

  • Demo Editing Model: model edit

flask-adminlte3's People

Contributors

shijl0925 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.