mirror of
https://github.com/fastapi/fastapi.git
synced 2026-07-18 10:53:07 -04:00
* 🌐 💬 🩺 🦲 * 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks * 🛠️😊 * ♻️ Rename emoji lang from emj to em, and main docs name as 😉 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Axd1x8a <26704473+FeeeeK@users.noreply.github.com> Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
40 lines
1.3 KiB
Markdown
40 lines
1.3 KiB
Markdown
# 🎻 📁
|
||
|
||
👆 💪 🍦 🎻 📁 🔁 ⚪️➡️ 📁 ⚙️ `StaticFiles`.
|
||
|
||
## ⚙️ `StaticFiles`
|
||
|
||
* 🗄 `StaticFiles`.
|
||
* "🗻" `StaticFiles()` 👐 🎯 ➡.
|
||
|
||
```Python hl_lines="2 6"
|
||
{!../../../docs_src/static_files/tutorial001.py!}
|
||
```
|
||
|
||
!!! note "📡 ℹ"
|
||
👆 💪 ⚙️ `from starlette.staticfiles import StaticFiles`.
|
||
|
||
**FastAPI** 🚚 🎏 `starlette.staticfiles` `fastapi.staticfiles` 🏪 👆, 👩💻. ✋️ ⚫️ 🤙 👟 🔗 ⚪️➡️ 💃.
|
||
|
||
### ⚫️❔ "🗜"
|
||
|
||
"🗜" ⛓ ❎ 🏁 "🔬" 🈸 🎯 ➡, 👈 ⤴️ ✊ 💅 🚚 🌐 🎧-➡.
|
||
|
||
👉 🎏 ⚪️➡️ ⚙️ `APIRouter` 🗻 🈸 🍕 🔬. 🗄 & 🩺 ⚪️➡️ 👆 👑 🈸 🏆 🚫 🔌 🕳 ⚪️➡️ 🗻 🈸, ♒️.
|
||
|
||
👆 💪 ✍ 🌅 🔃 👉 **🏧 👩💻 🦮**.
|
||
|
||
## ℹ
|
||
|
||
🥇 `"/static"` 🔗 🎧-➡ 👉 "🎧-🈸" 🔜 "🗻" 🔛. , 🙆 ➡ 👈 ▶️ ⏮️ `"/static"` 🔜 🍵 ⚫️.
|
||
|
||
`directory="static"` 🔗 📛 📁 👈 🔌 👆 🎻 📁.
|
||
|
||
`name="static"` 🤝 ⚫️ 📛 👈 💪 ⚙️ 🔘 **FastAPI**.
|
||
|
||
🌐 👫 🔢 💪 🎏 🌘 "`static`", 🔆 👫 ⏮️ 💪 & 🎯 ℹ 👆 👍 🈸.
|
||
|
||
## 🌅 ℹ
|
||
|
||
🌖 ℹ & 🎛 ✅ <a href="https://www.starlette.io/staticfiles/" class="external-link" target="_blank">💃 🩺 🔃 🎻 📁</a>.
|