Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌐 Add Korean translation for docs/ko/docs/tutorial/static-files.md #2957

Merged
merged 9 commits into from
Jan 22, 2024
40 changes: 40 additions & 0 deletions docs/ko/docs/tutorial/static-files.md
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>λ₯Ό ν™•μΈν•˜μ‹­μ‹œμ˜€.