{"id":10263,"library":"starlette-admin","title":"Starlette Admin","description":"Starlette Admin is a fast, beautiful, and extensible administrative interface framework designed for Starlette and FastAPI applications. It provides a robust backend to manage your database models with support for various ORMs like SQLAlchemy, MongoDB (via Motor/Beanie), Odmantic, and Tortoise ORM. The current version is 0.16.0, and it maintains an active release cadence with frequent updates and bug fixes.","status":"active","version":"0.16.0","language":"python","source_language":"en","source_url":"https://github.com/jowilf/starlette-admin","tags":["admin","starlette","fastapi","orm","web-framework","dashboard"],"install":[{"cmd":"pip install starlette-admin","lang":"bash","label":"Core Installation"},{"cmd":"pip install \"starlette-admin[sqla]\"","lang":"bash","label":"With SQLAlchemy support"},{"cmd":"pip install \"starlette-admin[beanie]\"","lang":"bash","label":"With Beanie (MongoDB) support"},{"cmd":"pip install \"starlette-admin[full]\"","lang":"bash","label":"With all ORM and extra features"}],"dependencies":[{"reason":"Required for SQLAlchemyModelView. Installed via `[sqla]` extra.","package":"SQLAlchemy","optional":true},{"reason":"Required for BeanieModelView (MongoDB ODM). Installed via `[beanie]` extra.","package":"beanie","optional":true},{"reason":"Required for OdmanticModelView (MongoDB ODM). Installed via `[odmantic]` extra.","package":"odmantic","optional":true},{"reason":"Required for TortoiseORMModelView. Installed via `[tortoise]` extra.","package":"tortoise-orm","optional":true}],"imports":[{"note":"The Admin class is located in the `app` submodule.","wrong":"from starlette_admin import Admin","symbol":"Admin","correct":"from starlette_admin.app import Admin"},{"note":"ORM-specific ModelViews are located in `contrib.*` submodules (e.g., `sqla`, `beanie`). The base `ModelView` in `views` is abstract.","wrong":"from starlette_admin.views import ModelView","symbol":"ModelView","correct":"from starlette_admin.contrib.sqla import ModelView"},{"symbol":"BaseModelView","correct":"from starlette_admin.views import BaseModelView"}],"quickstart":{"code":"import uvicorn\nfrom fastapi import FastAPI\nfrom sqlalchemy import create_engine, Column, Integer, String\nfrom sqlalchemy.orm import declarative_base, sessionmaker\n\nfrom starlette_admin.app import Admin\nfrom starlette_admin.contrib.sqla import ModelView\n\n# 1. Setup Database (SQLAlchemy Example)\nDATABASE_URL = \"sqlite:///./test.db\"\nengine = create_engine(DATABASE_URL, connect_args={\"check_same_thread\": False})\nSessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)\nBase = declarative_base()\n\nclass User(Base):\n    __tablename__ = \"users\"\n    id = Column(Integer, primary_key=True, index=True)\n    name = Column(String)\n    email = Column(String, unique=True, index=True)\n\n# Create tables\nBase.metadata.create_all(bind=engine)\n\n# 2. Setup FastAPI App\napp = FastAPI()\n\n# 3. Setup Starlette Admin\nadmin = Admin(engine, title=\"My Admin Dashboard\")\n\n# Add ModelViews\nadmin.add_view(ModelView(User))\n\n# Mount Admin to FastAPI\nadmin.mount_to(app)\n\n# Optional: Add a root route\n@app.get(\"/\", include_in_schema=False)\nasync def read_root():\n    return {\"message\": \"Welcome to FastAPI with Starlette Admin!\"}\n\nif __name__ == \"__main__\":\n    # Populate some data if needed (run once)\n    with SessionLocal() as db:\n        if not db.query(User).first():\n            db.add(User(name=\"Alice\", email=\"alice@example.com\"))\n            db.add(User(name=\"Bob\", email=\"bob@example.com\"))\n            db.commit()\n    uvicorn.run(app, host=\"0.0.0.0\", port=8000)\n","lang":"python","description":"This quickstart demonstrates how to integrate Starlette Admin with a FastAPI application using SQLAlchemy. It sets up a basic `User` model, initializes the admin interface with a `ModelView` for `User`, and mounts it to the FastAPI app. Ensure you install `starlette-admin[sqla]` and `uvicorn` to run this example."},"warnings":[{"fix":"Install with `pip install \"starlette-admin[<orm_name>]\"` (e.g., `starlette-admin[sqla]`)","message":"When using ORM-specific ModelViews (e.g., `SQLAlchemyModelView`, `BeanieModelView`), ensure you install the correct extra dependencies (e.g., `starlette-admin[sqla]`, `starlette-admin[beanie]`) to avoid `ModuleNotFoundError`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review Odmantic v1.0 migration guides and update your Odmantic models and database interactions accordingly. Then, upgrade `starlette-admin`.","message":"Version 0.15.0 upgraded Odmantic support to v1.0+. If you were using Odmantic with an older version of `starlette-admin` (pre-0.15.0) and Odmantic v0.x, you might face breaking changes due to Odmantic's API changes.","severity":"breaking","affected_versions":"<0.15.0 (when upgrading from older Odmantic)"},{"fix":"Implement custom authentication/authorization using Starlette/FastAPI's security features and integrate it with Starlette Admin via custom routes or middleware.","message":"Authentication and authorization are not included by default. You must implement your own security layer (e.g., using `starlette.middleware.authentication.AuthMiddleware` or FastAPI's dependency injection) to protect your admin panel.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to `starlette-admin` version 0.15.0 or newer to resolve these warnings. No code changes are typically required on your end unless you've customized templates.","message":"Older versions (pre-0.15.0) might trigger deprecation warnings related to `TemplateResponse` and `Jinja2Templates` usage from Starlette. These have been addressed in 0.15.0.","severity":"deprecated","affected_versions":"<0.15.0"}],"env_vars":null,"search_vec":"'0.16.0':48 'activ':53 'admin':2,4,62 'administr':11 'applic':19 'backend':24 'beauti':8 'bug':60 'cadenc':55 'current':45 'dashboard':69 'databas':28 'design':14 'extens':10 'fast':7 'fastapi':18,64 'fix':61 'framework':13,68 'frequent':57 'interfac':12 'like':35 'maintain':51 'manag':26 'model':29 'mongodb':37 'motor/beanie':39 'odmant':40 'orm':34,43,65 'provid':21 'releas':54 'robust':23 'sqlalchemi':36 'starlett':1,3,16,63 'support':31 'tortois':42 'updat':58 'various':33 'version':46 'via':38 'web':67 'web-framework':66","created_at":"2026-04-17T01:23:12.908792+00:00","updated_at":"2026-04-17T01:23:12.908792+00:00","problems":{"verify_error":"/tmp/tmpi6m7y9oz/venv/lib/python3.12/site-packages/starlette_admin/__init__.py:9: StarletteDeprecationWarning: 'HTTP_422_UNPROCESSABLE_ENTITY' is deprecated. Use 'HTTP_422_UNPROCESSABLE_CONTENT' instead.\n  from .base import BaseAdmin as BaseAdmin\n/tmp/tmpi6m7y9oz/venv/lib/python3.12/site-packages/st"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.16.1","cli_name":"","cli_version":null,"type":"library","homepage":"https://starlette-admin.org","github":"https://github.com/jowilf/starlette-admin","docs":"https://jowilf.github.io/starlette-admin","changelog":"https://jowilf.github.io/starlette-admin/changelog/","pypi":"https://pypi.org/project/starlette-admin/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"install_fail","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-09","install_tag":null}}