🎻 📁¶
👆 💪 🍦 🎻 📁 🔁 ⚪️➡️ 📁 ⚙️ StaticFiles
.
⚙️ StaticFiles
¶
- 🗄
StaticFiles
. - "🗻"
StaticFiles()
👐 🎯 ➡.
from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
app = FastAPI()
app.mount("/static", StaticFiles(directory="static"), name="static")
📡 ℹ
👆 💪 ⚙️ from starlette.staticfiles import StaticFiles
.
FastAPI 🚚 🎏 starlette.staticfiles
fastapi.staticfiles
🏪 👆, 👩💻. ✋️ ⚫️ 🤙 👟 🔗 ⚪️➡️ 💃.
⚫️❔ "🗜"¶
"🗜" ⛓ ❎ 🏁 "🔬" 🈸 🎯 ➡, 👈 ⤴️ ✊ 💅 🚚 🌐 🎧-➡.
👉 🎏 ⚪️➡️ ⚙️ APIRouter
🗻 🈸 🍕 🔬. 🗄 & 🩺 ⚪️➡️ 👆 👑 🈸 🏆 🚫 🔌 🕳 ⚪️➡️ 🗻 🈸, ♒️.
👆 💪 ✍ 🌅 🔃 👉 🏧 👩💻 🦮.
ℹ¶
🥇 "/static"
🔗 🎧-➡ 👉 "🎧-🈸" 🔜 "🗻" 🔛. , 🙆 ➡ 👈 ▶️ ⏮️ "/static"
🔜 🍵 ⚫️.
directory="static"
🔗 📛 📁 👈 🔌 👆 🎻 📁.
name="static"
🤝 ⚫️ 📛 👈 💪 ⚙️ 🔘 FastAPI.
🌐 👫 🔢 💪 🎏 🌘 "static
", 🔆 👫 ⏮️ 💪 & 🎯 ℹ 👆 👍 🈸.
🌅 ℹ¶
🌖 ℹ & 🎛 ✅ 💃 🩺 🔃 🎻 📁.