Welcome to Flask-Exts’s documentation!

Flask-Exts is a Flask extensions with SQLAlchemy, babel, forms, fields, widgets, and so on.

Flask-Exts is mainly inspired by:

Flask-Exts is partially rewrited from above and well tested.

Installation

To use Flask-Exts, first install it using pip:

(.venv) $ pip install flask-exts

Examples

python simple.py to run a simple example.

# simple.py

from flask import Flask
from flask import render_template_string
from flask_exts import Exts
from flask_exts.admin import expose
from flask_exts.admin import BaseView
from flask_exts.datastore.sqla import db


class MockView(BaseView):
    @expose("/")
    def index(self):
        return render_template_string(
            "<h1>Mock</h1><div>{{ message }}</div>",
            message="This is mock index view!",
        )


app = Flask(__name__)
app.config["SECRET_KEY"] = "dev"
exts = Exts()
exts.init_app(app)
# Register a mock view
exts.admin.add_view(MockView())

with app.app_context():
    db.drop_all()
    db.create_all()

if __name__ == "__main__":
    app.run(debug=True)

More examples, please click Examples.

API Reference

If you are looking for information on a specific function, class or method, this part of the documentation is for you.

Indices and tables