Flask Admin
In Chapter 6, Securing Your App, we created an interface to allow users to create and edit blog posts without having to use the command line. This was adequate to demonstrate the security measures presented in the chapter, but there is still no way for posts to be deleted or tags assigned to them using the interface. We also do not have a way to delete or edit comments that we would rather not have common users see. What our app needs is a fully featured administrator interface in the same vein as the WordPress interface. This is such a common requirement for apps that a Flask extension name Flask Admin was created to easily create administrator interfaces. To get started, install Flask Admin with pip
:
$ pip install Flask-Admin
As usual, we need to create the extension
object in extensions.py
:
from flask.ext.admin import Admin admin = Admin()
Then, the object needs to be registered on the app
object in __init__.py
:
from .extensions import ( bcrypt, oid, login_manager...