Unable to install in simple FastAPI app
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 35/100
调研方向
首先将应用程序设置与 examples/main.py 进行比较,重点关注 admin_app 的启动配置及其挂载到 /admin 的方式。在本地复现 404,并验证完成设置后可通过 http://localhost:8000/admin 提供管理页面。
由索引模型根据 Issue 内容生成。
描述
Hey,
I'm trying to install this in a small FastAPI application but so far when i go to http://localhost:8000/admin i just get a 404
I setup the application getting inspiration from https://github.com/fastapi-admin/fastapi-admin/blob/dev/examples/main.py . So I did install fastapi-admin and then applied this configuration:
def create_application():
app = FastAPI(title=settings.PROJECT_NAME)
@app.on_event("startup")
async def startup():
redis = await aioredis.from_url(
"redis://redis/1", encoding="utf8", decode_responses=True
)
await admin_app.configure(
logo_url="https://preview.tabler.io/static/logo-white.svg",
redis=redis,
providers=[UsernamePasswordProvider(admin_model=Users)],
)
app = create_application()
app.mount("/admin", admin_app)
I have other routes that work correctly and i didn't include in this snippet because they are not relevant for this issue. What am I doing wrong to configure fastapi-admin?
- 主要语言
- Python
- 星标
- 3.8k
- 派生
- 466
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fastapi-admin/fastapi-admin 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 62/100
fastapi-admin/fastapi-admin#187 ·
-
难度 4/5 3-5 天 新手友好度 30/100
fastapi-admin/fastapi-admin#197 ·
-
难度 5/5 一周以上 新手友好度 20/100
fastapi-admin/fastapi-admin#196 ·
-
难度 5/5 一周以上 新手友好度 10/100
fastapi-admin/fastapi-admin#194 · 2 条评论 ·
-
支持代理站吗未关闭
难度 5/5 一周以上 新手友好度 20/100
fastapi-admin/fastapi-admin#193 ·
查看 fastapi-admin/fastapi-admin 的全部 Issue
相似的 Issue
-
needs-human needs-triage
难度 2/5 1-3 小时 新手友好度 76/100
gke-labs/kube-agents#2400 · 1 条评论 ·
维护者通常 1 天内回复
-
Device Details tables: FS/SF columns contradict each other (nfet_01v8 Vt row, pfet_01v8 Idsat row)未关闭
难度 2/5 1-3 小时 新手友好度 75/100
google/skywater-pdk#450 ·
-
Drained trajectory arrays are overwritten when the sequence buffer is reused可能已有人在做 @sylvesterkaczmarek 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
google-deepmind/bsuite#56 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
LearningCircuit/local-deep-research#7206 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
chingu-voyages/V62-tier3-team-33#285 ·
维护者通常 1 天内回复