mirror of
https://github.com/fastapi-admin/fastapi-admin.git
synced 2025-08-14 18:58:13 +08:00
Auto register permission
This commit is contained in:
@ -28,14 +28,14 @@ async def test_bulk(bulk_in: BulkIn, model=Depends(get_model)):
|
||||
return ret.dict()
|
||||
|
||||
|
||||
@admin_app.get("/home",)
|
||||
@admin_app.get("/home", )
|
||||
async def home():
|
||||
return {"html": templates.get_template("home.html").render()}
|
||||
|
||||
|
||||
def create_app():
|
||||
fast_app = FastAPI(debug=False)
|
||||
register_tortoise(fast_app, config=TORTOISE_ORM, generate_schemas=True)
|
||||
register_tortoise(fast_app, config=TORTOISE_ORM)
|
||||
fast_app.mount("/admin", admin_app)
|
||||
|
||||
fast_app.add_middleware(
|
||||
@ -54,7 +54,7 @@ app = create_app()
|
||||
|
||||
@app.on_event("startup")
|
||||
async def start_up():
|
||||
admin_app.init( # nosec
|
||||
await admin_app.init( # nosec
|
||||
admin_secret="test",
|
||||
permission=True,
|
||||
site=Site(
|
||||
|
Reference in New Issue
Block a user