-
-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
π Add Korean translation for
docs/ko/docs/tutorial/static-files.md
(#β¦
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# μ μ νμΌ | ||
|
||
'StaticFiles'λ₯Ό μ¬μ©νμ¬ λλ ν 리μμ μ μ νμΌμ μλμΌλ‘ μ 곡ν μ μμ΅λλ€. | ||
|
||
## `StaticFiles` μ¬μ© | ||
|
||
* `StaticFiles` μν¬νΈν©λλ€. | ||
* νΉμ κ²½λ‘μ `StaticFiles()` μΈμ€ν΄μ€λ₯Ό "λ§μ΄νΈ" ν©λλ€. | ||
|
||
```Python hl_lines="2 6" | ||
{!../../../docs_src/static_files/tutorial001.py!} | ||
``` | ||
|
||
!!! note "κΈ°μ μ μΈλΆμ¬ν" | ||
`from starlette.staticfiles import StaticFiles` λ₯Ό μ¬μ©ν μλ μμ΅λλ€. | ||
|
||
**FastAPI**λ λ¨μ§ κ°λ°μμΈ, λΉμ μκ² νΈμλ₯Ό μ 곡νκΈ° μν΄ `fastapi.static files` μ λμΌν `starlett.static files`λ₯Ό μ 곡ν©λλ€. νμ§λ§ μ¬μ€ μ΄κ²μ Starlettμμ μ§μ μ¨ κ²μ λλ€. | ||
|
||
### "λ§μ΄ν " μ΄λ | ||
|
||
"λ§μ΄ν "μ νΉμ κ²½λ‘μ μμ ν "λ 립μ μΈ" μ ν리μΌμ΄μ μ μΆκ°νλ κ²μ μλ―Ένλλ°, κ·Έ ν λͺ¨λ νμ κ²½λ‘μ λν΄μλ μ μ©λ©λλ€. | ||
|
||
λ§μ΄νΈλ μμ© νλ‘κ·Έλ¨μ μμ ν λ 립μ μ΄κΈ° λλ¬Έμ `APIRouter`λ₯Ό μ¬μ©νλ κ²κ³Όλ λ€λ¦ λλ€. OpenAPI λ° μμ© νλ‘κ·Έλ¨μ λ¬Έμλ λ§μ΄νΈλ μμ© νλ‘κ·Έλ¨ λ±μμ μ΄λ€ κ²λ ν¬ν¨νμ§ μμ΅λλ€. | ||
|
||
μμΈν λ΄μ©μ **μλ ¨λ μ¬μ©μ μλ΄μ**μμ νμΈν μ μμ΅λλ€. | ||
|
||
## μΈλΆμ¬ν | ||
|
||
첫 λ²μ§Έ `"/static"`μ μ΄ "νμ μμ© νλ‘κ·Έλ¨"μ΄ "λ§μ΄νΈ"λ νμ κ²½λ‘λ₯Ό κ°λ¦¬ν΅λλ€. λ°λΌμ `"/static"`μΌλ‘ μμνλ λͺ¨λ κ²½λ‘λ `"/static"`μΌλ‘ μ²λ¦¬λ©λλ€. | ||
|
||
`'directory="static"`μ μ μ νμΌμ΄ λ€μ΄ μλ λλ ν 리μ μ΄λ¦μ λνλ λλ€. | ||
|
||
`name="static"`μ **FastAPI**μμ λ΄λΆμ μΌλ‘ μ¬μ©ν μ μλ μ΄λ¦μ μ 곡ν©λλ€. | ||
|
||
μ΄ λͺ¨λ 맀κ°λ³μλ "`static`"κ³Ό λ€λ₯Ό μ μμΌλ©°, μ¬μ©μ μμ© νλ‘κ·Έλ¨μ μꡬ μ¬ν λ° κ΅¬μ²΄μ μΈ μΈλΆ μ 보μ λ°λΌ 맀κ°λ³μλ₯Ό μ‘°μ ν μ μμ΅λλ€. | ||
|
||
|
||
## μΆκ° μ 보 | ||
|
||
μμΈν λ΄μ©κ³Ό μ ν μ¬νμ λ³΄λ €λ©΄ <a href="https://www.starlette.io/staticfiles/" class="external-link" target="_blank">Starletteμ μ μ νμΌμ κ΄ν λ¬Έμ</a>λ₯Ό νμΈνμμμ€. |