Python
Need help with Flask-Dashed?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.
jeanphix

Description

Provides simple but efficient admin UI.

129 Stars 25 Forks 147 Commits 3 Opened issues

Services available

Need anything else?

Introduction

.. image:: https://secure.travis-ci.org/jeanphix/Flask-Dashed.png

Flask-Dashed provides tools for build simple and extensible admin interfaces.

Online demonstration: http://flask-dashed.jeanphi.fr/ (Github account required).

List view:

.. image:: https://github.com/jeanphix/Flask-Dashed/raw/dev/docs/_static/screen.png

Form view:

.. image:: https://github.com/jeanphix/Flask-Dashed/raw/dev/docs/_static/screen-edit.png

Installation

pip install Flask-Dashed

Minimal usage

Code::

from flask import Flask
from flask_dashed.admin import Admin

app = Flask(name) admin = Admin(app)

if name == 'main': app.run()

Sample application: http://github.com/jeanphix/flask-dashed-demo

Deal with security

Securing all module endpoints::

from flask import session

book_module = admin.register_module(BookModule, '/books', 'books', 'book management')

@book_module.secure(http_code=401) def login_required(): return "user" in session

Securing specific module endpoint::

@book_module.secure_endpoint('edit', http_code=403)
def check_edit_credential(view):
    # I'm now signed in, may I modify the ressource?
    return session.user.can_edit_book(view.object)

Organize modules

As admin nodes are registered into a "tree" it's quite easy to organize them.::

library = admin.register_node('/library', 'library', my library)
book_module = admin.register_module(BookModule, '/books', 'books',
    'book management', parent=library)

Navigation and breadcrumbs are automatically builds to feet your needs. Child module security will be inherited from parent one.

SQLALchemy extension

Code::

from flask_dashed.ext.sqlalchemy import ModelAdminModule


class BookModule(ModelAdminModule): model = Book db_session = db.session

book_module = admin.register_module(BookModule, '/books', 'books', 'book management')

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.