mirror of
https://github.com/fastapi/fastapi.git
synced 2026-10-09 11:41:39 -04:00
🌐 🔠 📄 🐢 Translate docs to Emoji 🥳 🎉 💥 🤯 🤯 (#5385)
* 🌐 💬 🩺 🦲 * 🎨 [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>
This commit is contained in:
125 files changed
+18865
-2
No files matched your search
@@ -0,0 +1,112 @@
|
||||
# 🛠️
|
||||
|
||||
👆 💪 🔗 🕹 👆 👨🎨, 🖼 ⏮️ 🎙 🎙 📟 ⚖️ 🗒.
|
||||
|
||||
## 🤙 `uvicorn`
|
||||
|
||||
👆 FastAPI 🈸, 🗄 & 🏃 `uvicorn` 🔗:
|
||||
|
||||
```Python hl_lines="1 15"
|
||||
{!../../../docs_src/debugging/tutorial001.py!}
|
||||
```
|
||||
|
||||
### 🔃 `__name__ == "__main__"`
|
||||
|
||||
👑 🎯 `__name__ == "__main__"` ✔️ 📟 👈 🛠️ 🕐❔ 👆 📁 🤙 ⏮️:
|
||||
|
||||
<div class="termy">
|
||||
|
||||
```console
|
||||
$ python myapp.py
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
✋️ 🚫 🤙 🕐❔ ➕1️⃣ 📁 🗄 ⚫️, 💖:
|
||||
|
||||
```Python
|
||||
from myapp import app
|
||||
```
|
||||
|
||||
#### 🌅 ℹ
|
||||
|
||||
➡️ 💬 👆 📁 🌟 `myapp.py`.
|
||||
|
||||
🚥 👆 🏃 ⚫️ ⏮️:
|
||||
|
||||
<div class="termy">
|
||||
|
||||
```console
|
||||
$ python myapp.py
|
||||
```
|
||||
|
||||
</div>
|
||||
|
||||
⤴️ 🔗 🔢 `__name__` 👆 📁, ✍ 🔁 🐍, 🔜 ✔️ 💲 🎻 `"__main__"`.
|
||||
|
||||
, 📄:
|
||||
|
||||
```Python
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
||||
```
|
||||
|
||||
🔜 🏃.
|
||||
|
||||
---
|
||||
|
||||
👉 🏆 🚫 🔨 🚥 👆 🗄 👈 🕹 (📁).
|
||||
|
||||
, 🚥 👆 ✔️ ➕1️⃣ 📁 `importer.py` ⏮️:
|
||||
|
||||
```Python
|
||||
from myapp import app
|
||||
|
||||
# Some more code
|
||||
```
|
||||
|
||||
👈 💼, 🏧 🔢 🔘 `myapp.py` 🔜 🚫 ✔️ 🔢 `__name__` ⏮️ 💲 `"__main__"`.
|
||||
|
||||
, ⏸:
|
||||
|
||||
```Python
|
||||
uvicorn.run(app, host="0.0.0.0", port=8000)
|
||||
```
|
||||
|
||||
🔜 🚫 🛠️.
|
||||
|
||||
!!! info
|
||||
🌅 ℹ, ✅ <a href="https://docs.python.org/3/library/__main__.html" class="external-link" target="_blank">🛂 🐍 🩺</a>.
|
||||
|
||||
## 🏃 👆 📟 ⏮️ 👆 🕹
|
||||
|
||||
↩️ 👆 🏃 Uvicorn 💽 🔗 ⚪️➡️ 👆 📟, 👆 💪 🤙 👆 🐍 📋 (👆 FastAPI 🈸) 🔗 ⚪️➡️ 🕹.
|
||||
|
||||
---
|
||||
|
||||
🖼, 🎙 🎙 📟, 👆 💪:
|
||||
|
||||
* 🚶 "ℹ" 🎛.
|
||||
* "🚮 📳...".
|
||||
* 🖊 "🐍"
|
||||
* 🏃 🕹 ⏮️ 🎛 "`Python: Current File (Integrated Terminal)`".
|
||||
|
||||
⚫️ 🔜 ⤴️ ▶️ 💽 ⏮️ 👆 **FastAPI** 📟, ⛔️ 👆 0️⃣, ♒️.
|
||||
|
||||
📥 ❔ ⚫️ 💪 👀:
|
||||
|
||||
<img src="/img/tutorial/debugging/image01.png">
|
||||
|
||||
---
|
||||
|
||||
🚥 👆 ⚙️ 🗒, 👆 💪:
|
||||
|
||||
* 📂 "🏃" 🍣.
|
||||
* 🖊 🎛 "ℹ...".
|
||||
* ⤴️ 🔑 🍣 🎦 🆙.
|
||||
* 🖊 📁 ℹ (👉 💼, `main.py`).
|
||||
|
||||
⚫️ 🔜 ⤴️ ▶️ 💽 ⏮️ 👆 **FastAPI** 📟, ⛔️ 👆 0️⃣, ♒️.
|
||||
|
||||
📥 ❔ ⚫️ 💪 👀:
|
||||
|
||||
<img src="/img/tutorial/debugging/image02.png">
|
||||
Reference in new issue
Block a user