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
import os.path as op
from flask import Flask
from flask_exts import Exts
from flask_exts.admin import expose_url
from flask_exts.admin import View
from flask_exts.datastore.sqla import db


class MockView(View):
    @expose_url("/")
    def index(self):
        s = '''
            {% extends "admin/master.html" %}
            {% block title %}Mock View{% endblock %}
            {% block main %}
                <h1>Mock View</h1>
                <div>This is a simple mock view for demonstration purposes.</div>
            {% endblock %}
        '''
        return self.render_string(s)


app = Flask(__name__)
app.config["SECRET_KEY"] = "dev"
# app.config["SQLALCHEMY_ECHO"] = True
app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + op.join(
    op.realpath(op.dirname(__file__)), "simple.sqlite"
)
exts = Exts()
exts.init_app(app)
# Register a mock view
exts.admin.add_view(MockView())

with app.app_context():
    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