diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c8ea4e18c..694d68c69 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -35,7 +35,7 @@ jobs: TIANGOLO_BUILD_PACKAGE: ${{ matrix.package }} run: python -m build - name: Publish - uses: pypa/gh-action-pypi-publish@v1.10.3 + uses: pypa/gh-action-pypi-publish@v1.11.0 - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 85aa085ad..d072c618d 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -27,6 +27,7 @@ hide: ### Translations +* 🌐 Add Korean translation for `docs/ko/docs/advanced/wsgi.md`. PR [#12659](https://github.com/fastapi/fastapi/pull/12659) by [@Limsunoh](https://github.com/Limsunoh). * 🌐 Add Portuguese translation for `docs/pt/docs/advanced/websockets.md`. PR [#12703](https://github.com/fastapi/fastapi/pull/12703) by [@devfernandoa](https://github.com/devfernandoa). * 🌐 Add Portuguese translation for `docs/pt/docs/tutorial/security/simple-oauth2.md`. PR [#12520](https://github.com/fastapi/fastapi/pull/12520) by [@LidiaDomingos](https://github.com/LidiaDomingos). * 🌐 Add Korean translation for `docs/ko/docs/advanced/response-directly.md`. PR [#12674](https://github.com/fastapi/fastapi/pull/12674) by [@9zimin9](https://github.com/9zimin9). @@ -42,6 +43,12 @@ hide: ### Internal +* ⬆ Bump pypa/gh-action-pypi-publish from 1.10.3 to 1.11.0. PR [#12721](https://github.com/fastapi/fastapi/pull/12721) by [@dependabot[bot]](https://github.com/apps/dependabot). +* ⬆ Update pre-commit requirement from <4.0.0,>=2.17.0 to >=2.17.0,<5.0.0. PR [#12749](https://github.com/fastapi/fastapi/pull/12749) by [@dependabot[bot]](https://github.com/apps/dependabot). +* ⬆ Bump typer from 0.12.3 to 0.12.5. PR [#12748](https://github.com/fastapi/fastapi/pull/12748) by [@dependabot[bot]](https://github.com/apps/dependabot). +* ⬆ Update flask requirement from <3.0.0,>=1.1.2 to >=1.1.2,<4.0.0. PR [#12747](https://github.com/fastapi/fastapi/pull/12747) by [@dependabot[bot]](https://github.com/apps/dependabot). +* ⬆ Bump pillow from 10.4.0 to 11.0.0. PR [#12746](https://github.com/fastapi/fastapi/pull/12746) by [@dependabot[bot]](https://github.com/apps/dependabot). +* ⬆ Update pytest requirement from <8.0.0,>=7.1.3 to >=7.1.3,<9.0.0. PR [#12745](https://github.com/fastapi/fastapi/pull/12745) by [@dependabot[bot]](https://github.com/apps/dependabot). * πŸ”§ Update sponsors: add Render. PR [#12733](https://github.com/fastapi/fastapi/pull/12733) by [@tiangolo](https://github.com/tiangolo). * ⬆ [pre-commit.ci] pre-commit autoupdate. PR [#12707](https://github.com/fastapi/fastapi/pull/12707) by [@pre-commit-ci[bot]](https://github.com/apps/pre-commit-ci). diff --git a/docs/ko/docs/advanced/wsgi.md b/docs/ko/docs/advanced/wsgi.md new file mode 100644 index 000000000..87aabf203 --- /dev/null +++ b/docs/ko/docs/advanced/wsgi.md @@ -0,0 +1,37 @@ +# WSGI ν¬ν•¨ν•˜κΈ° - Flask, Django κ·Έ μ™Έ + +[μ„œλΈŒ μ‘μš© ν”„λ‘œκ·Έλž¨ - 마운트](sub-applications.md){.internal-link target=_blank}, [ν”„λ‘μ‹œ λ’€νŽΈμ—μ„œ](behind-a-proxy.md){.internal-link target=_blank}μ—μ„œ λ³΄μ•˜λ“―μ΄ WSGI μ‘μš© ν”„λ‘œκ·Έλž¨λ“€μ„ λ‹€μŒκ³Ό 같이 마운트 ν•  수 μžˆμŠ΅λ‹ˆλ‹€. + +`WSGIMiddleware`λ₯Ό μ‚¬μš©ν•˜μ—¬ WSGI μ‘μš© ν”„λ‘œκ·Έλž¨(예: Flask, Django λ“±)을 κ°μŒ€ 수 μžˆμŠ΅λ‹ˆλ‹€. + +## `WSGIMiddleware` μ‚¬μš©ν•˜κΈ° + +`WSGIMiddleware`λ₯Ό λΆˆλŸ¬μ™€μ•Ό ν•©λ‹ˆλ‹€. + +그런 λ‹€μŒ, WSGI(예: Flask) μ‘μš© ν”„λ‘œκ·Έλž¨μ„ λ―Έλ“€μ›¨μ–΄λ‘œ 포μž₯ν•©λ‹ˆλ‹€. + +κ·Έ ν›„, ν•΄λ‹Ή κ²½λ‘œμ— λ§ˆμš΄νŠΈν•©λ‹ˆλ‹€. + +```Python hl_lines="2-3 23" +{!../../docs_src/wsgi/tutorial001.py!} +``` + +## ν™•μΈν•˜κΈ° + +이제 `/v1/` κ²½λ‘œμ— μžˆλŠ” λͺ¨λ“  μš”μ²­μ€ Flask μ‘μš© ν”„λ‘œκ·Έλž¨μ—μ„œ μ²˜λ¦¬λ©λ‹ˆλ‹€. + +그리고 λ‚˜λ¨Έμ§€λŠ” **FastAPI**에 μ˜ν•΄ μ²˜λ¦¬λ©λ‹ˆλ‹€. + +μ‹€ν–‰ν•˜λ©΄ http://localhost:8000/v1/으둜 μ΄λ™ν•΄μ„œ Flask의 응닡을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€: + +```txt +Hello, World from Flask! +``` + +그리고 λ‹€μŒμœΌλ‘œ μ΄λ™ν•˜λ©΄ http://localhost:8000/v2 Flask의 응닡을 λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€: + +```JSON +{ + "message": "Hello World" +} +``` diff --git a/requirements-docs.txt b/requirements-docs.txt index 1639159af..9754eaa4a 100644 --- a/requirements-docs.txt +++ b/requirements-docs.txt @@ -3,12 +3,12 @@ mkdocs-material==9.5.18 mdx-include >=1.4.1,<2.0.0 mkdocs-redirects>=1.2.1,<1.3.0 -typer == 0.12.3 +typer == 0.12.5 pyyaml >=5.3.1,<7.0.0 # For Material for MkDocs, Chinese search jieba==0.42.1 # For image processing by Material for MkDocs -pillow==10.4.0 +pillow==11.0.0 # For image processing by Material for MkDocs cairosvg==2.7.1 mkdocstrings[python]==0.26.1 diff --git a/requirements-tests.txt b/requirements-tests.txt index 189fcaf7e..95ec09884 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -1,11 +1,11 @@ -e .[all] -r requirements-docs-tests.txt -pytest >=7.1.3,<8.0.0 +pytest >=7.1.3,<9.0.0 coverage[toml] >= 6.5.0,< 8.0 mypy ==1.8.0 dirty-equals ==0.6.0 sqlmodel==0.0.22 -flask >=1.1.2,<3.0.0 +flask >=1.1.2,<4.0.0 anyio[trio] >=3.2.1,<4.0.0 PyJWT==2.8.0 pyyaml >=5.3.1,<7.0.0 diff --git a/requirements.txt b/requirements.txt index 8e1fef341..9180bf1be 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -e .[all] -r requirements-tests.txt -r requirements-docs.txt -pre-commit >=2.17.0,<4.0.0 +pre-commit >=2.17.0,<5.0.0 # For generating screenshots playwright