🎲 🗄¶
🚥 👆 💪, 👆 💪 ⚙️ ⚒ & 🌐 🔢 🔗 🗄 ✔ ⚓️ 🔛 🌐, & ❎ ⚫️ 🍕.
🔃 💂♂, 🔗, & 🩺¶
🕵♂ 👆 🧾 👩💻 🔢 🏭 🚫🔜 🚫 🌌 🛡 👆 🛠️.
👈 🚫 🚮 🙆 ➕ 💂♂ 👆 🛠️, ➡ 🛠️ 🔜 💪 🌐❔ 👫.
🚥 📤 💂♂ ⚠ 👆 📟, ⚫️ 🔜 🔀.
🕵♂ 🧾 ⚒ ⚫️ 🌅 ⚠ 🤔 ❔ 🔗 ⏮️ 👆 🛠️, & 💪 ⚒ ⚫️ 🌅 ⚠ 👆 ℹ ⚫️ 🏭. ⚫️ 💪 🤔 🎯 📨 💂♂ 🔘 🌌.
🚥 👆 💚 🔐 👆 🛠️, 📤 📚 👍 👜 👆 💪, 🖼:
- ⚒ 💭 👆 ✔️ 👍 🔬 Pydantic 🏷 👆 📨 💪 & 📨.
- 🔗 🙆 ✔ ✔ & 🔑 ⚙️ 🔗.
- 🙅 🏪 🔢 🔐, 🕴 🔐#️⃣.
- 🛠️ & ⚙️ 👍-💭 🔐 🧰, 💖 🇸🇲 & 🥙 🤝, ♒️.
- 🚮 🌅 🧽 ✔ 🎛 ⏮️ Oauth2️⃣ ↔ 🌐❔ 💪.
- ...♒️.
👐, 👆 5️⃣📆 ✔️ 📶 🎯 ⚙️ 💼 🌐❔ 👆 🤙 💪 ❎ 🛠️ 🩺 🌐 (✅ 🏭) ⚖️ ⚓️ 🔛 📳 ⚪️➡️ 🌐 🔢.
🎲 🗄 ⚪️➡️ ⚒ & 🇨🇻 {¶
👆 💪 💪 ⚙️ 🎏 Pydantic ⚒ 🔗 👆 🏗 🗄 & 🩺 ⚜.
🖼:
from fastapi import FastAPI
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
openapi_url: str = "/openapi.json"
settings = Settings()
app = FastAPI(openapi_url=settings.openapi_url)
@app.get("/")
def root():
return {"message": "Hello World"}
📥 👥 📣 ⚒ openapi_url
⏮️ 🎏 🔢 "/openapi.json"
.
& ⤴️ 👥 ⚙️ ⚫️ 🕐❔ 🏗 FastAPI
📱.
⤴️ 👆 💪 ❎ 🗄 (✅ 🎚 🩺) ⚒ 🌐 🔢 OPENAPI_URL
🛁 🎻, 💖:
$ OPENAPI_URL= uvicorn main:app
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
⤴️ 🚥 👆 🚶 📛 /openapi.json
, /docs
, ⚖️ /redoc
👆 🔜 🤚 404 Not Found
❌ 💖:
{
"detail": "Not Found"
}