Skip to content


You should configure predefined app from fastapi-admin on startup event of fastapi, because which should be in asyncio loop context.

import aioredis
from fastapi import FastAPI
from import app as admin_app
from fastapi_admin.providers.login import UsernamePasswordProvider
from examples.models import Admin

app = FastAPI()

async def startup():
    redis = await aioredis.create_redis_pool(address='redis://localhost')
    await admin_app.configure(
                login_logo_url="", admin_model=Admin


  • logo_url: Will show the logo image in admin dashboard.
  • admin_path: Default is /admin, but you can change to other path.
  • maintenance: If set to true, all pages will be redirected to the /maintenance page. (💗 Pro only)
  • redis: Instance of aioredis.
  • default_locale: Current support zh_CN and en_US, default is en_US.
  • template_folders: Template folders registered to jinja2 and also can be used to override builtin templates.
  • providers: List of providers to register, all are subclasses of fastapi_admin.providers.Provider.
  • language_switch: Whether show a language switch in page, default is True.
  • default_layout: Set default layout, current there are both layouts layout.html and layout-navbar.html, default is layout.html. (💗 Pro only)

Last update: August 28, 2022 06:31:41