{"id":2505,"library":"flask-admin","title":"Flask-Admin","description":"Flask-Admin is a simple and extensible admin interface framework for Flask. It provides a batteries-included solution for adding administrative interfaces to Flask applications, allowing management of data models with auto-generated Create, Read, Update, Delete (CRUD) views. The current version is 2.0.2, and it maintains an active release cadence with regular updates and new feature additions as part of the Pallets-Eco organization.","status":"active","version":"2.0.2","language":"en","source_language":"en","source_url":"https://github.com/pallets-eco/flask-admin/","tags":["flask","admin-panel","web-framework","dashboard","crud","productivity"],"install":[{"cmd":"pip install flask-admin","lang":"bash","label":"Install core library"},{"cmd":"pip install flask-admin[sqla]","lang":"bash","label":"Install with SQLAlchemy support"},{"cmd":"pip install flask-admin[mongoengine]","lang":"bash","label":"Install with MongoEngine support"},{"cmd":"pip install flask-admin[s3]","lang":"bash","label":"Install with S3 file management support"}],"dependencies":[{"reason":"Core web framework dependency.","package":"Flask"},{"reason":"Underlying form handling library.","package":"WTForms","optional":true},{"reason":"Required for `flask_admin.contrib.sqla.ModelView` for SQL database integration.","package":"SQLAlchemy","optional":true},{"reason":"Common Flask extension for SQLAlchemy integration.","package":"Flask-SQLAlchemy","optional":true},{"reason":"Required for `flask_admin.contrib.s3.S3FileAdmin` for S3 file storage.","package":"boto3","optional":true},{"reason":"Required for `flask_admin.contrib.azure.AzureFileAdmin` for Azure Blob storage.","package":"azure-storage-blob","optional":true},{"reason":"Required for localization support.","package":"Flask-Babel","optional":true}],"imports":[{"note":"The `flask.ext` prefix is deprecated since Flask 0.9. Always use direct imports like `flask_admin`.","wrong":"from flask.ext.admin import Admin","symbol":"Admin","correct":"from flask_admin import Admin"},{"symbol":"ModelView (SQLAlchemy)","correct":"from flask_admin.contrib.sqla import ModelView"},{"symbol":"BaseView","correct":"from flask_admin import BaseView, expose"}],"quickstart":{"code":"import os\nfrom flask import Flask\nfrom flask_sqlalchemy import SQLAlchemy\nfrom flask_admin import Admin\nfrom flask_admin.contrib.sqla import ModelView\n\napp = Flask(__name__)\napp.config['SECRET_KEY'] = 'a_hard_to_guess_secret_key'\napp.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URL', 'sqlite:///admin.db')\napp.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False\n\ndb = SQLAlchemy(app)\n\n# Define a simple model\nclass User(db.Model):\n    id = db.Column(db.Integer, primary_key=True)\n    name = db.Column(db.String(80), unique=True, nullable=False)\n    email = db.Column(db.String(120), unique=True, nullable=False)\n\n    def __repr__(self):\n        return '<User %r>' % self.name\n\n# Create tables (if they don't exist)\nwith app.app_context():\n    db.create_all()\n\n# Initialize Flask-Admin\nadmin = Admin(app, name='My Admin', template_mode='bootstrap4')\n\n# Add views\nadmin.add_view(ModelView(User, db.session))\n\n@app.route('/')\ndef index():\n    return '<p>Hello from Flask! Go to <a href=\"/admin/\">/admin/</a> to manage users.</p>'\n\nif __name__ == '__main__':\n    app.run(debug=True)","lang":"python","description":"This quickstart sets up a basic Flask application with Flask-Admin, using Flask-SQLAlchemy and a SQLite database. It defines a `User` model and registers it with the admin interface, providing instant CRUD functionality. Ensure `Flask-SQLAlchemy` is also installed for this example."},"warnings":[{"fix":"Upgrade your Python environment to 3.10 or newer.","message":"Flask-Admin dropped support for Python versions older than 3.10 starting with v2.0.0. Ensure your environment uses Python 3.10 or newer.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Refactor S3FileAdmin initialization to pass a `boto3.client('s3')` instance via `s3_client`.","message":"S3 file management (`S3FileAdmin`) has replaced the `boto` library with `boto3`. The constructor now requires an `s3_client` parameter (a `boto3.client('s3')` instance) instead of `aws_access_key_id`, `aws_secret_access_key`, and `region` parameters.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Update AzureFileAdmin initialization to use a `blob_service_client` from the v12 SDK.","message":"Azure Blob Storage (`AzureFileAdmin`) has upgraded its SDK from legacy v2 to v12. The constructor now requires a `blob_service_client` parameter (an instance of Azure's `BlobServiceClient`) instead of a `connection_string`.","severity":"breaking","affected_versions":">=2.0.0a4"},{"fix":"Change all `from flask.ext.admin import ...` statements to `from flask_admin import ...`.","message":"The `flask.ext` import pattern (e.g., `from flask.ext.admin import Admin`) is deprecated and should no longer be used. Direct imports (e.g., `from flask_admin import Admin`) are the correct approach.","severity":"deprecated","affected_versions":"<2.0.0 (legacy Flask versions), but fix applies to all."},{"fix":"Install necessary optional dependencies explicitly, e.g., `pip install flask-admin[sqla]` for SQLAlchemy integration or `pip install boto3` for S3 support.","message":"Flask-Admin does not install database or file storage backend dependencies (e.g., SQLAlchemy, boto3, azure-storage-blob) by default. You must install these separately, often using `pip install flask-admin[extra]` or by listing them in your `requirements.txt`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Utilize Jinja2's `{% extends '...' %}` and `{% block ... %}` features to inherit from Flask-Admin's base templates (`admin/master.html`, `admin/model/list.html`, etc.) and override only specific sections.","message":"When customizing the admin interface, fully overriding built-in templates can make future upgrades difficult. It's generally recommended to extend the existing templates rather than replacing them entirely.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}