{"library":"flask-appbuilder","code":"import os\nfrom flask import Flask\nfrom flask_appbuilder import SQLA, AppBuilder, ModelView\nfrom flask_appbuilder.models.sqla.interface import SQLAInterface\n\n# Your App class\nclass MyUser(SQLA.Model):\n    id = SQLA.Column(SQLA.Integer, primary_key=True)\n    name = SQLA.Column(SQLA.String(50), unique=True, nullable=False)\n\n    def __repr__(self):\n        return self.name\n\n# Instantiate Flask app\napp = Flask(__name__)\napp.config['SECRET_KEY'] = os.environ.get('FLASK_SECRET_KEY', 'a-very-secret-key-that-you-should-change')\napp.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(os.path.dirname(__file__), 'app.db')\napp.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False\n\n# Instantiate SQLAlchemy and AppBuilder\ndb = SQLA(app)\nappbuilder = AppBuilder(app, db.session)\n\n# Create a ModelView for MyUser\nclass MyUserView(ModelView):\n    datamodel = SQLAInterface(MyUser)\n    list_columns = ['name']\n\n# Add the view to AppBuilder\nappbuilder.add_view(MyUserView, 'List My Users', icon='fa-users', category='My App')\n\n# To run the app:\n# $ export FLASK_APP=your_app_file_name.py\n# $ flask fab create-admin (follow prompts to create an admin user)\n# $ flask run\n# Access at http://127.0.0.1:5000","lang":"python","description":"This quickstart sets up a minimal Flask-AppBuilder application with a simple SQLAlchemy model and a corresponding ModelView for CRUD operations. It initializes Flask, Flask-SQLAlchemy, and Flask-AppBuilder, then registers a basic view. You'll need to set a `FLASK_SECRET_KEY` environment variable or replace the placeholder. After running, use `flask fab create-admin` to set up an administrative user. [2, 8, 10, 12, 21]","tag":null,"tag_description":null,"last_tested":"2026-04-24","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}