]> git.ipfire.org Git - thirdparty/fastapi/fastapi.git/commitdiff
🌐 Add Korean translation for `/docs/ko/docs/environment-variables.md` (#12526)
authorHyunjun KIM <hihj070914@icloud.com>
Thu, 7 Nov 2024 20:57:27 +0000 (05:57 +0900)
committerGitHub <noreply@github.com>
Thu, 7 Nov 2024 20:57:27 +0000 (20:57 +0000)
docs/ko/docs/environment-variables.md [new file with mode: 0644]

diff --git a/docs/ko/docs/environment-variables.md b/docs/ko/docs/environment-variables.md
new file mode 100644 (file)
index 0000000..09c2fd6
--- /dev/null
@@ -0,0 +1,298 @@
+# ν™˜κ²½ λ³€μˆ˜
+
+/// tip | "팁"
+
+λ§Œμ•½ "ν™˜κ²½ λ³€μˆ˜"κ°€ λ¬΄μ—‡μ΄κ³ , μ–΄λ–»κ²Œ μ‚¬μš©ν•˜λŠ”μ§€ μ•Œκ³  κ³„μ‹œλ‹€λ©΄, μ΄ μ±•ν„°λ₯Ό μŠ€ν‚΅ν•˜μ…”λ„ μ’‹μŠ΅λ‹ˆλ‹€.
+
+///
+
+ν™˜κ²½ λ³€μˆ˜λŠ” νŒŒμ΄μ¬ μ½”λ“œμ˜ **λ°”κΉ₯**인, **운영 μ²΄μ œ**에 μ‘΄μž¬ν•˜λŠ” λ³€μˆ˜μž…λ‹ˆλ‹€. νŒŒμ΄μ¬ μ½”λ“œλ‚˜ λ‹€λ₯Έ ν”„λ‘œκ·Έλž¨μ—μ„œ μ½μ„ μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+ν™˜κ²½ λ³€μˆ˜λŠ” μ• ν”Œλ¦¬μΌ€μ΄μ…˜ **μ„€μ •**을 μ²˜λ¦¬ν•˜κ±°λ‚˜, νŒŒμ΄μ¬μ˜ **μ„€μΉ˜** κ³Όμ •μ˜ μΌλΆ€λ‘œ μœ μš©ν•©λ‹ˆλ‹€.
+
+## ν™˜κ²½ λ³€μˆ˜λ₯Ό λ§Œλ“€κ³  μ‚¬μš©ν•˜κΈ°
+
+파이썬 μ—†μ΄λ„, **μ…Έ (터미널)** μ—μ„œ ν™˜κ²½ λ³€μˆ˜λ₯Ό **생성** ν•˜κ³  μ‚¬μš©ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+//// tab | Linux, macOS, Windows Bash
+
+<div class="termy">
+
+```console
+// You could create an env var MY_NAME with
+$ export MY_NAME="Wade Wilson"
+
+// Then you could use it with other programs, like
+$ echo "Hello $MY_NAME"
+
+Hello Wade Wilson
+```
+
+</div>
+
+////
+
+//// tab | Windows PowerShell
+
+<div class="termy">
+
+```console
+// Create an env var MY_NAME
+$ $Env:MY_NAME = "Wade Wilson"
+
+// Use it with other programs, like
+$ echo "Hello $Env:MY_NAME"
+
+Hello Wade Wilson
+```
+
+</div>
+
+////
+
+## νŒŒμ΄μ¬μ—μ„œ ν™˜κ²½ λ³€μˆ˜ μ½κΈ°
+
+파이썬 **λ°”κΉ₯**인 ν„°λ―Έλ„μ—μ„œ(λ‹€λ₯Έ λ„κ΅¬λ‘œλ„ κ°€λŠ₯) ν™˜κ²½ λ³€μˆ˜λ₯Ό μƒμ„±λ„ ν•  μˆ˜λ„ μžˆκ³ , μ΄λ₯Ό **νŒŒμ΄μ¬μ—μ„œ μ½μ„ μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.**
+
+예λ₯Ό λ“€μ–΄ λ‹€μŒκ³Ό κ°™μ€ `main.py` νŒŒμΌμ΄ μžˆλ‹€κ³  ν•©μ‹œλ‹€:
+
+```Python hl_lines="3"
+import os
+
+name = os.getenv("MY_NAME", "World")
+print(f"Hello {name} from Python")
+```
+
+/// tip | "팁"
+
+<a href="https://docs.python.org/3.8/library/os.html#os.getenv" class="external-link" target="_blank">`os.getenv()`</a> μ˜ λ‘ λ²ˆμ§Έ μΈμžλŠ” λ°˜ν™˜ν•  κΈ°λ³Έκ°’μž…λ‹ˆλ‹€.
+
+μ—¬κΈ°μ„œλŠ” `"World"`λ₯Ό λ„£μ—ˆκΈ°μ— κΈ°λ³Έκ°’μœΌλ‘œμ¨ μ‚¬μš©λ©λ‹ˆλ‹€. λ„£μ§€ μ•ŠμœΌλ©΄ `None` μ΄ κΈ°λ³Έκ°’μœΌλ‘œ μ‚¬μš©λ©λ‹ˆλ‹€.
+
+///
+
+그러면 ν•΄λ‹Ή νŒŒμ΄μ¬ ν”„λ‘œκ·Έλž¨μ„ λ‹€μŒκ³Ό κ°™μ΄ ν˜ΈμΆœν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€:
+
+//// tab | Linux, macOS, Windows Bash
+
+<div class="termy">
+
+```console
+// Here we don't set the env var yet
+$ python main.py
+
+// As we didn't set the env var, we get the default value
+
+Hello World from Python
+
+// But if we create an environment variable first
+$ export MY_NAME="Wade Wilson"
+
+// And then call the program again
+$ python main.py
+
+// Now it can read the environment variable
+
+Hello Wade Wilson from Python
+```
+
+</div>
+
+////
+
+//// tab | Windows PowerShell
+
+<div class="termy">
+
+```console
+// Here we don't set the env var yet
+$ python main.py
+
+// As we didn't set the env var, we get the default value
+
+Hello World from Python
+
+// But if we create an environment variable first
+$ $Env:MY_NAME = "Wade Wilson"
+
+// And then call the program again
+$ python main.py
+
+// Now it can read the environment variable
+
+Hello Wade Wilson from Python
+```
+
+</div>
+
+////
+
+ν™˜κ²½λ³€μˆ˜λŠ” μ½”λ“œ λ°”κΉ₯μ—μ„œ μ„€μ •될 μˆ˜ μžˆμ§€λ§Œ, μ½”λ“œμ—μ„œ μ½μ„ μˆ˜ μžˆκ³ , λ‚˜λ¨Έμ§€ νŒŒμΌκ³Ό ν•¨κ»˜ μ €μž₯(`git`에 μ»€λ°‹)ν•  ν•„μš”κ°€ μ—†μœΌλ―€λ‘œ, κ΅¬μ„±μ΄λ‚˜ **μ„€μ •** μ— μ‚¬μš©ν•˜λŠ” κ²ƒμ΄ μΌλ°˜μ μž…λ‹ˆλ‹€.
+
+**νŠΉμ • ν”„λ‘œκ·Έλž¨ ν˜ΈμΆœ**에 λŒ€ν•΄μ„œλ§Œ μ‚¬μš©ν•  μˆ˜ μžˆλŠ” ν™˜κ²½ λ³€μˆ˜λ₯Ό λ§Œλ“€ μˆ˜λ„ μžˆμŠ΅λ‹ˆλ‹€. ν•΄λ‹Ή ν”„λ‘œκ·Έλž¨μ—μ„œλ§Œ μ‚¬μš©ν•  μˆ˜ μžˆκ³ , ν•΄λ‹Ή ν”„λ‘œκ·Έλž¨μ΄ μ‹€ν–‰λ˜λŠ” λ™μ•ˆλ§Œ μ‚¬μš©ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+κ·Έλ ‡κ²Œ ν•˜λ €λ©΄ ν”„λ‘œκ·Έλž¨ λ°”λ‘œ μ•ž, κ°™μ€ μ€„에 ν™˜κ²½ λ³€μˆ˜λ₯Ό λ§Œλ“€μ–΄μ•Ό ν•©λ‹ˆλ‹€:
+
+<div class="termy">
+
+```console
+// Create an env var MY_NAME in line for this program call
+$ MY_NAME="Wade Wilson" python main.py
+
+// Now it can read the environment variable
+
+Hello Wade Wilson from Python
+
+// The env var no longer exists afterwards
+$ python main.py
+
+Hello World from Python
+```
+
+</div>
+
+/// tip | "팁"
+
+<a href="https://12factor.net/config" class="external-link" target="_blank">The Twelve-Factor App: Config</a> μ—μ„œ μ’€ λ” μžμ„Ένžˆ μ•Œμ•„λ³Ό μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+///
+
+## νƒ€μž…κ³Ό κ²€μ¦
+
+이 ν™˜κ²½λ³€μˆ˜λ“€μ€ μ˜€μ§ **ν…μŠ€νŠΈ λ¬Έμžμ—΄**둜만 μ²˜λ¦¬ν•  μˆ˜ μžˆμŠ΅λ‹ˆλ‹€. ν…μŠ€νŠΈ λ¬Έμžμ—΄μ€ νŒŒμ΄μ¬ μ™ΈλΆ€μ— μžˆμœΌλ©° λ‹€λ₯Έ ν”„λ‘œκ·Έλž¨ λ° λ‚˜λ¨Έμ§€ μ‹œμŠ€ν…œ(Linux, Windows, macOS λ“± λ‹€λ₯Έ μš΄μ˜ μ²΄μ œ)κ³Ό ν˜Έν™˜λ˜μ–΄μ•Ό ν•©λ‹ˆλ‹€.
+
+즉, νŒŒμ΄μ¬μ—μ„œ ν™˜κ²½ λ³€μˆ˜λ‘œλΆ€ν„° μ½μ€ **λͺ¨λ“  κ°’**은 **`str`**이 λ˜κ³ , λ‹€λ₯Έ νƒ€μž…μœΌλ‘œμ˜ λ³€ν™˜μ΄λ‚˜ κ²€μ¦μ€ μ½”λ“œμ—μ„œ μˆ˜ν–‰ν•΄μ•Ό ν•©λ‹ˆλ‹€.
+
+**μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μ„€μ •**을 μ²˜λ¦¬ν•˜κΈ° μœ„ν•œ ν™˜κ²½ λ³€μˆ˜ μ‚¬μš©μ— λŒ€ν•œ μžμ„Έν•œ λ‚΄μš©μ€ [κ³ κΈ‰ μ‚¬μš©μž κ°€μ΄λ“œ - μ„€μ • λ° ν™˜κ²½ λ³€μˆ˜](./advanced/settings.md){.internal-link target=\_blank} μ—μ„œ ν™•인할 μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+## `PATH` ν™˜κ²½ λ³€μˆ˜
+
+**`PATH`**라고 λΆˆλ¦¬λŠ”, **νŠΉλ³„ν•œ** ν™˜κ²½λ³€μˆ˜κ°€ μžˆμŠ΅λ‹ˆλ‹€. μš΄μ˜μ²΄μ œ(Linux, Windows, macOS λ“±)μ—μ„œ μ‹€ν–‰ν•  ν”„λ‘œκ·Έλž¨μ„ μ°ΎκΈ°μœ„ν•΄ μ‚¬μš©λ©λ‹ˆλ‹€.
+
+λ³€μˆ˜ `PATH`의 κ°’은 Linux와 macOSμ—μ„œλŠ” μ½œλ‘  `:`, Windowsμ—μ„œλŠ” μ„Έλ―Έμ½œλ‘  `;`으둜 κ΅¬λΆ„λœ λ””λ ‰ν† λ¦¬λ‘œ κ΅¬μ„±λœ κΈ΄ λ¬Έμžμ—΄μž…λ‹ˆλ‹€.
+
+예λ₯Ό λ“€μ–΄, `PATH` ν™˜κ²½ λ³€μˆ˜λŠ” λ‹€μŒκ³Ό κ°™μŠ΅λ‹ˆλ‹€:
+
+//// tab | Linux, macOS
+
+```plaintext
+/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
+```
+
+μ΄λŠ” μ‹œμŠ€ν…œμ΄ λ‹€μŒ λ””λ ‰ν† λ¦¬μ—μ„œ ν”„λ‘œκ·Έλž¨μ„ μ°Ύμ•„μ•Ό ν•¨μ„ μ˜λ―Έν•©λ‹ˆλ‹€:
+
+-   `/usr/local/bin`
+-   `/usr/bin`
+-   `/bin`
+-   `/usr/sbin`
+-   `/sbin`
+
+////
+
+//// tab | Windows
+
+```plaintext
+C:\Program Files\Python312\Scripts;C:\Program Files\Python312;C:\Windows\System32
+```
+
+μ΄λŠ” μ‹œμŠ€ν…œμ΄ λ‹€μŒ λ””λ ‰ν† λ¦¬μ—μ„œ ν”„λ‘œκ·Έλž¨μ„ μ°Ύμ•„μ•Ό ν•¨μ„ μ˜λ―Έν•©λ‹ˆλ‹€:
+
+-   `C:\Program Files\Python312\Scripts`
+-   `C:\Program Files\Python312`
+-   `C:\Windows\System32`
+
+////
+
+터미널에 **λͺ…λ Ήμ–΄**λ₯Ό μž…λ ₯ν•˜λ©΄ μš΄μ˜ μ²΄μ œλŠ” `PATH` ν™˜κ²½ λ³€μˆ˜μ— λ‚˜μ—΄λœ **각 λ””렉토리**μ—μ„œ ν”„λ‘œκ·Έλž¨μ„ **μ°ΎμŠ΅λ‹ˆλ‹€.**
+
+예λ₯Ό λ“€μ–΄ ν„°λ―Έλ„μ— `python`을 μž…λ ₯ν•˜λ©΄ μš΄μ˜ μ²΄μ œλŠ” ν•΄λ‹Ή λͺ©λ‘μ˜ **첫 λ²ˆμ§Έ λ””렉토리**μ—μ„œ `python`μ΄λΌλŠ” ν”„λ‘œκ·Έλž¨μ„ μ°ΎμŠ΅λ‹ˆλ‹€.
+
+찾으면 **μ‚¬μš©ν•©λ‹ˆλ‹€**. κ·Έλ ‡μ§€ μ•ŠμœΌλ©΄ **λ‹€λ₯Έ λ””렉토리**μ—μ„œ κ³„속 μ°ΎμŠ΅λ‹ˆλ‹€.
+
+### νŒŒμ΄μ¬ μ„€μΉ˜μ™€ `PATH` μ—…λ°μ΄νŠΈ
+
+νŒŒμ΄μ¬μ„ μ„€μΉ˜ν•  λ•Œ, μ•„λ§ˆ `PATH` ν™˜κ²½ λ³€μˆ˜λ₯Ό μ—…λ°μ΄νŠΈ ν•  κ²ƒμ΄λƒκ³  λ¬Όμ–΄λ΄€μ„ κ²λ‹ˆλ‹€.
+
+//// tab | Linux, macOS
+
+νŒŒμ΄μ¬μ„ μ„€μΉ˜ν•˜κ³  κ·Έκ²ƒμ΄ `/opt/custompython/bin` λ””렉토리에 μžˆλ‹€κ³  κ°€μ •ν•΄ λ³΄κ² μŠ΅λ‹ˆλ‹€.
+
+`PATH` ν™˜κ²½ λ³€μˆ˜λ₯Ό μ—…λ°μ΄νŠΈν•˜λ„λ‘ "예"라고 ν•˜λ©΄ μ„€μΉ˜ κ΄€λ¦¬μžκ°€ `/opt/custompython/bin`을 `PATH` ν™˜κ²½ λ³€μˆ˜μ— μΆ”κ°€ν•©λ‹ˆλ‹€.
+
+λ‹€μŒκ³Ό κ°™μ΄ λ³΄μΌ μˆ˜ μžˆμŠ΅λ‹ˆλ‹€:
+
+```plaintext
+/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/custompython/bin
+```
+
+μ΄λ ‡κ²Œ ν•˜λ©΄ ν„°λ―Έλ„μ— `python`을 μž…λ ₯ν•  λ•Œ, μ‹œμŠ€ν…œμ΄ `/opt/custompython/bin`(λ§ˆμ§€λ§‰ λ””렉토리)μ—μ„œ νŒŒμ΄μ¬ ν”„λ‘œκ·Έλž¨μ„ μ°Ύμ•„ μ‚¬μš©ν•©λ‹ˆλ‹€.
+
+////
+
+//// tab | Windows
+
+νŒŒμ΄μ¬μ„ μ„€μΉ˜ν•˜κ³  κ·Έκ²ƒμ΄ `C:\opt\custompython\bin` λ””렉토리에 μžˆλ‹€κ³  κ°€μ •ν•΄ λ³΄κ² μŠ΅λ‹ˆλ‹€.
+
+`PATH` ν™˜κ²½ λ³€μˆ˜λ₯Ό μ—…λ°μ΄νŠΈν•˜λ„λ‘ "예"라고 ν•˜λ©΄ μ„€μΉ˜ κ΄€λ¦¬μžκ°€ `C:\opt\custompython\bin`을 `PATH` ν™˜κ²½ λ³€μˆ˜μ— μΆ”κ°€ν•©λ‹ˆλ‹€.
+
+```plaintext
+C:\Program Files\Python312\Scripts;C:\Program Files\Python312;C:\Windows\System32;C:\opt\custompython\bin
+```
+
+μ΄λ ‡κ²Œ ν•˜λ©΄ ν„°λ―Έλ„μ— `python`을 μž…λ ₯ν•  λ•Œ, μ‹œμŠ€ν…œμ΄ `C:\opt\custompython\bin`(λ§ˆμ§€λ§‰ λ””렉토리)μ—μ„œ νŒŒμ΄μ¬ ν”„λ‘œκ·Έλž¨μ„ μ°Ύμ•„ μ‚¬μš©ν•©λ‹ˆλ‹€.
+
+////
+
+κ·Έλž˜μ„œ, λ‹€μŒκ³Ό κ°™μ΄ μž…λ ₯ν•œλ‹€λ©΄:
+
+<div class="termy">
+
+```console
+$ python
+```
+
+</div>
+
+//// tab | Linux, macOS
+
+μ‹œμŠ€ν…œμ€ `/opt/custompython/bin`μ—μ„œ `python` ν”„λ‘œκ·Έλž¨μ„ **μ°Ύμ•„** μ‹€ν–‰ν•©λ‹ˆλ‹€.
+
+λ‹€μŒκ³Ό κ°™μ΄ μž…λ ₯ν•˜λŠ” κ²ƒκ³Ό κ±°μ˜ κ°™μŠ΅λ‹ˆλ‹€:
+
+<div class="termy">
+
+```console
+$ /opt/custompython/bin/python
+```
+
+</div>
+
+////
+
+//// tab | Windows
+
+μ‹œμŠ€ν…œμ€ `C:\opt\custompython\bin\python`μ—μ„œ `python` ν”„λ‘œκ·Έλž¨μ„ **μ°Ύμ•„** μ‹€ν–‰ν•©λ‹ˆλ‹€.
+
+λ‹€μŒκ³Ό κ°™μ΄ μž…λ ₯ν•˜λŠ” κ²ƒκ³Ό κ±°μ˜ κ°™μŠ΅λ‹ˆλ‹€:
+
+<div class="termy">
+
+```console
+$ C:\opt\custompython\bin\python
+```
+
+</div>
+
+////
+
+이 μ •λ³΄λŠ” [가상 ν™˜κ²½](virtual-environments.md){.internal-link target=\_blank} μ— λŒ€ν•΄ μ•Œμ•„λ³Ό λ•Œ μœ μš©ν•  κ²ƒμž…λ‹ˆλ‹€.
+
+## κ²°λ‘ 
+
+이 λ¬Έμ„œλ₯Ό μ½κ³  **ν™˜κ²½ λ³€μˆ˜**κ°€ λ¬΄μ—‡μ΄κ³  νŒŒμ΄μ¬μ—μ„œ μ–΄λ–»κ²Œ μ‚¬μš©ν•˜λŠ”μ§€ κΈ°λ³Έμ μœΌλ‘œ μ΄ν•΄ν•˜μ…¨μ„ κ²λ‹ˆλ‹€.
+
+λ˜ν•œ <a href="https://ko.wikipedia.org/wiki/ν™˜κ²½_λ³€μˆ˜" class="external-link" target="_blank">ν™˜κ²½ λ³€μˆ˜μ— λŒ€ν•œ μœ„ν‚€ν”Όλ””μ•„(ν•œκ΅­μ–΄)</a>μ—μ„œ μ΄μ— λŒ€ν•΄ μžμ„Ένžˆ μ•Œμ•„λ³Ό μˆ˜ μžˆμŠ΅λ‹ˆλ‹€.
+
+λ§Žμ€ κ²½μš°μ—μ„œ, ν™˜κ²½ λ³€μˆ˜κ°€ μ–΄λ–»κ²Œ μœ μš©ν•˜κ³  μ μš© κ°€λŠ₯ν•œμ§€ λ°”λ‘œ λͺ…ν™•ν•˜κ²Œ μ•Œ μˆ˜λŠ” μ—†μŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ κ°œλ°œν•  λ•Œ λ‹€μ–‘ν•œ μ‹œλ‚˜λ¦¬μ˜€μ—μ„œ κ³„속 λ‚˜νƒ€λ‚˜λ―€λ‘œ μ΄μ— λŒ€ν•΄ μ•„λŠ” κ²ƒμ΄ μ’‹μŠ΅λ‹ˆλ‹€.
+
+예λ₯Ό λ“€μ–΄, λ‹€μŒ μ„Ήμ…˜μΈ [가상 ν™˜κ²½](virtual-environments.md)μ—μ„œ μ΄ μ •보가 ν•„μš”ν•©λ‹ˆλ‹€.