Coverage for docs_src/settings/tutorial001_pv1.py: 100%
11 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-08-08 03:53 +0000
1from fastapi import FastAPI 1abcde
2from pydantic import BaseSettings 1abcde
5class Settings(BaseSettings): 1abcde
6 app_name: str = "Awesome API" 1abcde
7 admin_email: str 1abcde
8 items_per_user: int = 50 1abcde
11settings = Settings() 1abcde
12app = FastAPI() 1abcde
15@app.get("/info") 1abcde
16async def info(): 1abcde
17 return { 1abcde
18 "app_name": settings.app_name,
19 "admin_email": settings.admin_email,
20 "items_per_user": settings.items_per_user,
21 }