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
54 changes: 54 additions & 0 deletions docs/ko/docs/tutorial/static-files.md
@@ -0,0 +1,54 @@
# 정적 파일

'StaticFiles'λ₯Ό μ‚¬μš©ν•˜μ—¬ λ””λ ‰ν† λ¦¬μ—μ„œ 정적 νŒŒμΌμ„ μžλ™μœΌλ‘œ μ œκ³΅ν•  수 μžˆμŠ΅λ‹ˆλ‹€.

## `aiofiles` μ„€μΉ˜
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved

λ¨Όμ € `aiofiles` λ₯Ό μ„€μΉ˜ν•΄μ•Ό ν•©λ‹ˆλ‹€:

<div class="termy">

```console
$ pip install aiofiles

---> 100%
```

</div>

## `StaticFiles` μ‚¬μš©

* `StaticFiles` μž„ν¬νŠΈν•©λ‹ˆλ‹€.
* νŠΉμ • κ²½λ‘œμ— `StaticFiles()` μΈμŠ€ν„΄μŠ€λ₯Ό "Mount" ν•©λ‹ˆλ‹€.
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved

```Python hl_lines="2 6"
{!../../../docs_src/static_files/tutorial001.py!}
```

!!! note "기술 세뢀사항"
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved
`from starlette.staticfiles import StaticFiles` λ₯Ό μ‚¬μš©ν•  μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€.

**FastAPI**λŠ” 개발자인 λ‹Ήμ‹ μ—κ²Œ 편의λ₯Ό μ œκ³΅ν•˜κΈ° μœ„ν•΄ `fastapi.static files` 와 λ™μΌν•œ `starlett.static files`λ₯Ό μ œκ³΅ν•©λ‹ˆλ‹€. ν•˜μ§€λ§Œ 사싀은 starlettμ—μ„œ 직접 온 κ²ƒμž…λ‹ˆλ‹€.
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved

### "λ§ˆμš΄νŒ…" μ΄λž€

"λ§ˆμš΄νŒ…"은 νŠΉμ • κ²½λ‘œμ— μ™„μ „ν•œ "독립적인" μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ„ μΆ”κ°€ν•œ ν›„ λͺ¨λ“  ν•˜μœ„ 경둜λ₯Ό μ²˜λ¦¬ν•˜λŠ” 것을 μ˜λ―Έν•©λ‹ˆλ‹€.
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved

마운트된 μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ΄ μ™„μ „νžˆ 독립적이기 λ•Œλ¬Έμ— `APIRouter`λ₯Ό μ‚¬μš©ν•˜λŠ” κ²ƒκ³ΌλŠ” λ‹€λ¦…λ‹ˆλ‹€. OpenAPI 및 μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ λ¬Έμ„œμ—λŠ” 마운트된 μ‘μš© ν”„λ‘œκ·Έλž¨μ˜ μ–΄λ–€ 것도 ν¬ν•¨λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved

μžμ„Έν•œ λ‚΄μš©μ€ **κ³ κΈ‰ μ‚¬μš©μž μ•ˆλ‚΄μ„œ**μ—μ„œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved

## 세뢀사항

첫 번째 `"/static"`은 이 "ν•˜μœ„ μ• ν”Œλ¦¬μΌ€μ΄μ…˜"이 "마운트"될 ν•˜μœ„ 경둜λ₯Ό κ°€λ¦¬ν‚΅λ‹ˆλ‹€. λ”°λΌμ„œ `"/static"`으둜 μ‹œμž‘ν•˜λŠ” λͺ¨λ“  κ²½λ‘œλŠ” `"/static"`으둜 μ²˜λ¦¬λ©λ‹ˆλ‹€.
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved

`'directory="static"`은 정적 파일이 λ“€μ–΄ μžˆλŠ” λ””λ ‰ν† λ¦¬μ˜ 이름을 λ‚˜νƒ€λƒ…λ‹ˆλ‹€.

`name="static"`은 **FastAPI**μ—μ„œ λ‚΄λΆ€μ μœΌλ‘œ μ‚¬μš©ν•  수 μžˆλŠ” 이름을 μ œκ³΅ν•©λ‹ˆλ‹€.

이 λͺ¨λ“  λ§€κ°œλ³€μˆ˜λŠ” "`static`"κ³Ό λ‹€λ₯Ό 수 있으며, μ‚¬μš©μž μ• ν”Œλ¦¬μΌ€μ΄μ…˜μ˜ μš”κ΅¬ 사항 및 ꡬ체적인 μ„ΈλΆ€ 정보에 따라 λ§€κ°œλ³€μˆ˜λ₯Ό μ‘°μ •ν•  수 μžˆμŠ΅λ‹ˆλ‹€.
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved


## 좔가정보
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved

μžμ„Έν•œ λ‚΄μš©κ³Ό μ˜΅μ…˜μ„ 보렀면 <a href="https://www.starlette.io/staticfiles/" class="external-link" target="_blank">Starlette의 정적 νŒŒμΌμ— κ΄€ν•œ λ¬Έμ„œ</a>λ₯Ό ν™•μΈν•˜μ‹­μ‹œμ˜€.
jeesang7 marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions docs/ko/mkdocs.yml
Expand Up @@ -50,6 +50,8 @@ nav:
- tr: /tr/
- uk: /uk/
- zh: /zh/
- μžμŠ΅μ„œ - μ‚¬μš©μž μ•ˆλ‚΄μ„œ:
- tutorial/static-files.md
markdown_extensions:
- toc:
permalink: true
Expand Down