From a6293397bc403254d80e8f50afbb43ae1693df46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 11 May 2021 23:17:17 +0200 Subject: [PATCH 01/50] =?UTF-8?q?=F0=9F=93=8C=20Upgrade=20pydantic=20pin,?= =?UTF-8?q?=20to=20handle=20security=20vulnerability=20CVE-2021-29510=20(#?= =?UTF-8?q?3213)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a2845ff2..f376dcdf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ ] requires = [ "starlette ==0.14.2", - "pydantic >=1.0.0,<2.0.0" + "pydantic >=1.6.2,!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0" ] description-file = "README.md" requires-python = ">=3.6" From eaa49ebd2053d6a415a3ed3a1f1176e3aecc19b5 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 11 May 2021 21:17:51 +0000 Subject: [PATCH 02/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 5f00b965..a9e4c9d0 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 📌 Upgrade pydantic pin, to handle security vulnerability CVE-2021-29510. PR [#3213](https://github.com/tiangolo/fastapi/pull/3213) by [@tiangolo](https://github.com/tiangolo). ## 0.65.0 From 43df5d05edd30fdeb16a9f5b26c02d4f47bdd8cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 11 May 2021 23:19:14 +0200 Subject: [PATCH 03/50] =?UTF-8?q?=F0=9F=94=96=20Release=20FastAPI=20versio?= =?UTF-8?q?n=200.65.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 7 ++++++- fastapi/__init__.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index a9e4c9d0..25c8d03c 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,7 +2,12 @@ ## Latest Changes -* 📌 Upgrade pydantic pin, to handle security vulnerability CVE-2021-29510. PR [#3213](https://github.com/tiangolo/fastapi/pull/3213) by [@tiangolo](https://github.com/tiangolo). + +## 0.65.1 + +### Security fixes + +* 📌 Upgrade pydantic pin, to handle security vulnerability [CVE-2021-29510](https://github.com/samuelcolvin/pydantic/security/advisories/GHSA-5jqp-qgf6-3pvh). PR [#3213](https://github.com/tiangolo/fastapi/pull/3213) by [@tiangolo](https://github.com/tiangolo). ## 0.65.0 diff --git a/fastapi/__init__.py b/fastapi/__init__.py index 52a3b01e..80f61d9f 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.65.0" +__version__ = "0.65.1" from starlette import status as status From 2b1e5b9f829143eb232f585a18801f0f770bdd99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Sun, 16 May 2021 20:27:45 +0200 Subject: [PATCH 04/50] =?UTF-8?q?=F0=9F=91=B7=20Upgrade=20Issue=20Manager?= =?UTF-8?q?=20GitHub=20Action=20(#3236)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/issue-manager.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/issue-manager.yml b/.github/workflows/issue-manager.yml index 712930e0..e2fb4f7a 100644 --- a/.github/workflows/issue-manager.yml +++ b/.github/workflows/issue-manager.yml @@ -6,23 +6,25 @@ on: issue_comment: types: - created - - edited issues: types: - labeled + pull_request_target: + types: + - labeled + workflow_dispatch: jobs: issue-manager: runs-on: ubuntu-latest steps: - - uses: tiangolo/issue-manager@0.2.0 + - uses: tiangolo/issue-manager@0.4.0 with: token: ${{ secrets.GITHUB_TOKEN }} config: > { "answered": { - "users": ["tiangolo", "dmontagu"], "delay": 864000, - "message": "Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues." + "message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs." } } From aece74982d7c9c1acac98e2c872c4cb885677fc7 Mon Sep 17 00:00:00 2001 From: github-actions Date: Sun, 16 May 2021 18:28:24 +0000 Subject: [PATCH 05/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 25c8d03c..e8d5698d 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 👷 Upgrade Issue Manager GitHub Action. PR [#3236](https://github.com/tiangolo/fastapi/pull/3236) by [@tiangolo](https://github.com/tiangolo). ## 0.65.1 From d5b09cd95824a1bd1c5595c9a5e020a1d44ce6f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 25 May 2021 17:05:04 +0200 Subject: [PATCH 06/50] =?UTF-8?q?=F0=9F=94=A7=20Add=20new=20banner=20spons?= =?UTF-8?q?or=20badge=20for=20FastAPI=20courses=20bundle=20(#3288)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/css/custom.css | 5 +++++ .../docs/img/sponsors/fastapi-bundle-banner.png | Bin 0 -> 10577 bytes docs/en/overrides/main.html | 10 ++++++++-- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 docs/en/docs/img/sponsors/fastapi-bundle-banner.png diff --git a/docs/en/docs/css/custom.css b/docs/en/docs/css/custom.css index 35ff9ef7..9449f0a7 100644 --- a/docs/en/docs/css/custom.css +++ b/docs/en/docs/css/custom.css @@ -89,6 +89,11 @@ a.announce-link:hover { z-index: 10; } +.announce-wrapper .sponsor-image { + display: block; + border-radius: 20px; +} + .announce-wrapper>div { min-height: 40px; display: flex; diff --git a/docs/en/docs/img/sponsors/fastapi-bundle-banner.png b/docs/en/docs/img/sponsors/fastapi-bundle-banner.png new file mode 100644 index 0000000000000000000000000000000000000000..43a8cceec35448f58198e63615f58abae2f23269 GIT binary patch literal 10577 zcmb7Kg0Y9@~W5VAd<6F}3&rRzm zT6Sn?WQ@okba_>VZFmyPUS3fKYY~GIj}QGy=8_T(jUG*2T1w4%Y$MTFQ*HQg+w+CK zO4idr7F7OnsS^REjArL4#~V@u9-%?ip6Wtp(OKKdY!rYpV$RpKZA zJ+3J|`tLzxP4wU6^GDRD{~k9I{`*}Yh8YIraak{YV(ei~aHGGtm;g-~z{VGw!0P^i_;l#iN3=Gym8)6*gjyHk z$VUwcKOYM9#4(mt{O?UZlIAHogtST%8{-LDhlJwO&XJF8Y-;LH#P`E(GrM{XCzw0s zySo;CpKaN!c;jPB*mw=xyr~-e47rGNx#M3<9o{xJU4MuD>nyt)1}V3`@2wQui@vCG zSoDxWZzZy{T|9Mr5x3z0l&AMA(`sKPtL9#kq>{u$bx~ZVAHYabEQyUA%%w=4piGVsw+=x6U_fGU( z>}!0n3Z~du(@^4yj|0&p^lIvNQSB9|=+>0N3&ZT<7PqUb+iGB6MGFCwW3k&PowQJi)M{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8dzWDYka{4eXl}>WQCzQsbhui_$KxTI z`V8p`j4i~)`&-jVO-<6~=H^WjAWgp)7Jh;lJ8u6O3_l1QcnMYjM5jO7=nKi)@VfKr zU=BGLn6!)x6dZj=N0TRcURF}bY|hQW9U?G*tVpH{v0t&r#fK7&9!|}|k1$ZN3yZ6( z?a=f9p!6&(PXvBMMMuM(3qjG*8n-$hCfcrL<^N^le7mFUda}RWr|oV{PTtKd$Q(`X z{kZFFCOaG3#YK!C3-5*^N_%6@A$APN9vl?-QOLkP)Y2v@`9rwHgwp4sXv)i1&B`sx zfyf9(Wk(1jR>8=T`HekA=i)Avu*sk0@NDjmK22EzQB(dh$~EnAE%ABr5G9@Yl9o(C zI|u&qXq#EyXx*1D8RI;XhOX3Kxl*mY?J7Clpj_%O-K@^YD=5l`#4e4ir7kZocj@#g z!3~=(N>9DoB(u((s$Y`{Nv(h6UbBXkRCO84N|y0n{oUAJ7|FB3(yW~@EvuSx%$2~q zclR!m7Q*2K87GUfgaJpmO)dnAC3|V*JEw-!f9Mf91b2Zsp5;{@@3QOLV z%c1iX`Qvh>+MJ+L1p7nl1@o7c#r3W>G?TrT$G#o|E&xo8+dM z{&yoF!{zcFU%sdRubT%M(3z3XxU*C5cXi#d*vQV}{=^mB4v8i&qa>aG=#AI^0XC8q Am;e9( literal 0 HcmV?d00001 diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html index 25e973b8..e0783675 100644 --- a/docs/en/overrides/main.html +++ b/docs/en/overrides/main.html @@ -16,9 +16,15 @@ From 9f6f25d54c642071ac1c1114789ccad79eec8e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 25 May 2021 17:05:39 +0200 Subject: [PATCH 07/50] =?UTF-8?q?=F0=9F=94=A7=20Add=20new=20banner=20spons?= =?UTF-8?q?or=20badge=20for=20FastAPI=20courses=20bundle=20(#3288)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 3afce2c4b87ba821f6282a763384a321076dbd61 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 25 May 2021 15:06:28 +0000 Subject: [PATCH 08/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index e8d5698d..03a276b8 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🔧 Add new banner sponsor badge for FastAPI courses bundle. PR [#3288](https://github.com/tiangolo/fastapi/pull/3288) by [@tiangolo](https://github.com/tiangolo). * 👷 Upgrade Issue Manager GitHub Action. PR [#3236](https://github.com/tiangolo/fastapi/pull/3236) by [@tiangolo](https://github.com/tiangolo). ## 0.65.1 From 60918d25a1f28411638a258c4d99b147ddc555d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Wed, 26 May 2021 11:26:06 +0200 Subject: [PATCH 09/50] =?UTF-8?q?=F0=9F=94=A7=20Add=20new=20gold=20sponsor?= =?UTF-8?q?=20Jina=20=F0=9F=8E=89=20(#3291)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + docs/en/data/sponsors.yml | 3 + docs/en/docs/img/sponsors/jina-banner.svg | 233 +++ docs/en/docs/img/sponsors/jina.svg | 1981 +++++++++++++++++++++ docs/en/overrides/main.html | 6 + 5 files changed, 2224 insertions(+) create mode 100644 docs/en/docs/img/sponsors/jina-banner.svg create mode 100644 docs/en/docs/img/sponsors/jina.svg diff --git a/README.md b/README.md index 19dba3ff..0fb7cc70 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,7 @@ The key features are: + diff --git a/docs/en/data/sponsors.yml b/docs/en/data/sponsors.yml index 5f56d966..49df39c9 100644 --- a/docs/en/data/sponsors.yml +++ b/docs/en/data/sponsors.yml @@ -2,6 +2,9 @@ gold: - url: https://www.deta.sh/?ref=fastapi title: The launchpad for all your (team's) ideas img: https://fastapi.tiangolo.com/img/sponsors/deta.svg + - url: https://bit.ly/2QSouzH + title: "Jina: build neural search-as-a-service for any kind of data in just minutes." + img: https://fastapi.tiangolo.com/img/sponsors/jina.svg silver: - url: https://www.investsuite.com/jobs title: Wealthtech jobs with FastAPI diff --git a/docs/en/docs/img/sponsors/jina-banner.svg b/docs/en/docs/img/sponsors/jina-banner.svg new file mode 100644 index 00000000..ebde273e --- /dev/null +++ b/docs/en/docs/img/sponsors/jina-banner.svg @@ -0,0 +1,233 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/en/docs/img/sponsors/jina.svg b/docs/en/docs/img/sponsors/jina.svg new file mode 100644 index 00000000..3dda4fe3 --- /dev/null +++ b/docs/en/docs/img/sponsors/jina.svg @@ -0,0 +1,1981 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html index e0783675..601d44af 100644 --- a/docs/en/overrides/main.html +++ b/docs/en/overrides/main.html @@ -27,6 +27,12 @@ + {% endblock %} From 40bb0c5f362665cee32a14ee1ff9c8b2f110684c Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 26 May 2021 09:26:47 +0000 Subject: [PATCH 10/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 03a276b8..7c18831f 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🔧 Add new gold sponsor Jina 🎉. PR [#3291](https://github.com/tiangolo/fastapi/pull/3291) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add new banner sponsor badge for FastAPI courses bundle. PR [#3288](https://github.com/tiangolo/fastapi/pull/3288) by [@tiangolo](https://github.com/tiangolo). * 👷 Upgrade Issue Manager GitHub Action. PR [#3236](https://github.com/tiangolo/fastapi/pull/3236) by [@tiangolo](https://github.com/tiangolo). From 36772548b7fe7556cfcb37679b80485301174856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 7 Jun 2021 10:52:44 +0200 Subject: [PATCH 11/50] =?UTF-8?q?=F0=9F=94=A7=20Update=20sponsors=20badge,?= =?UTF-8?q?=20course=20bundle=20(#3340)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 🔧 Update sponsors badge, course bundle * 🍱 Update course bundle SVG sizes --- .../img/sponsors/fastapi-bundle-banner.png | Bin 10577 -> 0 bytes .../sponsors/fastapi-course-bundle-banner.svg | 293 ++++++++++++++++++ docs/en/overrides/main.html | 4 +- 3 files changed, 295 insertions(+), 2 deletions(-) delete mode 100644 docs/en/docs/img/sponsors/fastapi-bundle-banner.png create mode 100644 docs/en/docs/img/sponsors/fastapi-course-bundle-banner.svg diff --git a/docs/en/docs/img/sponsors/fastapi-bundle-banner.png b/docs/en/docs/img/sponsors/fastapi-bundle-banner.png deleted file mode 100644 index 43a8cceec35448f58198e63615f58abae2f23269..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10577 zcmb7Kg0Y9@~W5VAd<6F}3&rRzm zT6Sn?WQ@okba_>VZFmyPUS3fKYY~GIj}QGy=8_T(jUG*2T1w4%Y$MTFQ*HQg+w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zcFU%sdRubT%M(3z3XxU*C5cXi#d*vQV}{=^mB4v8i&qa>aG=#AI^0XC8q Am;e9( diff --git a/docs/en/docs/img/sponsors/fastapi-course-bundle-banner.svg b/docs/en/docs/img/sponsors/fastapi-course-bundle-banner.svg new file mode 100644 index 00000000..5dd89b21 --- /dev/null +++ b/docs/en/docs/img/sponsors/fastapi-course-bundle-banner.svg @@ -0,0 +1,293 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/en/overrides/main.html b/docs/en/overrides/main.html index 601d44af..8e698bff 100644 --- a/docs/en/overrides/main.html +++ b/docs/en/overrides/main.html @@ -22,9 +22,9 @@
From 90120dd6e83d997fa2f7f54119a2e0cf906b1ded Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 7 Jun 2021 08:53:24 +0000 Subject: [PATCH 12/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 7c18831f..588ca166 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🔧 Update sponsors badge, course bundle. PR [#3340](https://github.com/tiangolo/fastapi/pull/3340) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add new gold sponsor Jina 🎉. PR [#3291](https://github.com/tiangolo/fastapi/pull/3291) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add new banner sponsor badge for FastAPI courses bundle. PR [#3288](https://github.com/tiangolo/fastapi/pull/3288) by [@tiangolo](https://github.com/tiangolo). * 👷 Upgrade Issue Manager GitHub Action. PR [#3236](https://github.com/tiangolo/fastapi/pull/3236) by [@tiangolo](https://github.com/tiangolo). From fa7e3c996edf2d5482fff8f9d890ac2390dede4d Mon Sep 17 00:00:00 2001 From: Patrick Wang <1263870+patrickkwang@users.noreply.github.com> Date: Mon, 7 Jun 2021 06:46:18 -0400 Subject: [PATCH 13/50] =?UTF-8?q?=F0=9F=90=9B=20Check=20Content-Type=20req?= =?UTF-8?q?uest=20header=20before=20assuming=20JSON=20(#2118)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Patrick Wang Co-authored-by: Sebastián Ramírez --- fastapi/routing.py | 19 +++- .../test_body/test_tutorial001.py | 88 ++++++++++++++++--- .../test_tutorial001.py | 1 + 3 files changed, 94 insertions(+), 14 deletions(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index ac5e19d9..9b51f03c 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -1,4 +1,5 @@ import asyncio +import email.message import enum import inspect import json @@ -36,7 +37,7 @@ from fastapi.utils import ( ) from pydantic import BaseModel from pydantic.error_wrappers import ErrorWrapper, ValidationError -from pydantic.fields import ModelField +from pydantic.fields import ModelField, Undefined from starlette import routing from starlette.concurrency import run_in_threadpool from starlette.exceptions import HTTPException @@ -174,14 +175,26 @@ def get_request_handler( async def app(request: Request) -> Response: try: - body = None + body: Any = None if body_field: if is_body_form: body = await request.form() else: body_bytes = await request.body() if body_bytes: - body = await request.json() + json_body: Any = Undefined + content_type_value = request.headers.get("content-type") + if content_type_value: + message = email.message.Message() + message["content-type"] = content_type_value + if message.get_content_maintype() == "application": + subtype = message.get_content_subtype() + if subtype == "json" or subtype.endswith("+json"): + json_body = await request.json() + if json_body != Undefined: + body = json_body + else: + body = body_bytes except json.JSONDecodeError as e: raise RequestValidationError([ErrorWrapper(e, ("body", e.pos))], body=e.doc) except Exception as e: diff --git a/tests/test_tutorial/test_body/test_tutorial001.py b/tests/test_tutorial/test_body/test_tutorial001.py index 38c6dbe8..c90240ae 100644 --- a/tests/test_tutorial/test_body/test_tutorial001.py +++ b/tests/test_tutorial/test_body/test_tutorial001.py @@ -173,25 +173,91 @@ def test_post_body(path, body, expected_status, expected_response): def test_post_broken_body(): + response = client.post( + "/items/", + headers={"content-type": "application/json"}, + data="{some broken json}", + ) + assert response.status_code == 422, response.text + assert response.json() == { + "detail": [ + { + "loc": ["body", 1], + "msg": "Expecting property name enclosed in double quotes: line 1 column 2 (char 1)", + "type": "value_error.jsondecode", + "ctx": { + "msg": "Expecting property name enclosed in double quotes", + "doc": "{some broken json}", + "pos": 1, + "lineno": 1, + "colno": 2, + }, + } + ] + } + + +def test_post_form_for_json(): response = client.post("/items/", data={"name": "Foo", "price": 50.5}) assert response.status_code == 422, response.text assert response.json() == { "detail": [ { - "ctx": { - "colno": 1, - "doc": "name=Foo&price=50.5", - "lineno": 1, - "msg": "Expecting value", - "pos": 0, - }, - "loc": ["body", 0], - "msg": "Expecting value: line 1 column 1 (char 0)", - "type": "value_error.jsondecode", + "loc": ["body"], + "msg": "value is not a valid dict", + "type": "type_error.dict", } ] } + + +def test_explicit_content_type(): + response = client.post( + "/items/", + data='{"name": "Foo", "price": 50.5}', + headers={"Content-Type": "application/json"}, + ) + assert response.status_code == 200, response.text + + +def test_geo_json(): + response = client.post( + "/items/", + data='{"name": "Foo", "price": 50.5}', + headers={"Content-Type": "application/geo+json"}, + ) + assert response.status_code == 200, response.text + + +def test_wrong_headers(): + data = '{"name": "Foo", "price": 50.5}' + invalid_dict = { + "detail": [ + { + "loc": ["body"], + "msg": "value is not a valid dict", + "type": "type_error.dict", + } + ] + } + + response = client.post("/items/", data=data, headers={"Content-Type": "text/plain"}) + assert response.status_code == 422, response.text + assert response.json() == invalid_dict + + response = client.post( + "/items/", data=data, headers={"Content-Type": "application/geo+json-seq"} + ) + assert response.status_code == 422, response.text + assert response.json() == invalid_dict + response = client.post( + "/items/", data=data, headers={"Content-Type": "application/not-really-json"} + ) + assert response.status_code == 422, response.text + assert response.json() == invalid_dict + + +def test_other_exceptions(): with patch("json.loads", side_effect=Exception): response = client.post("/items/", json={"test": "test2"}) assert response.status_code == 400, response.text - assert response.json() == {"detail": "There was an error parsing the body"} diff --git a/tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py b/tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py index cc85a8a8..3eb5822e 100644 --- a/tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py +++ b/tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py @@ -25,6 +25,7 @@ def test_gzip_request(compress): if compress: data = gzip.compress(data) headers["Content-Encoding"] = "gzip" + headers["Content-Type"] = "application/json" response = client.post("/sum", data=data, headers=headers) assert response.json() == {"sum": n} From 38b785813f175bef80e3e2f5274077f46d898186 Mon Sep 17 00:00:00 2001 From: github-actions Date: Mon, 7 Jun 2021 10:46:59 +0000 Subject: [PATCH 14/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 588ca166..235cfdb9 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🐛 Check Content-Type request header before assuming JSON. PR [#2118](https://github.com/tiangolo/fastapi/pull/2118) by [@patrickkwang](https://github.com/patrickkwang). * 🔧 Update sponsors badge, course bundle. PR [#3340](https://github.com/tiangolo/fastapi/pull/3340) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add new gold sponsor Jina 🎉. PR [#3291](https://github.com/tiangolo/fastapi/pull/3291) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add new banner sponsor badge for FastAPI courses bundle. PR [#3288](https://github.com/tiangolo/fastapi/pull/3288) by [@tiangolo](https://github.com/tiangolo). From 377234ad8ed7b15667662250166c1bac6327c879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Mon, 7 Jun 2021 14:55:40 +0200 Subject: [PATCH 15/50] =?UTF-8?q?=F0=9F=94=92=20Create=20Security=20Policy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SECURITY.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..322f95f6 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,31 @@ +# Security Policy + +Security is very important for FastAPI and its community. 🔒 + +Learn more about it below. 👇 + +## Versions + +The latest versions of FastAPI are supported. + +You are encouraged to [write tests](https://fastapi.tiangolo.com/tutorial/testing/) for your application and update your FastAPI version frequently after ensuring that your tests are passing. This way you will benefit from the latest features, bug fixes, and **security fixes**. + +You can learn more about [FastAPI versions and how to pin and upgrade them](https://fastapi.tiangolo.com/deployment/versions/) for your project in the docs. + +## Reporting a Vulnerability + +If you think you found a vulnerability, and even if you are not sure about it, please report it right away by sending an email to: security@tiangolo.com. Please try to be as explicit as possible, describing all the steps and example code to reproduce the security issue. + +I (the author, [@tiangolo](https://twitter.com/tiangolo)) will review it thoroughly and get back to you. + +## Public Discussions + +Please restrain from publicly discussing a potential security vulnerability. 🙊 + +It's better to discuss privately and try to find a solution first, to limit the potential impact as much as possible. + +--- + +Thanks for your help! + +The FastAPI community and I thank you for that. 🙇 From aabe2c7d66ef4add9d4f89c13483260e40e95b76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Wed, 9 Jun 2021 10:16:25 +0200 Subject: [PATCH 16/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 235cfdb9..5e77d87d 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,7 +2,25 @@ ## Latest Changes -* 🐛 Check Content-Type request header before assuming JSON. PR [#2118](https://github.com/tiangolo/fastapi/pull/2118) by [@patrickkwang](https://github.com/patrickkwang). + +### Security fixes + +* 🔒 Check Content-Type request header before assuming JSON. Initial PR [#2118](https://github.com/tiangolo/fastapi/pull/2118) by [@patrickkwang](https://github.com/patrickkwang). + +This change fixes a [CSRF](https://en.wikipedia.org/wiki/Cross-site_request_forgery) security vulnerability when using cookies for authentication in path operations with JSON payloads sent by browsers. + +In versions lower than `0.65.2`, FastAPI would try to read the request payload as JSON even if the `content-type` header sent was not set to `application/json` or a compatible JSON media type (e.g. `application/geo+json`). + +So, a request with a content type of `text/plain` containing JSON data would be accepted and the JSON data would be extracted. + +But requests with content type `text/plain` are exempt from [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) preflights, for being considered [Simple requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#simple_requests). So, the browser would execute them right away including cookies, and the text content could be a JSON string that would be parsed and accepted by the FastAPI application. + +See [CVE-2021-32677](https://github.com/tiangolo/fastapi/security/advisories/GHSA-8h2j-cgx8-6xv7) for more details. + +Thanks to [Dima Boger](https://twitter.com/b0g3r) for the security report! 🙇🔒 + +### Internal + * 🔧 Update sponsors badge, course bundle. PR [#3340](https://github.com/tiangolo/fastapi/pull/3340) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add new gold sponsor Jina 🎉. PR [#3291](https://github.com/tiangolo/fastapi/pull/3291) by [@tiangolo](https://github.com/tiangolo). * 🔧 Add new banner sponsor badge for FastAPI courses bundle. PR [#3288](https://github.com/tiangolo/fastapi/pull/3288) by [@tiangolo](https://github.com/tiangolo). From 4d91f978d265a5050baeb3d4b3618c2f5cb7995a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Wed, 9 Jun 2021 10:17:27 +0200 Subject: [PATCH 17/50] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.65.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 2 ++ fastapi/__init__.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 5e77d87d..bd7e2b27 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -3,6 +3,8 @@ ## Latest Changes +## 0.65.2 + ### Security fixes * 🔒 Check Content-Type request header before assuming JSON. Initial PR [#2118](https://github.com/tiangolo/fastapi/pull/2118) by [@patrickkwang](https://github.com/patrickkwang). diff --git a/fastapi/__init__.py b/fastapi/__init__.py index 80f61d9f..d04f2ea9 100644 --- a/fastapi/__init__.py +++ b/fastapi/__init__.py @@ -1,6 +1,6 @@ """FastAPI framework, high performance, easy to learn, fast to code, ready for production""" -__version__ = "0.65.1" +__version__ = "0.65.2" from starlette import status as status From fc6827d68af53c1c58fc2183ffd1d9dc93b8fef1 Mon Sep 17 00:00:00 2001 From: jaystone776 <1732865113@qq.com> Date: Tue, 29 Jun 2021 20:24:19 +0800 Subject: [PATCH 18/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translatio?= =?UTF-8?q?n=20for=20Tutorial=20-=20Request=20-=20Files=20(#3244)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Xie Wei --- docs/zh/docs/tutorial/request-files.md | 153 +++++++++++++++++++++++++ docs/zh/mkdocs.yml | 1 + 2 files changed, 154 insertions(+) create mode 100644 docs/zh/docs/tutorial/request-files.md diff --git a/docs/zh/docs/tutorial/request-files.md b/docs/zh/docs/tutorial/request-files.md new file mode 100644 index 00000000..26ece0d9 --- /dev/null +++ b/docs/zh/docs/tutorial/request-files.md @@ -0,0 +1,153 @@ +# 请求文件 + +`File` 用于定义客户端的上传文件。 + +!!! info "说明" + + 因为上传文件以「表单数据」形式发送。 + + 所以接收上传文件,要预先安装 `python-multipart`。 + + 例如: `pip install python-multipart`。 + +## 导入 `File` + +从 `fastapi` 导入 `File` 和 `UploadFile`: + +```Python hl_lines="1" +{!../../../docs_src/request_files/tutorial001.py!} +``` + +## 定义 `File` 参数 + +创建文件(`File`)参数的方式与 `Body` 和 `Form` 一样: + +```Python hl_lines="7" +{!../../../docs_src/request_files/tutorial001.py!} +``` + +!!! info "说明" + + `File` 是直接继承自 `Form` 的类。 + + 注意,从 `fastapi` 导入的 `Query`、`Path`、`File` 等项,实际上是返回特定类的函数。 + +!!! tip "提示" + + 声明文件体必须使用 `File`,否则,FastAPI 会把该参数当作查询参数或请求体(JSON)参数。 + +文件作为「表单数据」上传。 + +如果把*路径操作函数*参数的类型声明为 `bytes`,**FastAPI** 将以 `bytes` 形式读取和接收文件内容。 + +这种方式把文件的所有内容都存储在内存里,适用于小型文件。 + +不过,很多情况下,`UploadFile` 更好用。 + +## 含 `UploadFile` 的 `File` 参数 + +定义 `File` 参数时使用 `UploadFile`: + +```Python hl_lines="12" +{!../../../docs_src/request_files/tutorial001.py!} +``` + +`UploadFile` 与 `bytes` 相比有更多优势: + +* 使用 `spooled` 文件: + * 存储在内存的文件超出最大上限时,FastAPI 会把文件存入磁盘; +* 这种方式更适于处理图像、视频、二进制文件等大型文件,好处是不会占用所有内存; +* 可获取上传文件的元数据; +* 自带 file-like `async` 接口; +* 暴露的 Python `SpooledTemporaryFile` 对象,可直接传递给其他预期「file-like」对象的库。 + +### `UploadFile` + +`UploadFile` 的属性如下: + +* `filename`:上传文件名字符串(`str`),例如, `myimage.jpg`; +* `content_type`:内容类型(MIME 类型 / 媒体类型)字符串(`str`),例如,`image/jpeg`; +* `file`: `SpooledTemporaryFile`file-like 对象)。其实就是 Python文件,可直接传递给其他预期 `file-like` 对象的函数或支持库。 + +`UploadFile` 支持以下 `async` 方法,(使用内部 `SpooledTemporaryFile`)可调用相应的文件方法。 + +* `write(data)`:把 `data` (`str` 或 `bytes`)写入文件; +* `read(size)`:按指定数量的字节或字符(`size` (`int`))读取文件内容; +* `seek(offset)`:移动至文件 `offset` (`int`)字节处的位置; + * 例如,`await myfile.seek(0) ` 移动到文件开头; + * 执行 `await myfile.read()` 后,需再次读取已读取内容时,这种方法特别好用; +* `close()`:关闭文件。 + +因为上述方法都是 `async` 方法,要搭配「await」使用。 + +例如,在 `async` *路径操作函数* 内,要用以下方式读取文件内容: + +```Python +contents = await myfile.read() +``` + +在普通 `def` *路径操作函数* 内,则可以直接访问 `UploadFile.file`,例如: + +```Python +contents = myfile.file.read() +``` + +!!! note "`async` 技术细节" + + 使用 `async` 方法时,**FastAPI** 在线程池中执行文件方法,并 `awiat` 操作完成。 + +!!! note "Starlette 技术细节" + + **FastAPI** 的 `UploadFile` 直接继承自 **Starlette** 的 `UploadFile`,但添加了一些必要功能,使之与 **Pydantic** 及 FastAPI 的其它部件兼容。 + +## 什么是 「表单数据」 + +与 JSON 不同,HTML 表单(`
`)向服务器发送数据通常使用「特殊」的编码。 + +**FastAPI** 要确保从正确的位置读取数据,而不是读取 JSON。 + +!!! note "技术细节" + + 不包含文件时,表单数据一般用 `application/x-www-form-urlencoded`「媒体类型」编码。 + + 但表单包含文件时,编码为 `multipart/form-data`。使用了 `File`,**FastAPI** 就知道要从请求体的正确位置获取文件。 + + 编码和表单字段详见 MDN Web 文档的 POST 小节。 + +!!! warning "警告" + + 可在一个*路径操作*中声明多个 `File` 和 `Form` 参数,但不能同时声明要接收 JSON 的 `Body` 字段。因为此时请求体的编码是 `multipart/form-data`,不是 `application/json`。 + + 这不是 **FastAPI** 的问题,而是 HTTP 协议的规定。 + +## 多文件上传 + +FastAPI 支持同时上传多个文件。 + +可用同一个「表单字段」发送含多个文件的「表单数据」。 + +上传多个文件时,要声明含 `bytes` 或 `UploadFile` 的列表(`List`): + +```Python hl_lines="10 15" +{!../../../docs_src/request_files/tutorial002.py!} +``` + +接收的也是含 `bytes` 或 `UploadFile` 的列表(`list`)。 + +!!! note "笔记" + + 注意,截至 2019 年 4 月 14 日,Swagger UI 不支持在同一个表单字段中上传多个文件。详见 #4276#3641. + + 不过,**FastAPI** 已通过 OpenAPI 标准与之兼容。 + + 因此,只要 Swagger UI 或任何其他支持 OpenAPI 的工具支持多文件上传,都将与 **FastAPI** 兼容。 + +!!! note "技术细节" + + 也可以使用 `from starlette.responses import HTMLResponse`。 + + `fastapi.responses` 其实与 `starlette.responses` 相同,只是为了方便开发者调用。实际上,大多数 **FastAPI** 的响应都直接从 Starlette 调用。 + +## 小结 + +本节介绍了如何用 `File` 把上传文件声明为(表单数据的)输入参数。 \ No newline at end of file diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index b88f0438..8551e644 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -72,6 +72,7 @@ nav: - tutorial/schema-extra-example.md - tutorial/extra-data-types.md - tutorial/cookie-params.md + - tutorial/request-files.md - 安全性: - tutorial/security/index.md - tutorial/security/get-current-user.md From 246e80512d565a82f259d00e596d558ea385df12 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 29 Jun 2021 12:24:59 +0000 Subject: [PATCH 19/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index bd7e2b27..27f32a09 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add Chinese translation for Tutorial - Request - Files. PR [#3244](https://github.com/tiangolo/fastapi/pull/3244) by [@jaystone776](https://github.com/jaystone776). ## 0.65.2 From 97d8d4016b91abf404a2f0b338896ce57bcda5af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?= Date: Tue, 29 Jun 2021 23:22:23 +0200 Subject: [PATCH 20/50] =?UTF-8?q?=E2=AC=86=20Upgrade=20docs=20development?= =?UTF-8?q?=20dependency=20on=20`typer-cli`=20to=20>=3D0.0.12=20to=20fix?= =?UTF-8?q?=20conflicts=20(#3429)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build-docs.yml | 2 +- pyproject.toml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index ad20f45b..e6226445 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -26,7 +26,7 @@ jobs: run: python3.7 -m pip install flit - name: Install docs extras if: steps.cache.outputs.cache-hit != 'true' - run: python3.7 -m flit install --extras doc + run: python3.7 -m flit install --deps production --extras doc - name: Install Material for MkDocs Insiders if: github.event.pull_request.head.repo.fork == false && steps.cache.outputs.cache-hit != 'true' run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git diff --git a/pyproject.toml b/pyproject.toml index f376dcdf..25440bde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,10 +66,10 @@ test = [ ] doc = [ "mkdocs >=1.1.2,<2.0.0", - "mkdocs-material >=6.1.4,<7.0.0", - "markdown-include >=0.5.1,<0.6.0", + "mkdocs-material >=7.1.9,<8.0.0", + "markdown-include >=0.6.0,<0.7.0", "mkdocs-markdownextradata-plugin >=0.1.7,<0.2.0", - "typer-cli >=0.0.9,<0.0.10", + "typer-cli >=0.0.12,<0.0.13", "pyyaml >=5.3.1,<6.0.0" ] dev = [ From 26a36f79fa3e1a4534e29066fa4fa20fe762206c Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 29 Jun 2021 21:23:00 +0000 Subject: [PATCH 21/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 27f32a09..ae7a8ea4 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* ⬆ Upgrade docs development dependency on `typer-cli` to >=0.0.12 to fix conflicts. PR [#3429](https://github.com/tiangolo/fastapi/pull/3429) by [@tiangolo](https://github.com/tiangolo). * 🌐 Add Chinese translation for Tutorial - Request - Files. PR [#3244](https://github.com/tiangolo/fastapi/pull/3244) by [@jaystone776](https://github.com/jaystone776). ## 0.65.2 From 77c1988a8b826aeb02be362a7a88391315bbf606 Mon Sep 17 00:00:00 2001 From: Fabio Serrao Date: Fri, 2 Jul 2021 10:42:29 -0300 Subject: [PATCH 22/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20Portuguese=20transla?= =?UTF-8?q?tion=20for=20Development=20Contributing=20(#1364)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/pt/docs/contributing.md | 511 +++++++++++++++++++++++++++++++++++ 1 file changed, 511 insertions(+) create mode 100644 docs/pt/docs/contributing.md diff --git a/docs/pt/docs/contributing.md b/docs/pt/docs/contributing.md new file mode 100644 index 00000000..327b8b60 --- /dev/null +++ b/docs/pt/docs/contributing.md @@ -0,0 +1,511 @@ +# Desenvolvimento - Contribuindo + +Primeiramente, você deveria ver os meios básicos para [ajudar FastAPI e pedir ajuda](help-fastapi.md){.internal-link target=_blank}. + +## Desenvolvendo + +Se você já clonou o repositório e precisa mergulhar no código, aqui estão algumas orientações para configurar seu ambiente. + +### Ambiente virtual com `venv` + +Você pode criar um ambiente virtual em um diretório utilizando o módulo `venv` do Python: + +
+ +```console +$ python -m venv env +``` + +
+ +Isso criará o diretório `./env/` com os binários Python e então você será capaz de instalar pacotes nesse ambiente isolado. + +### Ativar o ambiente + +Ative o novo ambiente com: + +=== "Linux, macOS" + +
+ + ```console + $ source ./env/bin/activate + ``` + +
+ +=== "Windows PowerShell" + +
+ + ```console + $ .\env\Scripts\Activate.ps1 + ``` + +
+ +=== "Windows Bash" + + Ou se você usa Bash para Windows (por exemplo Git Bash): + +
+ + ```console + $ source ./env/Scripts/activate + ``` + +
+ +Para verificar se funcionou, use: + +=== "Linux, macOS, Windows Bash" + +
+ + ```console + $ which pip + + some/directory/fastapi/env/bin/pip + ``` + +
+ +=== "Windows PowerShell" + +
+ + ```console + $ Get-Command pip + + some/directory/fastapi/env/bin/pip + ``` + +
+ +Se ele exibir o binário `pip` em `env/bin/pip` então funcionou. 🎉 + + + +!!! tip + Toda vez que você instalar um novo pacote com `pip` nesse ambiente, ative o ambiente novamente. + + Isso garante que se você usar um programa instalado por aquele pacote (como `flit`), você utilizará aquele de seu ambiente local e não outro que possa estar instalado globalmente. + +### Flit + +**FastAPI** utiliza Flit para construir, empacotar e publicar o projeto. + +Após ativar o ambiente como descrito acima, instale o `flit`: + +
+ +```console +$ pip install flit + +---> 100% +``` + +
+ +Ative novamente o ambiente para ter certeza que você esteja utilizando o `flit` que você acabou de instalar (e não um global). + +E agora use `flit` para instalar as dependências de desenvolvimento: + +=== "Linux, macOS" + +
+ + ```console + $ flit install --deps develop --symlink + + ---> 100% + ``` + +
+ +=== "Windows" + + Se você está no Windows, use `--pth-file` ao invés de `--symlink`: + +
+ + ```console + $ flit install --deps develop --pth-file + + ---> 100% + ``` + +
+ +Isso irá instalar todas as dependências e seu FastAPI local em seu ambiente local. + +#### Usando seu FastAPI local + +Se você cria um arquivo Python que importa e usa FastAPI, e roda com Python de seu ambiente local, ele irá utilizar o código fonte de seu FastAPI local. + +E se você atualizar o código fonte do FastAPI local, como ele é instalado com `--symlink` (ou `--pth-file` no Windows), quando você rodar aquele arquivo Python novamente, ele irá utilizar a nova versão do FastAPI que você acabou de editar. + +Desse modo, você não tem que "instalar" sua versão local para ser capaz de testar cada mudança. + +### Formato + +Tem um arquivo que você pode rodar que irá formatar e limpar todo o seu código: + +
+ +```console +$ bash scripts/format.sh +``` + +
+ +Ele irá organizar também todos os seus imports. + +Para que ele organize os imports corretamente, você precisa ter o FastAPI instalado localmente em seu ambiente, com o comando na seção acima usando `--symlink` (ou `--pth-file` no Windows). + +### Formato dos imports + +Tem outro _script_ que formata todos os imports e garante que você não tenha imports não utilizados: + +
+ +```console +$ bash scripts/format-imports.sh +``` + +
+ +Como ele roda um comando após o outro, modificando e revertendo muitos arquivos, ele demora um pouco para concluir, então pode ser um pouco mais fácil utilizar `scripts/format.sh` frequentemente e `scripts/format-imports.sh` somente após "commitar uma branch". + +## Documentação + +Primeiro, tenha certeza de configurar seu ambiente como descrito acima, isso irá instalar todas as requisições. + +A documentação usa MkDocs. + +E existem ferramentas/_scripts_ extras para controlar as traduções em `./scripts/docs.py`. + +!!! tip + Você não precisa ver o código em `./scripts/docs.py`, você apenas o utiliza na linha de comando. + +Toda a documentação está no formato Markdown no diretório `./docs/pt/`. + +Muitos dos tutoriais tem blocos de código. + +Na maioria dos casos, esse blocos de código são aplicações completas que podem ser rodadas do jeito que estão apresentados. + +De fato, esses blocos de código não estão escritos dentro do Markdown, eles são arquivos Python dentro do diretório `./docs_src/`. + +E esses arquivos Python são incluídos/injetados na documentação quando se gera o site. + +### Testes para Documentação + +A maioria dos testes na verdade rodam encima dos arquivos fonte na documentação. + +Isso ajuda a garantir: + +* Que a documentação esteja atualizada. +* Que os exemplos da documentação possam ser rodadas do jeito que estão apresentadas. +* A maior parte dos recursos é coberta pela documentação, garantida por cobertura de testes. + +Durante o desenvolvimento local, existe um _script_ que constrói o site e procura por quaisquer mudanças, carregando na hora: + +
+ +```console +$ python ./scripts/docs.py live + +[INFO] Serving on http://127.0.0.1:8008 +[INFO] Start watching changes +[INFO] Start detecting changes +``` + +
+ +Isso irá servir a documentação em `http://127.0.0.1:8008`. + +Desse jeito, você poderá editar a documentação/arquivos fonte e ver as mudanças na hora. + +#### Typer CLI (opcional) + +As instruções aqui mostram como utilizar _scripts_ em `./scripts/docs.py` com o programa `python` diretamente. + +Mas você pode usar também Typer CLI, e você terá auto-completação para comandos no seu terminal após instalar o _completion_. + +Se você instalou Typer CLI, você pode instalar _completion_ com: + +
+ +```console +$ typer --install-completion + +zsh completion installed in /home/user/.bashrc. +Completion will take effect once you restart the terminal. +``` + +
+ +### Aplicações e documentação ao mesmo tempo + +Se você rodar os exemplos com, por exemplo: + +
+ +```console +$ uvicorn tutorial001:app --reload + +INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) +``` + +
+ +como Uvicorn utiliza por padrão a porta `8000`, a documentação na porta `8008` não dará conflito. + +### Traduções + +Ajuda com traduções É MUITO apreciada! E essa tarefa não pode ser concluída sem a ajuda da comunidade. 🌎 🚀 + +Aqui estão os passos para ajudar com as traduções. + +#### Dicas e orientações + +* Verifique sempre os _pull requests_ existentes para a sua linguagem e faça revisões das alterações e aprove elas. + +!!! tip + Você pode adicionar comentários com sugestões de alterações para _pull requests_ existentes. + + Verifique as documentações sobre adicionar revisão ao _pull request_ para aprovação ou solicitação de alterações. + +* Verifique em _issues_ para ver se existe alguém coordenando traduções para a sua linguagem. + +* Adicione um único _pull request_ por página traduzida. Isso tornará muito mais fácil a revisão para as outras pessoas. + +Para as linguagens que eu não falo, vou esperar por várias pessoas revisarem a tradução antes de _mergear_. + +* Você pode verificar também se há traduções para sua linguagem e adicionar revisão para elas, isso irá me ajudar a saber que a tradução está correta e eu possa _mergear_. + +* Utilize os mesmos exemplos Python e somente traduza o texto na documentação. Você não tem que alterar nada no código para que funcione. + +* Utilize as mesmas imagens, nomes de arquivo e links. Você não tem que alterar nada disso para que funcione. + +* Para verificar o código de duas letras para a linguagem que você quer traduzir, você pode usar a Lista de códigos ISO 639-1. + +#### Linguagem existente + +Vamos dizer que você queira traduzir uma página para uma linguagem que já tenha traduções para algumas páginas, como o Espanhol. + +No caso do Espanhol, o código de duas letras é `es`. Então, o diretório para traduções em Espanhol está localizada em `docs/es/`. + +!!! tip + A principal ("oficial") linguagem é o Inglês, localizado em `docs/en/`. + +Agora rode o _servidor ao vivo_ para as documentações em Espanhol: + +
+ +```console +// Use o comando "live" e passe o código da linguagem como um argumento de linha de comando +$ python ./scripts/docs.py live es + +[INFO] Serving on http://127.0.0.1:8008 +[INFO] Start watching changes +[INFO] Start detecting changes +``` + +
+ +Agora você pode ir em http://127.0.0.1:8008 e ver suas mudanças ao vivo. + +Se você procurar no site da documentação do FastAPI, você verá que toda linguagem tem todas as páginas. Mas algumas páginas não estão traduzidas e tem notificação sobre a falta da tradução. + +Mas quando você rodar localmente como descrito acima, você somente verá as páginas que já estão traduzidas. + +Agora vamos dizer que você queira adicionar uma tradução para a seção [Recursos](features.md){.internal-link target=_blank}. + +* Copie o arquivo em: + +``` +docs/en/docs/features.md +``` + +* Cole ele exatamente no mesmo local mas para a linguagem que você quer traduzir, por exemplo: + +``` +docs/es/docs/features.md +``` + +!!! tip + Observe que a única mudança na rota é o código da linguagem, de `en` para `es`. + +* Agora abra o arquivo de configuração MkDocs para Inglês em: + +``` +docs/en/docs/mkdocs.yml +``` + +* Procure o lugar onde `docs/features.md` está localizado no arquivo de configuração. Algum lugar como: + +```YAML hl_lines="8" +site_name: FastAPI +# Mais coisas +nav: +- FastAPI: index.md +- Languages: + - en: / + - es: /es/ +- features.md +``` + +* Abra o arquivo de configuração MkDocs para a linguagem que você está editando, por exemplo: + +``` +docs/es/docs/mkdocs.yml +``` + +* Adicione no mesmo local que está no arquivo em Inglês, por exemplo: + +```YAML hl_lines="8" +site_name: FastAPI +# Mais coisas +nav: +- FastAPI: index.md +- Languages: + - en: / + - es: /es/ +- features.md +``` + +Tenha certeza que se existem outras entradas, a nova entrada com sua tradução esteja exatamente na mesma ordem como na versão em Inglês. + +Se você for no seu navegador verá que agora a documentação mostra sua nova seção. 🎉 + +Agora você poderá traduzir tudo e ver como está toda vez que salva o arquivo. + +#### Nova linguagem + +Vamos dizer que você queira adicionar traduções para uma linguagem que ainda não foi traduzida, nem sequer uma página. + +Vamos dizer que você queira adicionar tradução para Haitiano, e ainda não tenha na documentação. + +Verificando o link acima, o código para "Haitiano" é `ht`. + +O próximo passo é rodar o _script_ para gerar um novo diretório de tradução: + +
+ +```console +// Use o comando new-lang, passe o código da linguagem como um argumento de linha de comando +$ python ./scripts/docs.py new-lang ht + +Successfully initialized: docs/ht +Updating ht +Updating en +``` + +
+ +Agora você pode verificar em seu editor de código o mais novo diretório criado `docs/ht/`. + +!!! tip + Crie um primeiro _pull request_ com apenas isso, para iniciar a configuração da nova linguagem, antes de adicionar traduções. + + Desse modo outros poderão ajudar com outras páginas enquanto você trabalha na primeira. 🚀 + +Inicie traduzindo a página principal, `docs/ht/index.md`. + +Então você pode continuar com as instruções anteriores, para uma "Linguagem Existente". + +##### Nova linguagem não suportada + +Se quando rodar o _script_ do _servidor ao vivo_ você pega um erro sobre linguagem não suportada, alguma coisa como: + +``` + raise TemplateNotFound(template) +jinja2.exceptions.TemplateNotFound: partials/language/xx.html +``` + +Isso significa que o tema não suporta essa linguagem (nesse caso, com um código falso de duas letras `xx`). + +Mas não se preocupe, você pode configurar o tema de linguagem para Inglês e então traduzir o conteúdo da documentação. + +Se você precisar fazer isso, edite o `mkdocs.yml` para sua nova linguagem, teremos algo como: + +```YAML hl_lines="5" +site_name: FastAPI +# Mais coisas +theme: + # Mais coisas + language: xx +``` + +Altere essa linguagem de `xx` (do seu código de linguagem) para `en`. + +Então você poderá iniciar novamente o _servidor ao vivo_. + +#### Pré-visualize o resultado + +Quando você usa o _script_ em `./scripts/docs.py` com o comando `live` ele somente exibe os arquivos e traduções disponíveis para a linguagem atual. + +Mas uma vez que você tenha concluído, você poderá testar tudo como se parecesse _online_. + +Para fazer isso, primeiro construa toda a documentação: + +
+ +```console +// Use o comando "build-all", isso leverá um tempinho +$ python ./scripts/docs.py build-all + +Updating es +Updating en +Building docs for: en +Building docs for: es +Successfully built docs for: es +Copying en index.md to README.md +``` + +
+ +Isso gera toda a documentação em `./docs_build/` para cada linguagem. Isso inclui a adição de quaisquer arquivos com tradução faltando, com uma nota dizendo que "esse arquivo ainda não tem tradução". Mas você não tem que fazer nada com esse diretório. + +Então ele constrói todos aqueles _sites_ independentes MkDocs para cada linguagem, combina eles, e gera a saída final em `./site/`. + +Então você poderá "servir" eles com o comando `serve`: + +
+ +```console +// Use o comando "serve" após rodar "build-all" +$ python ./scripts/docs.py serve + +Warning: this is a very simple server. For development, use mkdocs serve instead. +This is here only to preview a site with translations already built. +Make sure you run the build-all command first. +Serving at: http://127.0.0.1:8008 +``` + +
+ +## Testes + +Tem um _script_ que você pode rodar localmente para testar todo o código e gerar relatórios de cobertura em HTML: + +
+ +```console +$ bash scripts/test-cov-html.sh +``` + +
+ +Esse comando gera um diretório `./htmlcov/`, se você abrir o arquivo `./htmlcov/index.html` no seu navegador, poderá explorar interativamente as regiões de código que estão cobertas pelos testes, e observar se existe alguma região faltando. + +### Testes no seu editor + +Se você quer usar os testes integrados em seu editor adicione `./docs_src` na sua variável `PYTHONPATH`. + +Por exemplo, no VS Code você pode criar um arquivo `.env` com: + +```env +PYTHONPATH=./docs_src +``` From bd143ffa5aa281a47dc1843baf2762cf3d0302d4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 13:43:04 +0000 Subject: [PATCH 23/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index ae7a8ea4..ec1f5ac5 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add Portuguese translation for Development Contributing. PR [#1364](https://github.com/tiangolo/fastapi/pull/1364) by [@Serrones](https://github.com/Serrones). * ⬆ Upgrade docs development dependency on `typer-cli` to >=0.0.12 to fix conflicts. PR [#3429](https://github.com/tiangolo/fastapi/pull/3429) by [@tiangolo](https://github.com/tiangolo). * 🌐 Add Chinese translation for Tutorial - Request - Files. PR [#3244](https://github.com/tiangolo/fastapi/pull/3244) by [@jaystone776](https://github.com/jaystone776). From a0b20062306f4e76bea520623782975b1bfba831 Mon Sep 17 00:00:00 2001 From: BoYanZh Date: Fri, 2 Jul 2021 22:02:45 +0800 Subject: [PATCH 24/50] =?UTF-8?q?=F0=9F=8C=90=20Fix=20Chinese=20translatio?= =?UTF-8?q?n=20code=20snippet=20mismatch=20in=20Tutorial=20-=20Python=20Ty?= =?UTF-8?q?pes=20Intro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/zh/docs/python-types.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/zh/docs/python-types.md b/docs/zh/docs/python-types.md index e8c07f4c..67a1612f 100644 --- a/docs/zh/docs/python-types.md +++ b/docs/zh/docs/python-types.md @@ -222,13 +222,13 @@ John Doe 假设你有一个名为 `Person` 的类,拥有 name 属性: ```Python hl_lines="1-3" -{!../../../docs_src/python_types/tutorial009.py!} +{!../../../docs_src/python_types/tutorial010.py!} ``` 接下来,你可以将一个变量声明为 `Person` 类型: ```Python hl_lines="6" -{!../../../docs_src/python_types/tutorial009.py!} +{!../../../docs_src/python_types/tutorial010.py!} ``` 然后,你将再次获得所有的编辑器支持: From b27758fe13190da83fbf7235e739e0aa58bc17f2 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:03:22 +0000 Subject: [PATCH 25/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index ec1f5ac5..6821f7c5 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Fix Chinese translation code snippet mismatch in Tutorial - Python Types Intro. PR [#2573](https://github.com/tiangolo/fastapi/pull/2573) by [@BoYanZh](https://github.com/BoYanZh). * 🌐 Add Portuguese translation for Development Contributing. PR [#1364](https://github.com/tiangolo/fastapi/pull/1364) by [@Serrones](https://github.com/Serrones). * ⬆ Upgrade docs development dependency on `typer-cli` to >=0.0.12 to fix conflicts. PR [#3429](https://github.com/tiangolo/fastapi/pull/3429) by [@tiangolo](https://github.com/tiangolo). * 🌐 Add Chinese translation for Tutorial - Request - Files. PR [#3244](https://github.com/tiangolo/fastapi/pull/3244) by [@jaystone776](https://github.com/jaystone776). From 18b24df9c820799adf5f3ab26c2253a073936718 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Fri, 2 Jul 2021 16:06:10 +0200 Subject: [PATCH 26/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20French=20translation?= =?UTF-8?q?=20for=20Alternatives,=20Inspiration=20and=20Comparisons=20(#30?= =?UTF-8?q?20)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jérôme Fink Co-authored-by: Sam Courtemanche --- docs/fr/docs/alternatives.md | 446 +++++++++++++++++++++++++++++++++++ docs/fr/mkdocs.yml | 1 + 2 files changed, 447 insertions(+) create mode 100644 docs/fr/docs/alternatives.md diff --git a/docs/fr/docs/alternatives.md b/docs/fr/docs/alternatives.md new file mode 100644 index 00000000..bf3e7bc3 --- /dev/null +++ b/docs/fr/docs/alternatives.md @@ -0,0 +1,446 @@ +# Alternatives, inspiration et comparaisons + +Ce qui a inspiré **FastAPI**, comment il se compare à d'autres solutions et ce qu'il en a appris. + +## Intro + +**FastAPI** n'existerait pas sans les précédentes contributions d'autres projets. + +De nombreux outils ont été créés auparavant et ont contribué à inspirer sa création. + +J'ai évité la création d'un nouveau framework pendant plusieurs années. J'ai d'abord essayé de combler toutes les +fonctionnalités couvertes par **FastAPI** en utilisant de nombreux frameworks, plug-ins et outils différents. + +Mais à un moment donné il n'y avait pas d'autre option que de créer quelque chose qui offrait toutes ces +fonctionnalités, en reprenant et en combinant de la meilleure façon possible les meilleures idées des outils +précédents, en utilisant des fonctionnalités du langage qui n'étaient même pas disponibles auparavant (type hints depuis Python 3.6+). + +## Outils précédents + +### Django + +C'est le framework Python le plus populaire et il bénéficie d'une grande confiance. Il est utilisé pour construire +des systèmes tel qu'Instagram. + +Il est relativement fortement couplé aux bases de données relationnelles (comme MySQL ou PostgreSQL), de sorte qu'il +n'est pas très facile d'utiliser une base de données NoSQL (comme Couchbase, MongoDB, Cassandra, etc.) comme principal moyen de +stockage. + +Il a été créé pour générer le HTML en backend, pas pour créer des API consommées par un frontend moderne (comme React, Vue.js et Angular) ou par d'autres systèmes (comme les appareils IoT) communiquant avec lui. + +### Django REST Framework + +Django REST framework a été conçu comme une boîte à outils flexible permettant de construire des API Web à partir de Django, afin d'améliorer ses capacités en matière d'API. + +Il est utilisé par de nombreuses entreprises, dont Mozilla, Red Hat et Eventbrite. + +Il s'agissait de l'un des premiers exemples de **documentation automatique pour API**, et c'est précisément l'une des +premières idées qui a inspiré "la recherche de" **FastAPI**. + +!!! note +Django REST framework a été créé par Tom Christie. Le créateur de Starlette et Uvicorn, sur lesquels **FastAPI** est basé. + +!!! check "A inspiré **FastAPI** à" +Avoir une interface de documentation automatique de l'API. + +### Flask + +Flask est un "micro-framework", il ne comprend pas d'intégrations de bases de données ni beaucoup de choses qui sont fournies par défaut dans Django. + +Cette simplicité et cette flexibilité permettent d'utiliser des bases de données NoSQL comme principal système de stockage de données. + +Comme il est très simple, son apprentissage est relativement intuitif, bien que la documentation soit quelque peu +technique par moments. + +Il est aussi couramment utilisé pour d'autres applications qui n'ont pas nécessairement besoin d'une base de données, de gestion des utilisateurs ou de l'une des nombreuses fonctionnalités préinstallées dans Django. Bien que beaucoup de ces fonctionnalités puissent être ajoutées avec des plug-ins. + +Ce découplage des parties, et le fait d'être un "micro-framework" qui puisse être étendu pour couvrir exactement ce +qui est nécessaire, était une caractéristique clé que je voulais conserver. + +Compte tenu de la simplicité de Flask, il semblait bien adapté à la création d'API. La prochaine chose à trouver était un "Django REST Framework" pour Flask. + +!!! check "A inspiré **FastAPI** à" +Être un micro-framework. Il est donc facile de combiner les outils et les pièces nécessaires. + +Proposer un système de routage simple et facile à utiliser. + +### Requests + +**FastAPI** n'est pas réellement une alternative à **Requests**. Leur cadre est très différent. + +Il serait en fait plus courant d'utiliser Requests _à l'intérieur_ d'une application FastAPI. + +Mais quand même, FastAPI s'est inspiré de Requests. + +**Requests** est une bibliothèque pour _interagir_ avec les API (en tant que client), tandis que **FastAPI** est une bibliothèque pour _créer_ des API (en tant que serveur). + +Ils sont, plus ou moins, aux extrémités opposées, se complétant l'un l'autre. + +Requests a un design très simple et intuitif, il est très facile à utiliser, avec des valeurs par défaut raisonnables, tout en étant très puissant et personnalisable. + +C'est pourquoi, comme le dit le site officiel : + +> Requests est l'un des packages Python les plus téléchargés de tous les temps + +La façon dont vous l'utilisez est très simple. Par exemple, pour faire une requête `GET`, vous devez écrire : + +```Python +response = requests.get("http://example.com/some/url") +``` + +En contrepartie l'API _des opérations de chemin_ de FastAPI pourrait ressembler à ceci : + +```Python hl_lines="1" +@app.get("/some/url") +def read_url(): + return {"message": "Hello World"} +``` + +Notez les similitudes entre `requests.get(...)` et `@app.get(...)`. + +!!! check "A inspiré **FastAPI** à" +_ Avoir une API simple et intuitive. +_ Utiliser les noms de méthodes HTTP (opérations) directement, de manière simple et intuitive. \* Avoir des valeurs par défaut raisonnables, mais des personnalisations puissantes. + +### Swagger / OpenAPI + +La principale fonctionnalité que j'ai emprunté à Django REST Framework était la documentation automatique des API. + +Puis j'ai découvert qu'il existait une norme pour documenter les API, en utilisant JSON (ou YAML, une extension de JSON) appelée Swagger. + +Il existait déjà une interface utilisateur Web pour les API Swagger. Donc, être capable de générer une documentation +Swagger pour une API permettrait d'utiliser cette interface utilisateur web automatiquement. + +À un moment donné, Swagger a été cédé à la Fondation Linux, puis a été rebaptisé OpenAPI. + +C'est pourquoi, lorsqu'on parle de la version 2.0, il est courant de dire "Swagger", et pour la version 3+ "OpenAPI". + +!!! check "A inspiré **FastAPI** à" +Adopter et utiliser une norme ouverte pour les spécifications des API, au lieu d'un schéma personnalisé. + + Intégrer des outils d'interface utilisateur basés sur des normes : + + * Swagger UI + * ReDoc + + Ces deux-là ont été choisis parce qu'ils sont populaires et stables, mais en faisant une recherche rapide, vous pourriez trouver des dizaines d'alternatives supplémentaires pour OpenAPI (que vous pouvez utiliser avec **FastAPI**). + +### Frameworks REST pour Flask + +Il y a plusieurs frameworks REST pour Flask, mais après avoir investi du temps et du travail pour les étudier, j'ai +découvert que le développement de beaucoup d'entre eux sont suspendus ou abandonnés, avec plusieurs problèmes +permanents qui les rendent inadaptés. + +### Marshmallow + +L'une des principales fonctionnalités nécessaires aux systèmes API est la "sérialisation" des données, qui consiste à prendre les données du code (Python) et à +les convertir en quelque chose qui peut être envoyé sur le réseau. Par exemple, convertir un objet contenant des +données provenant d'une base de données en un objet JSON. Convertir des objets `datetime` en strings, etc. + +La validation des données est une autre fonctionnalité importante dont ont besoin les API. Elle permet de s'assurer +que les données sont valides, compte tenu de certains paramètres. Par exemple, qu'un champ est un `int`, et non un +string. +Ceci est particulièrement utile pour les données entrantes. + +Sans un système de validation des données, vous devriez effectuer toutes les vérifications à la main, dans le code. + +Ces fonctionnalités sont ce pourquoi Marshmallow a été construit. C'est une excellente bibliothèque, et je l'ai déjà beaucoup utilisée. + +Mais elle a été créée avant que les type hints n'existent en Python. Ainsi, pour définir chaque schéma, vous devez utiliser des utilitaires et des classes spécifiques fournies par Marshmallow. + +!!! check "A inspiré **FastAPI** à" +Utilisez du code pour définir des "schémas" qui fournissent automatiquement les types de données et la validation. + +### Webargs + +Une autre grande fonctionnalité requise par les API est le parsing des données provenant des requêtes entrantes. + +Webargs est un outil qui a été créé pour fournir cela par-dessus plusieurs frameworks, dont Flask. + +Il utilise Marshmallow pour effectuer la validation des données. Et il a été créé par les mêmes développeurs. + +C'est un outil formidable et je l'ai beaucoup utilisé aussi, avant d'avoir **FastAPI**. + +!!! info +Webargs a été créé par les développeurs de Marshmallow. + +!!! check "A inspiré **FastAPI** à" +Disposer d'une validation automatique des données des requêtes entrantes. + +### APISpec + +Marshmallow et Webargs fournissent la validation, l'analyse et la sérialisation en tant que plug-ins. + +Mais la documentation fait toujours défaut. C'est alors qu'APISpec a été créé. + +Il s'agit d'un plug-in pour de nombreux frameworks (et il existe également un plug-in pour Starlette). + +Le principe est le suivant : vous écrivez la définition du schéma au format YAML dans la docstring de chaque fonction gérant une route. + +Et il génère des schémas OpenAPI. + +C'est ainsi que cela fonctionne dans Flask, Starlette, Responder, etc. + +Mais alors, nous avons à nouveau le problème d'avoir une micro-syntaxe, dans une docstring Python (un gros morceau de YAML). + +L'éditeur ne peut guère aider en la matière. Et si nous modifions les paramètres ou les schémas Marshmallow et que nous oublions de modifier également cette docstring YAML, le schéma généré deviendrait obsolète. + +!!! info +APISpec a été créé par les développeurs de Marshmallow. + +!!! check "A inspiré **FastAPI** à" +Supporter la norme ouverte pour les API, OpenAPI. + +### Flask-apispec + +C'est un plug-in pour Flask, qui relie Webargs, Marshmallow et APISpec. + +Il utilise les informations de Webargs et Marshmallow pour générer automatiquement des schémas OpenAPI, en utilisant APISpec. + +C'est un excellent outil, très sous-estimé. Il devrait être beaucoup plus populaire que de nombreux plug-ins Flask. C'est peut-être dû au fait que sa documentation est trop concise et abstraite. + +Cela a permis de ne pas avoir à écrire YAML (une autre syntaxe) à l'intérieur des docstrings Python. + +Cette combinaison de Flask, Flask-apispec avec Marshmallow et Webargs était ma stack backend préférée jusqu'à la création de **FastAPI**. + +Son utilisation a conduit à la création de plusieurs générateurs Flask full-stack. Ce sont les principales stacks que +j'ai (ainsi que plusieurs équipes externes) utilisées jusqu'à présent : + +- https://github.com/tiangolo/full-stack +- https://github.com/tiangolo/full-stack-flask-couchbase +- https://github.com/tiangolo/full-stack-flask-couchdb + +Ces mêmes générateurs full-stack ont servi de base aux [Générateurs de projets pour **FastAPI**](project-generation.md){.internal-link target=\_blank}. + +!!! info +Flask-apispec a été créé par les développeurs de Marshmallow. + +!!! check "A inspiré **FastAPI** à" +Générer le schéma OpenAPI automatiquement, à partir du même code qui définit la sérialisation et la validation. + +### NestJS (et Angular) + +Ce n'est même pas du Python, NestJS est un framework JavaScript (TypeScript) NodeJS inspiré d'Angular. + +Il réalise quelque chose de similaire à ce qui peut être fait avec Flask-apispec. + +Il possède un système d'injection de dépendances intégré, inspiré d'Angular 2. Il nécessite de pré-enregistrer les "injectables" (comme tous les autres systèmes d'injection de dépendances que je connais), donc, cela ajoute à la verbosité et à la répétition du code. + +Comme les paramètres sont décrits avec des types TypeScript (similaires aux type hints de Python), la prise en charge +par l'éditeur est assez bonne. + +Mais comme les données TypeScript ne sont pas préservées après la compilation en JavaScript, il ne peut pas compter sur les types pour définir la validation, la sérialisation et la documentation en même temps. En raison de cela et de certaines décisions de conception, pour obtenir la validation, la sérialisation et la génération automatique de schémas, il est nécessaire d'ajouter des décorateurs à de nombreux endroits. Cela devient donc assez verbeux. + +Il ne peut pas très bien gérer les modèles imbriqués. Ainsi, si le corps JSON de la requête est un objet JSON comportant des champs internes qui sont à leur tour des objets JSON imbriqués, il ne peut pas être correctement documenté et validé. + +!!! check "A inspiré **FastAPI** à" +Utiliser les types Python pour bénéficier d'un excellent support de l'éditeur. + + Disposer d'un puissant système d'injection de dépendances. Trouver un moyen de minimiser la répétition du code. + +### Sanic + +C'était l'un des premiers frameworks Python extrêmement rapides basés sur `asyncio`. Il a été conçu pour être très similaire à Flask. + +!!! note "Détails techniques" +Il utilisait `uvloop` au lieu du système par défaut de Python `asyncio`. C'est ce qui l'a rendu si rapide. + + Il a clairement inspiré Uvicorn et Starlette, qui sont actuellement plus rapides que Sanic dans les benchmarks. + +!!! check "A inspiré **FastAPI** à" +Trouvez un moyen d'avoir une performance folle. + + C'est pourquoi **FastAPI** est basé sur Starlette, car il s'agit du framework le plus rapide disponible (testé par des benchmarks tiers). + +### Falcon + +Falcon est un autre framework Python haute performance, il est conçu pour être minimal, et est utilisé comme fondation pour d'autres frameworks comme Hug. + +Il utilise le standard précédent pour les frameworks web Python (WSGI) qui est synchrone, donc il ne peut pas gérer les WebSockets et d'autres cas d'utilisation. Néanmoins, il offre de très bonnes performances. + +Il est conçu pour avoir des fonctions qui reçoivent deux paramètres, une "requête" et une "réponse". Ensuite, vous +"lisez" des parties de la requête et "écrivez" des parties dans la réponse. En raison de cette conception, il n'est +pas possible de déclarer des paramètres de requête et des corps avec des indications de type Python standard comme paramètres de fonction. + +Ainsi, la validation, la sérialisation et la documentation des données doivent être effectuées dans le code, et non pas automatiquement. Ou bien elles doivent être implémentées comme un framework au-dessus de Falcon, comme Hug. Cette même distinction se retrouve dans d'autres frameworks qui s'inspirent de la conception de Falcon, qui consiste à avoir un objet de requête et un objet de réponse comme paramètres. + +!!! check "A inspiré **FastAPI** à" +Trouver des moyens d'obtenir de bonnes performances. + + Avec Hug (puisque Hug est basé sur Falcon), **FastAPI** a inspiré la déclaration d'un paramètre `response` dans les fonctions. + + Bien que dans FastAPI, il est facultatif, et est utilisé principalement pour définir les en-têtes, les cookies, et les codes de statut alternatifs. + +### Molten + +J'ai découvert Molten lors des premières étapes de développement de **FastAPI**. Et il a des idées assez similaires : + +- Basé sur les type hints Python. +- Validation et documentation via ces types. +- Système d'injection de dépendances. + +Il n'utilise pas une librairie tiers de validation, sérialisation et de documentation tel que Pydantic, il utilise son propre système. Ainsi, ces définitions de types de données ne sont pas réutilisables aussi facilement. + +Il nécessite une configuration un peu plus verbeuse. Et comme il est basé sur WSGI (au lieu dASGI), il n'est pas +conçu pour profiter des hautes performances fournies par des outils comme Uvicorn, Starlette et Sanic. + +Le système d'injection de dépendances exige le pré-enregistrement des dépendances et les dépendances sont résolues sur la base des types déclarés. Ainsi, il n'est pas possible de déclarer plus d'un "composant" qui fournit un certain type. + +Les routes sont déclarées à un seul endroit, en utilisant des fonctions déclarées à d'autres endroits (au lieu +d'utiliser des décorateurs qui peuvent être placés juste au-dessus de la fonction qui gère l'endpoint). Cette +méthode est plus proche de celle de Django que de celle de Flask (et Starlette). Il sépare dans le code des choses +qui sont relativement fortement couplées. + +!!! check "A inspiré **FastAPI** à" +Définir des validations supplémentaires pour les types de données utilisant la valeur "par défaut" des attributs du modèle. Ceci améliore le support de l'éditeur, et n'était pas disponible dans Pydantic auparavant. + + Cela a en fait inspiré la mise à jour de certaines parties de Pydantic, afin de supporter le même style de déclaration de validation (toute cette fonctionnalité est maintenant déjà disponible dans Pydantic). + +### Hug + +Hug a été l'un des premiers frameworks à implémenter la déclaration des types de paramètres d'API en utilisant les type hints Python. C'était une excellente idée qui a inspiré d'autres outils à faire de même. + +Il utilisait des types personnalisés dans ses déclarations au lieu des types Python standard, mais c'était tout de même un énorme pas en avant. + +Il a également été l'un des premiers frameworks à générer un schéma personnalisé déclarant l'ensemble de l'API en JSON. + +Il n'était pas basé sur une norme comme OpenAPI et JSON Schema. Il ne serait donc pas simple de l'intégrer à d'autres outils, comme Swagger UI. Mais encore une fois, c'était une idée très innovante. + +Il présente une caractéristique intéressante et peu commune : à l'aide du même framework, il est possible de créer des +API et des CLI. + +Comme il est basé sur l'ancienne norme pour les frameworks web Python synchrones (WSGI), il ne peut pas gérer les Websockets et autres, bien qu'il soit également très performant. + +!!! info +Hug a été créé par Timothy Crosley, le créateur de `isort`, un excellent outil pour trier automatiquement les imports dans les fichiers Python. + +!!! check "A inspiré **FastAPI** à" +Hug a inspiré certaines parties d'APIStar, et était l'un des outils que je trouvais les plus prometteurs, à côté d'APIStar. + + Hug a contribué à inspirer **FastAPI** pour utiliser les type hints Python + pour déclarer les paramètres, et pour générer automatiquement un schéma définissant l'API. + + Hug a inspiré **FastAPI** pour déclarer un paramètre `response` dans les fonctions pour définir les en-têtes et les cookies. + +### APIStar (<= 0.5) + +Juste avant de décider de développer **FastAPI**, j'ai trouvé le serveur **APIStar**. Il contenait presque tout ce +que je recherchais et avait un beau design. + +C'était l'une des premières implémentations d'un framework utilisant les type hints Python pour déclarer les paramètres +et les requêtes que j'ai vues (avant NestJS et Molten). Je l'ai trouvé plus ou moins en même temps que Hug. Mais APIStar utilisait le standard OpenAPI. + +Il disposait de la validation automatique, sérialisation des données et d'une génération de schéma OpenAPI basée sur les mêmes type hints à plusieurs endroits. + +La définition du schéma de corps de requête n'utilisait pas les mêmes type hints Python que Pydantic, il était un peu plus proche de Marshmallow, donc le support de l'éditeur n'était pas aussi bon, mais APIStar était quand même la meilleure option disponible. + +Il avait les meilleures performances d'après les benchmarks de l'époque (seulement surpassé par Starlette). + +Au départ, il ne disposait pas d'une interface web de documentation automatique de l'API, mais je savais que je pouvais lui ajouter une interface Swagger. + +Il avait un système d'injection de dépendances. Il nécessitait un pré-enregistrement des composants, comme d'autres outils discutés ci-dessus. Mais c'était quand même une excellente fonctionnalité. + +Je n'ai jamais pu l'utiliser dans un projet complet, car il n'avait pas d'intégration de sécurité, et je ne pouvais donc pas remplacer toutes les fonctionnalités que j'avais avec les générateurs complets basés sur Flask-apispec. J'avais dans mon backlog de projets de créer une pull request pour ajouter cette fonctionnalité. + +Mais ensuite, le projet a changé d'orientation. + +Il ne s'agissait plus d'un framework web API, le créateur devant se concentrer sur Starlette. + +Maintenant, APIStar est un ensemble d'outils pour valider les spécifications OpenAPI, et non un framework web. + +!!! info +APIStar a été créé par Tom Christie. Le même gars qui a créé : + + * Django REST Framework + * Starlette (sur lequel **FastAPI** est basé) + * Uvicorn (utilisé par Starlette et **FastAPI**) + +!!! check "A inspiré **FastAPI** à" +Exister. + + L'idée de déclarer plusieurs choses (validation des données, sérialisation et documentation) avec les mêmes types Python, tout en offrant un excellent support pour les éditeurs, était pour moi une idée brillante. + + Et après avoir longtemps cherché un framework similaire et testé de nombreuses alternatives, APIStar était la meilleure option disponible. + + Puis APIStar a cessé d'exister en tant que serveur et Starlette a été créé, et a constitué une meilleure base pour un tel système. Ce fut l'inspiration finale pour construire **FastAPI**. + + Je considère **FastAPI** comme un "successeur spirituel" d'APIStar, tout en améliorant et en augmentant les fonctionnalités, le système de typage et d'autres parties, sur la base des enseignements tirés de tous ces outils précédents. + +## Utilisés par **FastAPI** + +### Pydantic + +Pydantic est une bibliothèque permettant de définir la validation, la sérialisation et la documentation des données (à l'aide de JSON Schema) en se basant sur les Python type hints. + +Cela le rend extrêmement intuitif. + +Il est comparable à Marshmallow. Bien qu'il soit plus rapide que Marshmallow dans les benchmarks. Et comme il est +basé sur les mêmes type hints Python, le support de l'éditeur est grand. + +!!! check "**FastAPI** l'utilise pour" +Gérer toute la validation des données, leur sérialisation et la documentation automatique du modèle (basée sur le schéma JSON). + + **FastAPI** prend ensuite ces données JSON Schema et les place dans OpenAPI, en plus de toutes les autres choses qu'il fait. + +### Starlette + +Starlette est un framework/toolkit léger ASGI, qui est idéal pour construire des services asyncio performants. + +Il est très simple et intuitif. Il est conçu pour être facilement extensible et avoir des composants modulaires. + +Il offre : + +- Des performances vraiment impressionnantes. +- Le support des WebSockets. +- Le support de GraphQL. +- Les tâches d'arrière-plan. +- Les événements de démarrage et d'arrêt. +- Un client de test basé sur request. +- CORS, GZip, fichiers statiques, streaming des réponses. +- Le support des sessions et des cookies. +- Une couverture de test à 100 %. +- 100 % de la base de code avec des annotations de type. +- Zéro forte dépendance à d'autres packages. + +Starlette est actuellement le framework Python le plus rapide testé. Seulement dépassé par Uvicorn, qui n'est pas un framework, mais un serveur. + +Starlette fournit toutes les fonctionnalités de base d'un micro-framework web. + +Mais il ne fournit pas de validation automatique des données, de sérialisation ou de documentation. + +C'est l'une des principales choses que **FastAPI** ajoute par-dessus, le tout basé sur les type hints Python (en utilisant Pydantic). Cela, plus le système d'injection de dépendances, les utilitaires de sécurité, la génération de schémas OpenAPI, etc. + +!!! note "Détails techniques" +ASGI est une nouvelle "norme" développée par les membres de l'équipe principale de Django. Il ne s'agit pas encore d'une "norme Python" (un PEP), bien qu'ils soient en train de le faire. + + Néanmoins, il est déjà utilisé comme "standard" par plusieurs outils. Cela améliore grandement l'interopérabilité, puisque vous pouvez remplacer Uvicorn par n'importe quel autre serveur ASGI (comme Daphne ou Hypercorn), ou vous pouvez ajouter des outils compatibles ASGI, comme `python-socketio`. + +!!! check "**FastAPI** l'utilise pour" +Gérer toutes les parties web de base. Ajouter des fonctionnalités par-dessus. + + La classe `FastAPI` elle-même hérite directement de la classe `Starlette`. + + Ainsi, tout ce que vous pouvez faire avec Starlette, vous pouvez le faire directement avec **FastAPI**, car il s'agit en fait de Starlette sous stéroïdes. + +### Uvicorn + +Uvicorn est un serveur ASGI rapide comme l'éclair, basé sur uvloop et httptools. + +Il ne s'agit pas d'un framework web, mais d'un serveur. Par exemple, il ne fournit pas d'outils pour le routing. C'est +quelque chose qu'un framework comme Starlette (ou **FastAPI**) fournirait par-dessus. + +C'est le serveur recommandé pour Starlette et **FastAPI**. + +!!! check "**FastAPI** le recommande comme" +Le serveur web principal pour exécuter les applications **FastAPI**. + + Vous pouvez le combiner avec Gunicorn, pour avoir un serveur multi-processus asynchrone. + + Pour plus de détails, consultez la section [Déploiement](deployment/index.md){.internal-link target=_blank}. + +## Benchmarks et vitesse + +Pour comprendre, comparer et voir la différence entre Uvicorn, Starlette et FastAPI, consultez la section sur les [Benchmarks](benchmarks.md){.internal-link target=\_blank}. diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml index f1c66c75..c5860a4b 100644 --- a/docs/fr/mkdocs.yml +++ b/docs/fr/mkdocs.yml @@ -55,6 +55,7 @@ nav: - fastapi-people.md - Tutoriel - Guide utilisateur: - tutorial/background-tasks.md +- alternatives.md markdown_extensions: - toc: permalink: true From 3127bc4e05b72e39d1681735ec1ee49844b7dc88 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:06:45 +0000 Subject: [PATCH 27/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 6821f7c5..a769f0a5 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add French translation for Alternatives, Inspiration and Comparisons. PR [#3020](https://github.com/tiangolo/fastapi/pull/3020) by [@rjNemo](https://github.com/rjNemo). * 🌐 Fix Chinese translation code snippet mismatch in Tutorial - Python Types Intro. PR [#2573](https://github.com/tiangolo/fastapi/pull/2573) by [@BoYanZh](https://github.com/BoYanZh). * 🌐 Add Portuguese translation for Development Contributing. PR [#1364](https://github.com/tiangolo/fastapi/pull/1364) by [@Serrones](https://github.com/Serrones). * ⬆ Upgrade docs development dependency on `typer-cli` to >=0.0.12 to fix conflicts. PR [#3429](https://github.com/tiangolo/fastapi/pull/3429) by [@tiangolo](https://github.com/tiangolo). From acda3f06b0a884965fb4196dbf029b1043a770ed Mon Sep 17 00:00:00 2001 From: Sam Courtemanche Date: Fri, 2 Jul 2021 16:12:05 +0200 Subject: [PATCH 28/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20French=20translation?= =?UTF-8?q?=20for=20External=20Links=20(#3103)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/fr/docs/external-links.md | 82 ++++++++++++++++++++++++++++++++++ docs/fr/mkdocs.yml | 1 + 2 files changed, 83 insertions(+) create mode 100644 docs/fr/docs/external-links.md diff --git a/docs/fr/docs/external-links.md b/docs/fr/docs/external-links.md new file mode 100644 index 00000000..002e6d2b --- /dev/null +++ b/docs/fr/docs/external-links.md @@ -0,0 +1,82 @@ +# Articles et liens externes + +**FastAPI** possède une grande communauté en constante extension. + +Il existe de nombreux articles, outils et projets liés à **FastAPI**. + +Voici une liste incomplète de certains d'entre eux. + +!!! tip "Astuce" + Si vous avez un article, projet, outil, ou quoi que ce soit lié à **FastAPI** qui n'est actuellement pas listé ici, créez une Pull Request l'ajoutant. + +## Articles + +### Anglais + +{% if external_links %} +{% for article in external_links.articles.english %} + +* {{ article.title }} par {{ article.author }}. +{% endfor %} +{% endif %} + +### Japonais + +{% if external_links %} +{% for article in external_links.articles.japanese %} + +* {{ article.title }} par {{ article.author }}. +{% endfor %} +{% endif %} + +### Vietnamien + +{% if external_links %} +{% for article in external_links.articles.vietnamese %} + +* {{ article.title }} par {{ article.author }}. +{% endfor %} +{% endif %} + +### Russe + +{% if external_links %} +{% for article in external_links.articles.russian %} + +* {{ article.title }} par {{ article.author }}. +{% endfor %} +{% endif %} + +### Allemand + +{% if external_links %} +{% for article in external_links.articles.german %} + +* {{ article.title }} par {{ article.author }}. +{% endfor %} +{% endif %} + +## Podcasts + +{% if external_links %} +{% for article in external_links.podcasts.english %} + +* {{ article.title }} par {{ article.author }}. +{% endfor %} +{% endif %} + +## Conférences + +{% if external_links %} +{% for article in external_links.talks.english %} + +* {{ article.title }} par {{ article.author }}. +{% endfor %} +{% endif %} + +## Projets + +Les projets Github avec le topic `fastapi` les plus récents : + +
+
diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml index c5860a4b..c0bbb2ac 100644 --- a/docs/fr/mkdocs.yml +++ b/docs/fr/mkdocs.yml @@ -56,6 +56,7 @@ nav: - Tutoriel - Guide utilisateur: - tutorial/background-tasks.md - alternatives.md +- external-links.md markdown_extensions: - toc: permalink: true From 0abb743e9c4994e5fdd5abc346967675c4b319c8 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:12:43 +0000 Subject: [PATCH 29/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index a769f0a5..e312fb31 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add French translation for External Links. PR [#3103](https://github.com/tiangolo/fastapi/pull/3103) by [@Smlep](https://github.com/Smlep). * 🌐 Add French translation for Alternatives, Inspiration and Comparisons. PR [#3020](https://github.com/tiangolo/fastapi/pull/3020) by [@rjNemo](https://github.com/rjNemo). * 🌐 Fix Chinese translation code snippet mismatch in Tutorial - Python Types Intro. PR [#2573](https://github.com/tiangolo/fastapi/pull/2573) by [@BoYanZh](https://github.com/BoYanZh). * 🌐 Add Portuguese translation for Development Contributing. PR [#1364](https://github.com/tiangolo/fastapi/pull/1364) by [@Serrones](https://github.com/Serrones). From a694be81ae2f2d4b6657fd33b62bc631acbc3f04 Mon Sep 17 00:00:00 2001 From: Sam Courtemanche Date: Fri, 2 Jul 2021 16:13:52 +0200 Subject: [PATCH 30/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20French=20translation?= =?UTF-8?q?=20for=20Python=20Types=20Intro=20(#3185)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/fr/docs/python-types.md | 314 +++++++++++++++++++++++++++++++++++ docs/fr/mkdocs.yml | 1 + 2 files changed, 315 insertions(+) create mode 100644 docs/fr/docs/python-types.md diff --git a/docs/fr/docs/python-types.md b/docs/fr/docs/python-types.md new file mode 100644 index 00000000..4008ed96 --- /dev/null +++ b/docs/fr/docs/python-types.md @@ -0,0 +1,314 @@ +# Introduction aux Types Python + +Python supporte des annotations de type (ou *type hints*) optionnelles. + +Ces annotations de type constituent une syntaxe spéciale qui permet de déclarer le type d'une variable. + +En déclarant les types de vos variables, cela permet aux différents outils comme les éditeurs de texte d'offrir un meilleur support. + +Ce chapitre n'est qu'un **tutoriel rapide / rappel** sur les annotations de type Python. +Seulement le minimum nécessaire pour les utiliser avec **FastAPI** sera couvert... ce qui est en réalité très peu. + +**FastAPI** est totalement basé sur ces annotations de type, qui lui donnent de nombreux avantages. + +Mais même si vous n'utilisez pas ou n'utiliserez jamais **FastAPI**, vous pourriez bénéficier d'apprendre quelques choses sur ces dernières. + +!!! note + Si vous êtes un expert Python, et que vous savez déjà **tout** sur les annotations de type, passez au chapitre suivant. + +## Motivations + +Prenons un exemple simple : + +```Python +{!../../../docs_src/python_types/tutorial001.py!} +``` + +Exécuter ce programe affiche : + +``` +John Doe +``` + +La fonction : + +* Prend un `first_name` et un `last_name`. +* Convertit la première lettre de chaque paramètre en majuscules grâce à `title()`. +* Concatène les résultats avec un espace entre les deux. + +```Python hl_lines="2" +{!../../../docs_src/python_types/tutorial001.py!} +``` + +### Limitations + +C'est un programme très simple. + +Mais maintenant imaginez que vous l'écriviez de zéro. + +À un certain point vous auriez commencé la définition de la fonction, vous aviez les paramètres prêts. + +Mais vous aviez besoin de "cette méthode qui convertit la première lettre en majuscule". + +Était-ce `upper` ? `uppercase` ? `first_uppercase` ? `capitalize` ? + +Vous essayez donc d'utiliser le vieil ami du programmeur, l'auto-complétion de l'éditeur. + +Vous écrivez le premier paramètre, `first_name`, puis un point (`.`) et appuyez sur `Ctrl+Espace` pour déclencher l'auto-complétion. + +Mais malheureusement, rien d'utile n'en résulte : + + + +### Ajouter des types + +Modifions une seule ligne de la version précédente. + +Nous allons changer seulement cet extrait, les paramètres de la fonction, de : + + +```Python + first_name, last_name +``` + +à : + +```Python + first_name: str, last_name: str +``` + +C'est tout. + +Ce sont des annotations de types : + +```Python hl_lines="1" +{!../../../docs_src/python_types/tutorial002.py!} +``` + +À ne pas confondre avec la déclaration de valeurs par défaut comme ici : + +```Python + first_name="john", last_name="doe" +``` + +C'est une chose différente. + +On utilise un deux-points (`:`), et pas un égal (`=`). + +Et ajouter des annotations de types ne crée normalement pas de différence avec le comportement qui aurait eu lieu si elles n'étaient pas là. + +Maintenant, imaginez que vous êtes en train de créer cette fonction, mais avec des annotations de type cette fois. + +Au même moment que durant l'exemple précédent, vous essayez de déclencher l'auto-complétion et vous voyez : + + + +Vous pouvez donc dérouler les options jusqu'à trouver la méthode à laquelle vous pensiez. + + + +## Plus de motivations + +Cette fonction possède déjà des annotations de type : + +```Python hl_lines="1" +{!../../../docs_src/python_types/tutorial003.py!} +``` + +Comme l'éditeur connaît le type des variables, vous n'avez pas seulement l'auto-complétion, mais aussi de la détection d'erreurs : + + + +Maintenant que vous avez connaissance du problème, convertissez `age` en chaine de caractères grâce à `str(age)` : + +```Python hl_lines="2" +{!../../../docs_src/python_types/tutorial004.py!} +``` + +## Déclarer des types + +Vous venez de voir là où les types sont généralement déclarés : dans les paramètres de fonctions. + +C'est aussi ici que vous les utiliseriez avec **FastAPI**. + +### Types simples + +Vous pouvez déclarer tous les types de Python, pas seulement `str`. + +Comme par exemple : + +* `int` +* `float` +* `bool` +* `bytes` + +```Python hl_lines="1" +{!../../../docs_src/python_types/tutorial005.py!} +``` + +### Types génériques avec des paramètres de types + +Il existe certaines structures de données qui contiennent d'autres valeurs, comme `dict`, `list`, `set` et `tuple`. Et les valeurs internes peuvent elles aussi avoir leurs propres types. + +Pour déclarer ces types et les types internes, on utilise le module standard de Python `typing`. + +Il existe spécialement pour supporter ces annotations de types. + +#### `List` + +Par exemple, définissons une variable comme `list` de `str`. + +Importez `List` (avec un `L` majuscule) depuis `typing`. + +```Python hl_lines="1" +{!../../../docs_src/python_types/tutorial006.py!} +``` + +Déclarez la variable, en utilisant la syntaxe des deux-points (`:`). + +Et comme type, mettez `List`. + +Les listes étant un type contenant des types internes, mettez ces derniers entre crochets (`[`, `]`) : + +```Python hl_lines="4" +{!../../../docs_src/python_types/tutorial006.py!} +``` + +!!! tip "Astuce" + Ces types internes entre crochets sont appelés des "paramètres de type". + + Ici, `str` est un paramètre de type passé à `List`. + +Ce qui signifie : "la variable `items` est une `list`, et chacun de ses éléments a pour type `str`. + +En faisant cela, votre éditeur pourra vous aider, même pendant que vous traitez des éléments de la liste. + + + +Sans types, c'est presque impossible à réaliser. + +Vous remarquerez que la variable `item` n'est qu'un des éléments de la list `items`. + +Et pourtant, l'éditeur sait qu'elle est de type `str` et pourra donc vous aider à l'utiliser. + +#### `Tuple` et `Set` + +C'est le même fonctionnement pour déclarer un `tuple` ou un `set` : + +```Python hl_lines="1 4" +{!../../../docs_src/python_types/tutorial007.py!} +``` + +Dans cet exemple : + +* La variable `items_t` est un `tuple` avec 3 éléments, un `int`, un deuxième `int`, et un `str`. +* La variable `items_s` est un `set`, et chacun de ses éléments est de type `bytes`. + +#### `Dict` + +Pour définir un `dict`, il faut lui passer 2 paramètres, séparés par une virgule (`,`). + +Le premier paramètre de type est pour les clés et le second pour les valeurs du dictionnaire (`dict`). + +```Python hl_lines="1 4" +{!../../../docs_src/python_types/tutorial008.py!} +``` + +Dans cet exemple : + +* La variable `prices` est de type `dict` : + * Les clés de ce dictionnaire sont de type `str`. + * Les valeurs de ce dictionnaire sont de type `float`. + +#### `Optional` + +Vous pouvez aussi utiliser `Optional` pour déclarer qu'une variable a un type, comme `str` mais qu'il est "optionnel" signifiant qu'il pourrait aussi être `None`. + +```Python hl_lines="1 4" +{!../../../docs_src/python_types/tutorial009.py!} +``` + +Utiliser `Optional[str]` plutôt que `str` permettra à l'éditeur de vous aider à détecter les erreurs où vous supposeriez qu'une valeur est toujours de type `str`, alors qu'elle pourrait aussi être `None`. + +#### Types génériques + +Les types qui peuvent contenir des paramètres de types entre crochets, comme : + +* `List` +* `Tuple` +* `Set` +* `Dict` +* `Optional` +* ...et d'autres. + +sont appelés des **types génériques** ou **Generics**. + +### Classes en tant que types + +Vous pouvez aussi déclarer une classe comme type d'une variable. + +Disons que vous avez une classe `Person`, avec une variable `name` : + +```Python hl_lines="1-3" +{!../../../docs_src/python_types/tutorial010.py!} +``` + +Vous pouvez ensuite déclarer une variable de type `Person` : + +```Python hl_lines="6" +{!../../../docs_src/python_types/tutorial010.py!} +``` + +Et vous aurez accès, encore une fois, au support complet offert par l'éditeur : + + + +## Les modèles Pydantic + +Pydantic est une bibliothèque Python pour effectuer de la validation de données. + +Vous déclarez la forme de la donnée avec des classes et des attributs. + +Chaque attribut possède un type. + +Puis vous créez une instance de cette classe avec certaines valeurs et **Pydantic** validera les valeurs, les convertira dans le type adéquat (si c'est nécessaire et possible) et vous donnera un objet avec toute la donnée. + +Ainsi, votre éditeur vous offrira un support adapté pour l'objet résultant. + +Extrait de la documentation officielle de **Pydantic** : + +```Python +{!../../../docs_src/python_types/tutorial011.py!} +``` + +!!! info + Pour en savoir plus à propos de Pydantic, allez jeter un coup d'oeil à sa documentation. + +**FastAPI** est basé entièrement sur **Pydantic**. + +Vous verrez bien plus d'exemples de son utilisation dans [Tutoriel - Guide utilisateur](tutorial/index.md){.internal-link target=_blank}. + +## Les annotations de type dans **FastAPI** + +**FastAPI** utilise ces annotations pour faire différentes choses. + +Avec **FastAPI**, vous déclarez des paramètres grâce aux annotations de types et vous obtenez : + +* **du support de l'éditeur** +* **de la vérification de types** + +...et **FastAPI** utilise ces mêmes déclarations pour : + +* **Définir les prérequis** : depuis les paramètres de chemins des requêtes, les entêtes, les corps, les dépendances, etc. +* **Convertir des données** : depuis la requête vers les types requis. +* **Valider des données** : venant de chaque requête : + * Générant automatiquement des **erreurs** renvoyées au client quand la donnée est invalide. +* **Documenter** l'API avec OpenAPI : + * ce qui ensuite utilisé par les interfaces utilisateur automatiques de documentation interactive. + +Tout cela peut paraître bien abstrait, mais ne vous inquiétez pas, vous verrez tout ça en pratique dans [Tutoriel - Guide utilisateur](tutorial/index.md){.internal-link target=_blank}. + +Ce qu'il faut retenir c'est qu'en utilisant les types standard de Python, à un seul endroit (plutôt que d'ajouter plus de classes, de décorateurs, etc.), **FastAPI** fera une grande partie du travail pour vous. + +!!! info + Si vous avez déjà lu le tutoriel et êtes revenus ici pour voir plus sur les types, une bonne ressource est la "cheat sheet" de `mypy`. diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml index c0bbb2ac..adb2ccc6 100644 --- a/docs/fr/mkdocs.yml +++ b/docs/fr/mkdocs.yml @@ -53,6 +53,7 @@ nav: - zh: /zh/ - features.md - fastapi-people.md +- python-types.md - Tutoriel - Guide utilisateur: - tutorial/background-tasks.md - alternatives.md From fdc7c96ecea669ebe3c2f60445f08b452cf923b4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:14:28 +0000 Subject: [PATCH 31/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index e312fb31..dea29373 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add French translation for Python Types Intro. PR [#3185](https://github.com/tiangolo/fastapi/pull/3185) by [@Smlep](https://github.com/Smlep). * 🌐 Add French translation for External Links. PR [#3103](https://github.com/tiangolo/fastapi/pull/3103) by [@Smlep](https://github.com/Smlep). * 🌐 Add French translation for Alternatives, Inspiration and Comparisons. PR [#3020](https://github.com/tiangolo/fastapi/pull/3020) by [@rjNemo](https://github.com/rjNemo). * 🌐 Fix Chinese translation code snippet mismatch in Tutorial - Python Types Intro. PR [#2573](https://github.com/tiangolo/fastapi/pull/2573) by [@BoYanZh](https://github.com/BoYanZh). From 4473a9bcbf38e70321536b4ca7b71e45299ddcc2 Mon Sep 17 00:00:00 2001 From: Sam Courtemanche Date: Fri, 2 Jul 2021 16:18:06 +0200 Subject: [PATCH 32/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20French=20translation?= =?UTF-8?q?=20for=20Project=20Generation=20(#3197)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/fr/docs/project-generation.md | 84 ++++++++++++++++++++++++++++++ docs/fr/mkdocs.yml | 1 + 2 files changed, 85 insertions(+) create mode 100644 docs/fr/docs/project-generation.md diff --git a/docs/fr/docs/project-generation.md b/docs/fr/docs/project-generation.md new file mode 100644 index 00000000..c58d2cd2 --- /dev/null +++ b/docs/fr/docs/project-generation.md @@ -0,0 +1,84 @@ +# Génération de projets - Modèle + +Vous pouvez utiliser un générateur de projet pour commencer, qui réalisera pour vous la mise en place de bases côté architecture globale, sécurité, base de données et premières routes d'API. + +Un générateur de projet fera toujours une mise en place très subjective que vous devriez modifier et adapter suivant vos besoins, mais cela reste un bon point de départ pour vos projets. + +## Full Stack FastAPI PostgreSQL + +GitHub : https://github.com/tiangolo/full-stack-fastapi-postgresql + +### Full Stack FastAPI PostgreSQL - Fonctionnalités + +* Intégration **Docker** complète (basée sur Docker). +* Déploiement Docker en mode Swarm +* Intégration **Docker Compose** et optimisation pour développement local. +* Serveur web Python **prêt au déploiement** utilisant Uvicorn et Gunicorn. +* Backend Python **FastAPI** : + * **Rapide** : Très hautes performances, comparables à **NodeJS** ou **Go** (grâce à Starlette et Pydantic). + * **Intuitif** : Excellent support des éditeurs. Complétion partout. Moins de temps passé à déboguer. + * **Facile** : Fait pour être facile à utiliser et apprendre. Moins de temps passé à lire de la documentation. + * **Concis** : Minimise la duplication de code. Plusieurs fonctionnalités à chaque déclaration de paramètre. + * **Robuste** : Obtenez du code prêt pour être utilisé en production. Avec de la documentation automatique interactive. + * **Basé sur des normes** : Basé sur (et totalement compatible avec) les normes ouvertes pour les APIs : OpenAPI et JSON Schema. + * **Et bien d'autres fonctionnalités** comme la validation automatique, la sérialisation, l'authentification avec OAuth2 JWT tokens, etc. +* Hashage de **mots de passe sécurisé** par défaut. +* Authentification par **jetons JWT**. +* Modèles **SQLAlchemy** (indépendants des extensions Flask, afin qu'ils puissent être utilisés directement avec des *workers* Celery). +* Modèle de démarrages basiques pour les utilisateurs (à modifier et supprimer au besoin). +* Migrations **Alembic**. +* **CORS** (partage des ressources entre origines multiples, ou *Cross Origin Resource Sharing*). +* *Worker* **Celery** pouvant importer et utiliser les modèles et le code du reste du backend. +* Tests du backend REST basés sur **Pytest**, intégrés dans Docker, pour que vous puissiez tester toutes les interactions de l'API indépendamment de la base de données. Étant exécutés dans Docker, les tests peuvent utiliser un nouvel entrepôt de données créé de zéro à chaque fois (vous pouvez donc utiliser ElasticSearch, MongoDB, CouchDB, etc. et juste tester que l'API fonctionne). +* Intégration Python facile avec **Jupyter Kernels** pour le développement à distance ou intra-Docker avec des extensions comme Atom Hydrogen ou Visual Studio Code Jupyter. +* Frontend **Vue** : + * Généré avec Vue CLI. + * Gestion de l'**Authentification JWT**. + * Page de connexion. + * Après la connexion, page de tableau de bord principal. + * Tableau de bord principal avec création et modification d'utilisateurs. + * Modification de ses propres caractéristiques utilisateur. + * **Vuex**. + * **Vue-router**. + * **Vuetify** pour de magnifiques composants *material design*. + * **TypeScript**. + * Serveur Docker basé sur **Nginx** (configuré pour être facilement manipulé avec Vue-router). + * Utilisation de *Docker multi-stage building*, pour ne pas avoir besoin de sauvegarder ou *commit* du code compilé. + * Tests frontend exécutés à la compilation (pouvant être désactivés). + * Fait aussi modulable que possible, pour pouvoir fonctionner comme tel, tout en pouvant être utilisé qu'en partie grâce à Vue CLI. +* **PGAdmin** pour les bases de données PostgreSQL, facilement modifiable pour utiliser PHPMYAdmin ou MySQL. +* **Flower** pour la surveillance de tâches Celery. +* Équilibrage de charge entre le frontend et le backend avec **Traefik**, afin de pouvoir avoir les deux sur le même domaine, séparés par chemins, mais servis par différents conteneurs. +* Intégration Traefik, comprenant la génération automatique de certificat **HTTPS** Let's Encrypt. +* GitLab **CI** (intégration continue), comprenant des tests pour le frontend et le backend. + +## Full Stack FastAPI Couchbase + +GitHub : https://github.com/tiangolo/full-stack-fastapi-couchbase + +⚠️ **ATTENTION** ⚠️ + +Si vous démarrez un nouveau projet de zéro, allez voir les alternatives au début de cette page. + +Par exemple, le générateur de projet Full Stack FastAPI PostgreSQL peut être une meilleure alternative, étant activement maintenu et utilisé et comprenant toutes les nouvelles fonctionnalités et améliorations. + +Vous êtes toujours libre d'utiliser le générateur basé sur Couchbase si vous le voulez, cela devrait probablement fonctionner correctement, et si vous avez déjà un projet généré en utilisant ce dernier, cela devrait fonctionner aussi (et vous l'avez déjà probablement mis à jour suivant vos besoins). + +Vous pouvez en apprendre plus dans la documentation du dépôt GithHub. + +## Full Stack FastAPI MongoDB + +...viendra surement plus tard, suivant le temps que j'ai. 😅 🎉 + +## Modèles d'apprentissage automatique avec spaCy et FastAPI + +GitHub : https://github.com/microsoft/cookiecutter-spacy-fastapi + +## Modèles d'apprentissage automatique avec spaCy et FastAPI - Fonctionnalités + +* Intégration d'un modèle NER **spaCy**. +* Formatage de requête pour **Azure Cognitive Search**. +* Serveur Python web **prêt à utiliser en production** utilisant Uvicorn et Gunicorn. +* Déploiement CI/CD Kubernetes pour **Azure DevOps** (AKS). +* **Multilangues**. Choisissez facilement l'une des langues intégrées à spaCy durant la mise en place du projet. +* **Facilement généralisable** à d'autres bibliothèques similaires (Pytorch, Tensorflow), et non juste spaCy. diff --git a/docs/fr/mkdocs.yml b/docs/fr/mkdocs.yml index adb2ccc6..250af172 100644 --- a/docs/fr/mkdocs.yml +++ b/docs/fr/mkdocs.yml @@ -56,6 +56,7 @@ nav: - python-types.md - Tutoriel - Guide utilisateur: - tutorial/background-tasks.md +- project-generation.md - alternatives.md - external-links.md markdown_extensions: From eb6f964ede1753a1cba475d0e2c014601fe5ea9d Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:18:44 +0000 Subject: [PATCH 33/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index dea29373..d541a6c2 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add French translation for Project Generation. PR [#3197](https://github.com/tiangolo/fastapi/pull/3197) by [@Smlep](https://github.com/Smlep). * 🌐 Add French translation for Python Types Intro. PR [#3185](https://github.com/tiangolo/fastapi/pull/3185) by [@Smlep](https://github.com/Smlep). * 🌐 Add French translation for External Links. PR [#3103](https://github.com/tiangolo/fastapi/pull/3103) by [@Smlep](https://github.com/Smlep). * 🌐 Add French translation for Alternatives, Inspiration and Comparisons. PR [#3020](https://github.com/tiangolo/fastapi/pull/3020) by [@rjNemo](https://github.com/rjNemo). From 4bf9a520437a505c0ac68e73815bd0ce88a0f8bc Mon Sep 17 00:00:00 2001 From: Hareru <52149629+hareru@users.noreply.github.com> Date: Fri, 2 Jul 2021 22:20:36 +0800 Subject: [PATCH 34/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translatio?= =?UTF-8?q?n=20for=20FastAPI=20People=20(#3112)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Xie Wei Co-authored-by: Sebastián Ramírez --- docs/zh/docs/fastapi-people.md | 165 +++++++++++++++++++++++++++++++++ docs/zh/mkdocs.yml | 1 + 2 files changed, 166 insertions(+) create mode 100644 docs/zh/docs/fastapi-people.md diff --git a/docs/zh/docs/fastapi-people.md b/docs/zh/docs/fastapi-people.md new file mode 100644 index 00000000..080af2ee --- /dev/null +++ b/docs/zh/docs/fastapi-people.md @@ -0,0 +1,165 @@ +# FastAPI 社区 + +FastAPI 有一个非常棒的社区,它欢迎来自各个领域和背景的朋友。 + +## 创建者 & 维护者 + +嘿! 👋 + +这就是我: + +{% if people %} +
+{% for user in people.maintainers %} + +
@{{ user.login }}
Answers: {{ user.answers }}
Pull Requests: {{ user.prs }}
+{% endfor %} + +
+{% endif %} + +我是 **FastAPI** 的创建者和维护者. 你能在 [帮助 FastAPI - 获取帮助 - 与作者联系](help-fastapi.md#connect-with-the-author){.internal-link target=_blank} 阅读有关此内容的更多信息。 + +...但是在这里我想向您展示社区。 + +--- + +**FastAPI** 得到了社区的大力支持。因此我想突出他们的贡献。 + +这些人: + +* [帮助他人解决 GitHub 的 issues](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}。 +* [创建 Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}。 +* 审核 Pull Requests, 对于 [翻译](contributing.md#translations){.internal-link target=_blank} 尤为重要。 + +向他们致以掌声。 👏 🙇 + +## 上个月最活跃的用户 + +上个月这些用户致力于 [帮助他人解决 GitHub 的 issues](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}。 + +{% if people %} +
+{% for user in people.last_month_active %} + +
@{{ user.login }}
Issues replied: {{ user.count }}
+{% endfor %} + +
+{% endif %} + +## 专家组 + +以下是 **FastAPI 专家**。 🤓 + +这些用户一直以来致力于 [帮助他人解决 GitHub 的 issues](help-fastapi.md#help-others-with-issues-in-github){.internal-link target=_blank}。 + +他们通过帮助许多人而被证明是专家。✨ + +{% if people %} +
+{% for user in people.experts %} + +
@{{ user.login }}
Issues replied: {{ user.count }}
+{% endfor %} + +
+{% endif %} + +## 杰出贡献者 + +以下是 **杰出的贡献者**。 👷 + +这些用户 [创建了最多已被合并的 Pull Requests](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}。 + +他们贡献了源代码,文档,翻译等。 📦 + +{% if people %} +
+{% for user in people.top_contributors %} + +
@{{ user.login }}
Pull Requests: {{ user.count }}
+{% endfor %} + +
+{% endif %} + +还有很多其他贡献者(超过100个),你可以在 FastAPI GitHub 贡献者页面 中看到他们。👷 + +## 杰出审核者 + +以下用户是「杰出的评审者」。 🕵️ + +### 翻译审核 + +我只会说少数几种语言(而且还不是很流利 😅)。所以,具备[能力去批准文档翻译](contributing.md#translations){.internal-link target=_blank} 是这些评审者们。如果没有它们,就不会有多语言文档。 + +--- + +**杰出的评审者** 🕵️ 评审了最多来自他人的 Pull Requests,他们保证了代码、文档尤其是 **翻译** 的质量。 + +{% if people %} +
+{% for user in people.top_reviewers %} + +
@{{ user.login }}
Reviews: {{ user.count }}
+{% endfor %} + +
+{% endif %} + +## 赞助商 + +以下是 **赞助商** 。😎 + +他们主要通过GitHub Sponsors支持我在 **FastAPI** (和其他项目)的工作。 + +### 金牌赞助商 + +{% if sponsors %} {% for sponsor in sponsors.gold -%} + +{% endfor %} {% endif %} + +### 银牌赞助商 + +{% if sponsors %} {% for sponsor in sponsors.silver -%} + +{% endfor %} {% endif %} + +{% if people %} {% if people.sponsors_50 %} + +### 铜牌赞助商 + +
+{% for user in people.sponsors_50 %} + + +{% endfor %} + +
+ +{% endif %} {% endif %} + +### 个人赞助 + +{% if people %} +
+{% for user in people.sponsors %} + + +{% endfor %} + +
+{% endif %} + +## 关于数据 - 技术细节 + +该页面的目的是突出社区为帮助他人而付出的努力。 + +尤其是那些不引人注目且涉及更困难的任务,例如帮助他人解决问题或者评审翻译 Pull Requests。 + +该数据每月计算一次,您可以阅读 源代码。 + +这里也强调了赞助商的贡献。 + +我也保留更新算法,栏目,统计阈值等的权利(以防万一🤷)。 diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index 8551e644..cdcb6ea4 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -52,6 +52,7 @@ nav: - uk: /uk/ - zh: /zh/ - features.md +- fastapi-people.md - python-types.md - 教程 - 用户指南: - tutorial/index.md From 098088c76342f163667a62cad0626fef3998150f Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:21:11 +0000 Subject: [PATCH 35/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index d541a6c2..814fbf55 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add Chinese translation for FastAPI People. PR [#3112](https://github.com/tiangolo/fastapi/pull/3112) by [@hareru](https://github.com/hareru). * 🌐 Add French translation for Project Generation. PR [#3197](https://github.com/tiangolo/fastapi/pull/3197) by [@Smlep](https://github.com/Smlep). * 🌐 Add French translation for Python Types Intro. PR [#3185](https://github.com/tiangolo/fastapi/pull/3185) by [@Smlep](https://github.com/Smlep). * 🌐 Add French translation for External Links. PR [#3103](https://github.com/tiangolo/fastapi/pull/3103) by [@Smlep](https://github.com/Smlep). From e6836781d5178c021e5e01127aa893c190af132a Mon Sep 17 00:00:00 2001 From: jaystone776 <1732865113@qq.com> Date: Fri, 2 Jul 2021 22:23:41 +0800 Subject: [PATCH 36/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translatio?= =?UTF-8?q?n=20for=20Tutorial=20-=20Body=20-=20Updates=20(#3237)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Xie Wei Co-authored-by: Sebastián Ramírez --- docs/zh/docs/tutorial/body-updates.md | 101 ++++++++++++++++++++++++++ docs/zh/mkdocs.yml | 1 + 2 files changed, 102 insertions(+) create mode 100644 docs/zh/docs/tutorial/body-updates.md diff --git a/docs/zh/docs/tutorial/body-updates.md b/docs/zh/docs/tutorial/body-updates.md new file mode 100644 index 00000000..176bb174 --- /dev/null +++ b/docs/zh/docs/tutorial/body-updates.md @@ -0,0 +1,101 @@ +# 请求体 - 更新数据 + +## 用 `PUT` 更新数据 + +更新数据请用 HTTP `PUT` 操作。 + +把输入数据转换为以 JSON 格式存储的数据(比如,使用 NoSQL 数据库时),可以使用 `jsonable_encoder`。例如,把 `datetime` 转换为 `str`。 + +```Python hl_lines="30-35" +{!../../../docs_src/body_updates/tutorial001.py!} +``` + +`PUT` 用于接收替换现有数据的数据。 + +### 关于更新数据的警告 + +用 `PUT` 把数据项 `bar` 更新为以下内容时: + +```Python +{ + "name": "Barz", + "price": 3, + "description": None, +} +``` + +因为上述数据未包含已存储的属性 `"tax": 20.2`,新的输入模型会把 `"tax": 10.5` 作为默认值。 + +因此,本次操作把 `tax` 的值「更新」为 `10.5`。 + +## 用 `PATCH` 进行部分更新 + +HTTP `PATCH` 操作用于更新 *部分* 数据。 + +即,只发送要更新的数据,其余数据保持不变。 + +!!! Note "笔记" + + `PATCH` 没有 `PUT` 知名,也怎么不常用。 + + 很多人甚至只用 `PUT` 实现部分更新。 + + **FastAPI** 对此没有任何限制,可以**随意**互换使用这两种操作。 + + 但本指南也会分别介绍这两种操作各自的用途。 + +### 使用 Pydantic 的 `exclude_unset` 参数 + +更新部分数据时,可以在 Pydantic 模型的 `.dict()` 中使用 `exclude_unset` 参数。 + +比如,`item.dict(exclude_unset=True)`。 + +这段代码生成的 `dict` 只包含创建 `item` 模型时显式设置的数据,而不包括默认值。 + +然后再用它生成一个只含已设置(在请求中所发送)数据,且省略了默认值的 `dict`: + +```Python hl_lines="34" +{!../../../docs_src/body_updates/tutorial002.py!} +``` + +### 使用 Pydantic 的 `update` 参数 + +接下来,用 `.copy()` 为已有模型创建调用 `update` 参数的副本,该参数为包含更新数据的 `dict`。 + +例如,`stored_item_model.copy(update=update_data)`: + +```Python hl_lines="35" +{!../../../docs_src/body_updates/tutorial002.py!} +``` + +### 更新部分数据小结 + +简而言之,更新部分数据应: + +* 使用 `PATCH` 而不是 `PUT` (可选,也可以用 `PUT`); +* 提取存储的数据; +* 把数据放入 Pydantic 模型; +* 生成不含输入模型默认值的 `dict` (使用 `exclude_unset` 参数); + * 只更新用户设置过的值,不用模型中的默认值覆盖已存储过的值。 +* 为已存储的模型创建副本,用接收的数据更新其属性 (使用 `update` 参数)。 +* 把模型副本转换为可存入数据库的形式(比如,使用 `jsonable_encoder`)。 + * 这种方式与 Pydantic 模型的 `.dict()` 方法类似,但能确保把值转换为适配 JSON 的数据类型,例如, 把 `datetime` 转换为 `str` 。 +* 把数据保存至数据库; +* 返回更新后的模型。 + +```Python hl_lines="30-37" +{!../../../docs_src/body_updates/tutorial002.py!} +``` + +!!! tip "提示" + + 实际上,HTTP `PUT` 也可以完成相同的操作。 + 但本节以 `PATCH` 为例的原因是,该操作就是为了这种用例创建的。 + +!!! note "笔记" + + 注意,输入模型仍需验证。 + + 因此,如果希望接收的部分更新数据可以省略其他所有属性,则要把模型中所有的属性标记为可选(使用默认值或 `None`)。 + + 为了区分用于**更新**所有可选值的模型与用于**创建**包含必选值的模型,请参照[更多模型](extra-models.md){.internal-link target=_blank} 一节中的思路。 diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index cdcb6ea4..f63f341f 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -74,6 +74,7 @@ nav: - tutorial/extra-data-types.md - tutorial/cookie-params.md - tutorial/request-files.md + - tutorial/body-updates.md - 安全性: - tutorial/security/index.md - tutorial/security/get-current-user.md From 8116d8158b48bd3316295cb949d9b02820a0d9c4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:24:16 +0000 Subject: [PATCH 37/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 814fbf55..1120adf9 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add Chinese translation for Tutorial - Body - Updates. PR [#3237](https://github.com/tiangolo/fastapi/pull/3237) by [@jaystone776](https://github.com/jaystone776). * 🌐 Add Chinese translation for FastAPI People. PR [#3112](https://github.com/tiangolo/fastapi/pull/3112) by [@hareru](https://github.com/hareru). * 🌐 Add French translation for Project Generation. PR [#3197](https://github.com/tiangolo/fastapi/pull/3197) by [@Smlep](https://github.com/Smlep). * 🌐 Add French translation for Python Types Intro. PR [#3185](https://github.com/tiangolo/fastapi/pull/3185) by [@Smlep](https://github.com/Smlep). From 5e2f2d541dd78106652094e0dac0d6810fa73823 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 16:27:02 +0200 Subject: [PATCH 38/50] =?UTF-8?q?=F0=9F=91=A5=20Update=20FastAPI=20People?= =?UTF-8?q?=20(#3319)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions --- docs/en/data/people.yml | 200 +++++++++++++++++++++++++++------------- 1 file changed, 135 insertions(+), 65 deletions(-) diff --git a/docs/en/data/people.yml b/docs/en/data/people.yml index fc5ed85f..d1898a93 100644 --- a/docs/en/data/people.yml +++ b/docs/en/data/people.yml @@ -1,7 +1,7 @@ maintainers: - login: tiangolo - answers: 1221 - prs: 222 + answers: 1225 + prs: 230 avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=05f95ca7fdead36edd9c86be46b4ef6c3c71f876&v=4 url: https://github.com/tiangolo experts: @@ -10,15 +10,15 @@ experts: avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=58ed2a45798a4339700e2f62b2e12e6e54bf0396&v=4 url: https://github.com/dmontagu - login: Kludex - count: 240 + count: 254 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=cf8455cb899806b774a3a71073f88583adec99f6&v=4 url: https://github.com/Kludex - login: ycd - count: 211 + count: 214 avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=826f228edf0bab0d19ad1d5c4ba4df1047ccffef&v=4 url: https://github.com/ycd - login: Mause - count: 174 + count: 176 avatarUrl: https://avatars.githubusercontent.com/u/1405026?v=4 url: https://github.com/Mause - login: euri10 @@ -29,20 +29,20 @@ experts: count: 130 avatarUrl: https://avatars.githubusercontent.com/u/331403?v=4 url: https://github.com/phy25 +- login: ArcLightSlavik + count: 58 + avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 + url: https://github.com/ArcLightSlavik - login: falkben count: 56 avatarUrl: https://avatars.githubusercontent.com/u/653031?u=0c8d8f33d87f1aa1a6488d3f02105e9abc838105&v=4 url: https://github.com/falkben -- login: ArcLightSlavik - count: 50 - avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=6e53b1a2f340d77429d435babcec107c7cc50972&v=4 - url: https://github.com/ArcLightSlavik - login: sm-Fifteen count: 46 avatarUrl: https://avatars.githubusercontent.com/u/516999?u=437c0c5038558c67e887ccd863c1ba0f846c03da&v=4 url: https://github.com/sm-Fifteen - login: raphaelauv - count: 41 + count: 44 avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4 url: https://github.com/raphaelauv - login: includeamin @@ -54,7 +54,7 @@ experts: avatarUrl: https://avatars.githubusercontent.com/u/28061158?u=72309cc1f2e04e40fa38b29969cb4e9d3f722e7b&v=4 url: https://github.com/prostomarkeloff - login: Dustyposa - count: 31 + count: 32 avatarUrl: https://avatars.githubusercontent.com/u/27180793?u=5cf2877f50b3eb2bc55086089a78a36f07042889&v=4 url: https://github.com/Dustyposa - login: krishnardt @@ -89,10 +89,18 @@ experts: count: 21 avatarUrl: https://avatars.githubusercontent.com/u/565544?v=4 url: https://github.com/chris-allnutt +- login: chbndrhnns + count: 20 + avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4 + url: https://github.com/chbndrhnns - login: retnikt count: 19 avatarUrl: https://avatars.githubusercontent.com/u/24581770?v=4 url: https://github.com/retnikt +- login: Hultner + count: 18 + avatarUrl: https://avatars.githubusercontent.com/u/2669034?u=115e53df959309898ad8dc9443fbb35fee71df07&v=4 + url: https://github.com/Hultner - login: jorgerpo count: 17 avatarUrl: https://avatars.githubusercontent.com/u/12537771?u=7444d20019198e34911082780cc7ad73f2b97cb3&v=4 @@ -101,12 +109,8 @@ experts: count: 17 avatarUrl: https://avatars.githubusercontent.com/u/28262306?u=66ee21316275ef356081c2efc4ed7a4572e690dc&v=4 url: https://github.com/nkhitrov -- login: chbndrhnns - count: 15 - avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4 - url: https://github.com/chbndrhnns - login: waynerv - count: 14 + count: 15 avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4 url: https://github.com/waynerv - login: haizaar @@ -114,7 +118,7 @@ experts: avatarUrl: https://avatars.githubusercontent.com/u/58201?u=4f1f9843d69433ca0d380d95146cfe119e5fdac4&v=4 url: https://github.com/haizaar - login: frankie567 - count: 11 + count: 12 avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=72adf1cb1d29787305c99700d669561952cea0af&v=4 url: https://github.com/frankie567 - login: zamiramir @@ -138,26 +142,50 @@ experts: avatarUrl: https://avatars.githubusercontent.com/u/20441825?u=ee1e59446b98f8ec2363caeda4c17164d0d9cc7d&v=4 url: https://github.com/stefanondisponibile last_month_active: +- login: Hultner + count: 15 + avatarUrl: https://avatars.githubusercontent.com/u/2669034?u=115e53df959309898ad8dc9443fbb35fee71df07&v=4 + url: https://github.com/Hultner - login: Kludex count: 13 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=cf8455cb899806b774a3a71073f88583adec99f6&v=4 url: https://github.com/Kludex -- login: ycd - count: 7 - avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=826f228edf0bab0d19ad1d5c4ba4df1047ccffef&v=4 - url: https://github.com/ycd +- login: ArcLightSlavik + count: 8 + avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 + url: https://github.com/ArcLightSlavik - login: raphaelauv - count: 6 + count: 4 avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4 url: https://github.com/raphaelauv -- login: frankie567 - count: 5 - avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=72adf1cb1d29787305c99700d669561952cea0af&v=4 - url: https://github.com/frankie567 -- login: insomnes +- login: chbndrhnns count: 4 - avatarUrl: https://avatars.githubusercontent.com/u/16958893?u=f8be7088d5076d963984a21f95f44e559192d912&v=4 - url: https://github.com/insomnes + avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4 + url: https://github.com/chbndrhnns +- login: dstlny + count: 4 + avatarUrl: https://avatars.githubusercontent.com/u/41964673?u=ed9c60d8ab5b4fea71640cdbccf0f83bdd6c43cb&v=4 + url: https://github.com/dstlny +- login: Mause + count: 3 + avatarUrl: https://avatars.githubusercontent.com/u/1405026?v=4 + url: https://github.com/Mause +- login: waynerv + count: 3 + avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4 + url: https://github.com/waynerv +- login: panla + count: 3 + avatarUrl: https://avatars.githubusercontent.com/u/41326348?v=4 + url: https://github.com/panla +- login: ricky-sb + count: 3 + avatarUrl: https://avatars.githubusercontent.com/u/10700079?v=4 + url: https://github.com/ricky-sb +- login: ycd + count: 3 + avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=826f228edf0bab0d19ad1d5c4ba4df1047ccffef&v=4 + url: https://github.com/ycd top_contributors: - login: waynerv count: 25 @@ -220,20 +248,20 @@ top_reviewers: count: 44 avatarUrl: https://avatars.githubusercontent.com/u/41147016?u=55010621aece725aa702270b54fed829b6a1fe60&v=4 url: https://github.com/tokusumi -- login: ycd - count: 39 - avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=826f228edf0bab0d19ad1d5c4ba4df1047ccffef&v=4 - url: https://github.com/ycd - login: Laineyzhang55 - count: 34 + count: 42 avatarUrl: https://avatars.githubusercontent.com/u/59285379?v=4 url: https://github.com/Laineyzhang55 +- login: ycd + count: 40 + avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=826f228edf0bab0d19ad1d5c4ba4df1047ccffef&v=4 + url: https://github.com/ycd - login: waynerv - count: 32 + count: 38 avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4 url: https://github.com/waynerv - login: AdrianDeAnda - count: 26 + count: 28 avatarUrl: https://avatars.githubusercontent.com/u/1024932?u=bb7f8a0d6c9de4e9d0320a9f271210206e202250&v=4 url: https://github.com/AdrianDeAnda - login: dmontagu @@ -252,6 +280,10 @@ top_reviewers: count: 16 avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4 url: https://github.com/SwftAlpc +- login: ArcLightSlavik + count: 16 + avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 + url: https://github.com/ArcLightSlavik - login: pedabraham count: 15 avatarUrl: https://avatars.githubusercontent.com/u/16860088?u=abf922a7b920bf8fdb7867d8b43e091f1e796178&v=4 @@ -268,10 +300,6 @@ top_reviewers: count: 12 avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=706e1ee3f248245f2d68b976d149d06fd5a2010d&v=4 url: https://github.com/RunningIkkyu -- login: ArcLightSlavik - count: 12 - avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=6e53b1a2f340d77429d435babcec107c7cc50972&v=4 - url: https://github.com/ArcLightSlavik - login: hard-coders count: 12 avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=f2d3d2038c55d86d7f9348f4e6c5e30191e4ee8b&v=4 @@ -296,6 +324,10 @@ top_reviewers: count: 9 avatarUrl: https://avatars.githubusercontent.com/u/13096845?u=646eba44db720e37d0dbe8e98e77ab534ea78a20&v=4 url: https://github.com/PandaHun +- login: bezaca + count: 9 + avatarUrl: https://avatars.githubusercontent.com/u/69092910?u=4ac58eab99bd37d663f3d23551df96d4fbdbf760&v=4 + url: https://github.com/bezaca - login: rjNemo count: 8 avatarUrl: https://avatars.githubusercontent.com/u/56785022?u=d5c3a02567c8649e146fcfc51b6060ccaf8adef8&v=4 @@ -316,14 +348,18 @@ top_reviewers: count: 7 avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4 url: https://github.com/raphaelauv +- login: NastasiaSaby + count: 7 + avatarUrl: https://avatars.githubusercontent.com/u/8245071?u=b3afd005f9e4bf080c219ef61a592b3a8004b764&v=4 + url: https://github.com/NastasiaSaby +- login: Smlep + count: 7 + avatarUrl: https://avatars.githubusercontent.com/u/16785985?v=4 + url: https://github.com/Smlep - login: jovicon count: 6 avatarUrl: https://avatars.githubusercontent.com/u/21287303?u=b049eac3e51a4c0473c2efe66b4d28a7d8f2b572&v=4 url: https://github.com/jovicon -- login: NastasiaSaby - count: 6 - avatarUrl: https://avatars.githubusercontent.com/u/8245071?u=b3afd005f9e4bf080c219ef61a592b3a8004b764&v=4 - url: https://github.com/NastasiaSaby - login: nimctl count: 5 avatarUrl: https://avatars.githubusercontent.com/u/49960770?u=e39b11d47188744ee07b2a1c7ce1a1bdf3c80760&v=4 @@ -340,6 +376,10 @@ top_reviewers: count: 5 avatarUrl: https://avatars.githubusercontent.com/u/63564282?u=0078826509dbecb2fdb543f4e881c9cd06157893&v=4 url: https://github.com/SnkSynthesis +- login: anthonycepeda + count: 5 + avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=892f700c79f9732211bd5221bf16eec32356a732&v=4 + url: https://github.com/anthonycepeda - login: euri10 count: 4 avatarUrl: https://avatars.githubusercontent.com/u/1104190?u=321a2e953e6645a7d09b732786c7a8061e0f8a8b&v=4 @@ -370,15 +410,12 @@ sponsors: - login: grillazz avatarUrl: https://avatars.githubusercontent.com/u/3415861?u=16d7d0ffa5dfb99f8834f8f76d90e138ba09b94a&v=4 url: https://github.com/grillazz -- login: CarlosDomingues - avatarUrl: https://avatars.githubusercontent.com/u/11181378?u=4c15832fa030a5f3fd024ca4912093b4b59a40bd&v=4 - url: https://github.com/CarlosDomingues - login: jmaralc avatarUrl: https://avatars.githubusercontent.com/u/21101214?u=b15a9f07b7cbf6c9dcdbcb6550bbd2c52f55aa50&v=4 url: https://github.com/jmaralc -- login: lucone83 - avatarUrl: https://avatars.githubusercontent.com/u/2812607?u=49c0c4454d4c98eacdcac0e33c1d83dc6fe5a37f&v=4 - url: https://github.com/lucone83 +- login: psgandalf + avatarUrl: https://avatars.githubusercontent.com/u/8134158?v=4 + url: https://github.com/psgandalf - login: samuelcolvin avatarUrl: https://avatars.githubusercontent.com/u/4039449?u=807390ba9cfe23906c3bf8a0d56aaca3cf2bfa0d&v=4 url: https://github.com/samuelcolvin @@ -395,7 +432,7 @@ sponsors: avatarUrl: https://avatars.githubusercontent.com/u/653031?u=0c8d8f33d87f1aa1a6488d3f02105e9abc838105&v=4 url: https://github.com/falkben - login: Mazyod - avatarUrl: https://avatars.githubusercontent.com/u/860511?u=a76c978bdf91c2b332ab8769935fa415d0a8091b&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/860511?v=4 url: https://github.com/Mazyod - login: ltieman avatarUrl: https://avatars.githubusercontent.com/u/1084689?u=e69b17de17cb3ca141a17daa7ccbe173ceb1eb17&v=4 @@ -430,15 +467,15 @@ sponsors: - login: dudil avatarUrl: https://avatars.githubusercontent.com/u/4785835?u=58b7ea39123e0507f3b2996448a27256b16fd697&v=4 url: https://github.com/dudil -- login: p141592 - avatarUrl: https://avatars.githubusercontent.com/u/5256328?u=07bc6374282ab3d08511afebaa5d511987d034f1&v=4 - url: https://github.com/p141592 - login: ennui93 avatarUrl: https://avatars.githubusercontent.com/u/5300907?u=5b5452725ddb391b2caaebf34e05aba873591c3a&v=4 url: https://github.com/ennui93 - login: sco1 avatarUrl: https://avatars.githubusercontent.com/u/5323929?u=2b8434060d0c9d93de80a2a945baed94a412c31e&v=4 url: https://github.com/sco1 +- login: MacroPower + avatarUrl: https://avatars.githubusercontent.com/u/5648814?u=b2730000c9f9a471282b9849d2cc85711d7973d4&v=4 + url: https://github.com/MacroPower - login: ginomempin avatarUrl: https://avatars.githubusercontent.com/u/6091865?v=4 url: https://github.com/ginomempin @@ -508,6 +545,9 @@ sponsors: - login: daddycocoaman avatarUrl: https://avatars.githubusercontent.com/u/21189155?u=756f6a17c71c538b11470f70839baacab43807ef&v=4 url: https://github.com/daddycocoaman +- login: Filimoa + avatarUrl: https://avatars.githubusercontent.com/u/21352040?u=75e02d102d2ee3e3d793e555fa5c63045913ccb0&v=4 + url: https://github.com/Filimoa - login: raminsj13 avatarUrl: https://avatars.githubusercontent.com/u/24259406?u=d51f2a526312ebba150a06936ed187ca0727d329&v=4 url: https://github.com/raminsj13 @@ -520,9 +560,6 @@ sponsors: - login: orihomie avatarUrl: https://avatars.githubusercontent.com/u/29889683?u=6bc2135a52fcb3a49e69e7d50190796618185fda&v=4 url: https://github.com/orihomie -- login: Huffon - avatarUrl: https://avatars.githubusercontent.com/u/31345506?u=c41bdf60facd004ec6364bf718ce16f8da2b884f&v=4 - url: https://github.com/Huffon - login: SaltyCoco avatarUrl: https://avatars.githubusercontent.com/u/31451104?u=6ee4e17c07d21b7054f54a12fa9cc377a1b24ff9&v=4 url: https://github.com/SaltyCoco @@ -586,9 +623,15 @@ sponsors: - login: lukin0110 avatarUrl: https://avatars.githubusercontent.com/u/992275?u=d20b7e18b213ae7004585b382eccb542db5ffe48&v=4 url: https://github.com/lukin0110 +- login: Pytlicek + avatarUrl: https://avatars.githubusercontent.com/u/1430522?v=4 + url: https://github.com/Pytlicek - login: okken avatarUrl: https://avatars.githubusercontent.com/u/1568356?u=0a991a21bdc62e2bea9ad311652f2c45f453dc84&v=4 url: https://github.com/okken +- login: leogregianin + avatarUrl: https://avatars.githubusercontent.com/u/1684053?u=94ddd387601bd1805034dbe83e6eba0491c15323&v=4 + url: https://github.com/leogregianin - login: cbonoz avatarUrl: https://avatars.githubusercontent.com/u/2351087?u=fd3e8030b2cc9fbfbb54a65e9890c548a016f58b&v=4 url: https://github.com/cbonoz @@ -602,7 +645,7 @@ sponsors: avatarUrl: https://avatars.githubusercontent.com/u/3438238?u=c57605077c31a8f7b2341fc4912507f91b4a5621&v=4 url: https://github.com/igorcorrea - login: zsinx6 - avatarUrl: https://avatars.githubusercontent.com/u/3532625?v=4 + avatarUrl: https://avatars.githubusercontent.com/u/3532625?u=ba75a5dc744d1116ccfeaaf30d41cb2fe81fe8dd&v=4 url: https://github.com/zsinx6 - login: pawamoy avatarUrl: https://avatars.githubusercontent.com/u/3999221?u=b030e4c89df2f3a36bc4710b925bdeb6745c9856&v=4 @@ -610,6 +653,12 @@ sponsors: - login: spyker77 avatarUrl: https://avatars.githubusercontent.com/u/4953435?u=568baae6469628e020fe0bab16e395b7ae10c7d3&v=4 url: https://github.com/spyker77 +- login: serfer2 + avatarUrl: https://avatars.githubusercontent.com/u/5196592?u=e8798d87120952ed41876778f0cc8a1ddb47f901&v=4 + url: https://github.com/serfer2 +- login: JonasKs + avatarUrl: https://avatars.githubusercontent.com/u/5310116?u=98a049f3e1491bffb91e1feb7e93def6881a9389&v=4 + url: https://github.com/JonasKs - login: iwpnd avatarUrl: https://avatars.githubusercontent.com/u/6152183?u=b2286006daafff5f991557344fee20b5da59639a&v=4 url: https://github.com/iwpnd @@ -631,24 +680,30 @@ sponsors: - login: hard-coders avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=f2d3d2038c55d86d7f9348f4e6c5e30191e4ee8b&v=4 url: https://github.com/hard-coders +- login: pheanex + avatarUrl: https://avatars.githubusercontent.com/u/10408624?u=5b6bab6ee174aa6e991333e06eb29f628741013d&v=4 + url: https://github.com/pheanex +- login: wotori + avatarUrl: https://avatars.githubusercontent.com/u/10486621?u=0044c295b91694b8c9bccc0a805681f794250f7b&v=4 + url: https://github.com/wotori - login: JimFawkes avatarUrl: https://avatars.githubusercontent.com/u/12075115?u=dc58ecfd064d72887c34bf500ddfd52592509acd&v=4 url: https://github.com/JimFawkes -- login: logan-connolly - avatarUrl: https://avatars.githubusercontent.com/u/16244943?u=8ae66dfbba936463cc8aa0dd7a6d2b4c0cc757eb&v=4 - url: https://github.com/logan-connolly - login: sebastianmarines - avatarUrl: https://avatars.githubusercontent.com/u/18373185?u=e0be7c230456a2bdc0825e3d6541ea8966e22028&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/18373185?u=3f74dbd238bd3ab40179323c5906bb162da5b5a7&v=4 url: https://github.com/sebastianmarines -- login: Filimoa - avatarUrl: https://avatars.githubusercontent.com/u/21352040?u=75e02d102d2ee3e3d793e555fa5c63045913ccb0&v=4 - url: https://github.com/Filimoa +- login: iPr0ger + avatarUrl: https://avatars.githubusercontent.com/u/19322290?v=4 + url: https://github.com/iPr0ger - login: ghandic avatarUrl: https://avatars.githubusercontent.com/u/23500353?u=e2e1d736f924d9be81e8bfc565b6d8836ba99773&v=4 url: https://github.com/ghandic - login: MoronVV avatarUrl: https://avatars.githubusercontent.com/u/24293616?v=4 url: https://github.com/MoronVV +- login: AngusWG + avatarUrl: https://avatars.githubusercontent.com/u/26385612?u=f4d4c8bd2097cdd58eb9e385932b83c78777f3c0&v=4 + url: https://github.com/AngusWG - login: mertguvencli avatarUrl: https://avatars.githubusercontent.com/u/29762151?u=16a906d90df96c8cff9ea131a575c4bc171b1523&v=4 url: https://github.com/mertguvencli @@ -658,6 +713,12 @@ sponsors: - login: leynier avatarUrl: https://avatars.githubusercontent.com/u/36774373?u=60eee7ab14aada5aab8af6fbd11d14732750a7ab&v=4 url: https://github.com/leynier +- login: askurihin + avatarUrl: https://avatars.githubusercontent.com/u/37978981?v=4 + url: https://github.com/askurihin +- login: berrysauce + avatarUrl: https://avatars.githubusercontent.com/u/38889179?u=758ed15a5be8bbd03855f5a74f42c19f7946ee32&v=4 + url: https://github.com/berrysauce - login: JitPackJoyride avatarUrl: https://avatars.githubusercontent.com/u/40203625?u=9638bfeacfa5940358188f8205ce662bba022b53&v=4 url: https://github.com/JitPackJoyride @@ -667,9 +728,18 @@ sponsors: - login: ilias-ant avatarUrl: https://avatars.githubusercontent.com/u/42189572?u=064bf3a60fcb3c445ab038386321098920b3f4e4&v=4 url: https://github.com/ilias-ant +- login: kbhatiya999 + avatarUrl: https://avatars.githubusercontent.com/u/47816034?v=4 + url: https://github.com/kbhatiya999 - login: akanz1 avatarUrl: https://avatars.githubusercontent.com/u/51492342?u=2280f57134118714645e16b535c1a37adf6b369b&v=4 url: https://github.com/akanz1 +- login: rychardvale + avatarUrl: https://avatars.githubusercontent.com/u/54805553?u=3d20ab05301d05f9ac3500fb79a2bfee3842b753&v=4 + url: https://github.com/rychardvale - login: athemeart avatarUrl: https://avatars.githubusercontent.com/u/61623624?v=4 url: https://github.com/athemeart +- login: Rhythmicc + avatarUrl: https://avatars.githubusercontent.com/u/29839231?u=2100781089a259707c475c4547bd7995b0fc18ee&v=4 + url: https://github.com/Rhythmicc From 662fc81544c445ce9b62e11114ac360d25ae927d Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:27:36 +0000 Subject: [PATCH 39/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 1120adf9..20ed8683 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 👥 Update FastAPI People. PR [#3319](https://github.com/tiangolo/fastapi/pull/3319) by [@github-actions[bot]](https://github.com/apps/github-actions). * 🌐 Add Chinese translation for Tutorial - Body - Updates. PR [#3237](https://github.com/tiangolo/fastapi/pull/3237) by [@jaystone776](https://github.com/jaystone776). * 🌐 Add Chinese translation for FastAPI People. PR [#3112](https://github.com/tiangolo/fastapi/pull/3112) by [@hareru](https://github.com/hareru). * 🌐 Add French translation for Project Generation. PR [#3197](https://github.com/tiangolo/fastapi/pull/3197) by [@Smlep](https://github.com/Smlep). From 811c3f873f18f19a10f9a2b9ec0c9fd2aa17a103 Mon Sep 17 00:00:00 2001 From: jaystone776 <1732865113@qq.com> Date: Fri, 2 Jul 2021 22:35:58 +0800 Subject: [PATCH 40/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translatio?= =?UTF-8?q?n=20for=20Tutorial=20-=20Form=20-=20Data=20(#3248)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/zh/docs/tutorial/request-forms.md | 63 ++++++++++++++++++++++++++ docs/zh/mkdocs.yml | 1 + 2 files changed, 64 insertions(+) create mode 100644 docs/zh/docs/tutorial/request-forms.md diff --git a/docs/zh/docs/tutorial/request-forms.md b/docs/zh/docs/tutorial/request-forms.md new file mode 100644 index 00000000..0840c927 --- /dev/null +++ b/docs/zh/docs/tutorial/request-forms.md @@ -0,0 +1,63 @@ +# 表单数据 + +接收的不是 JSON,而是表单字段时,要使用 `Form`。 + +!!! info "说明" + + 要使用表单,需预先安装 `python-multipart`。 + + 例如,`pip install python-multipart`。 + +## 导入 `Form` + +从 `fastapi` 导入 `Form`: + +```Python hl_lines="1" +{!../../../docs_src/request_forms/tutorial001.py!} +``` + +## 定义 `Form` 参数 + +创建表单(`Form`)参数的方式与 `Body` 和 `Query` 一样: + +```Python hl_lines="7" +{!../../../docs_src/request_forms/tutorial001.py!} +``` + +例如,OAuth2 规范的 "密码流" 模式规定要通过表单字段发送 `username` 和 `password`。 + +该规范要求字段必须命名为 `username` 和 `password`,并通过表单字段发送,不能用 JSON。 + +使用 `Form` 可以声明与 `Body` (及 `Query`、`Path`、`Cookie`)相同的元数据和验证。 + +!!! info "说明" + + `Form` 是直接继承自 `Body` 的类。 + +!!! tip "提示" + + 声明表单体要显式使用 `Form` ,否则,FastAPI 会把该参数当作查询参数或请求体(JSON)参数。 + +## 关于 "表单字段" + +与 JSON 不同,HTML 表单(`
`)向服务器发送数据通常使用「特殊」的编码。 + +**FastAPI** 要确保从正确的位置读取数据,而不是读取 JSON。 + +!!! note "技术细节" + + 表单数据的「媒体类型」编码一般为 `application/x-www-form-urlencoded`。 + + 但包含文件的表单编码为 `multipart/form-data`。文件处理详见下节。 + + 编码和表单字段详见 MDN Web 文档的 POST小节。 + +!!! warning "警告" + + 可在一个*路径操作*中声明多个 `Form` 参数,但不能同时声明要接收 JSON 的 `Body` 字段。因为此时请求体的编码是 `application/x-www-form-urlencoded`,不是 `application/json`。 + + 这不是 **FastAPI** 的问题,而是 HTTP 协议的规定。 + +## 小结 + +本节介绍了如何使用 `Form` 声明表单数据输入参数。 \ No newline at end of file diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index f63f341f..1bceab21 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -73,6 +73,7 @@ nav: - tutorial/schema-extra-example.md - tutorial/extra-data-types.md - tutorial/cookie-params.md + - tutorial/request-forms.md - tutorial/request-files.md - tutorial/body-updates.md - 安全性: From e5d0b97dee8737d0ca3428c4ec03cd801d251685 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:36:34 +0000 Subject: [PATCH 41/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 20ed8683..7f400fb5 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add Chinese translation for Tutorial - Form - Data. PR [#3248](https://github.com/tiangolo/fastapi/pull/3248) by [@jaystone776](https://github.com/jaystone776). * 👥 Update FastAPI People. PR [#3319](https://github.com/tiangolo/fastapi/pull/3319) by [@github-actions[bot]](https://github.com/apps/github-actions). * 🌐 Add Chinese translation for Tutorial - Body - Updates. PR [#3237](https://github.com/tiangolo/fastapi/pull/3237) by [@jaystone776](https://github.com/jaystone776). * 🌐 Add Chinese translation for FastAPI People. PR [#3112](https://github.com/tiangolo/fastapi/pull/3112) by [@hareru](https://github.com/hareru). From 0a84d48a8232243ca9ca23fefb16e603fe35c9a3 Mon Sep 17 00:00:00 2001 From: jaystone776 <1732865113@qq.com> Date: Fri, 2 Jul 2021 22:43:28 +0800 Subject: [PATCH 42/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translatio?= =?UTF-8?q?n=20for=20Tutorial=20-=20Handling=20-=20Errors=20(#3299)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/zh/docs/tutorial/handling-errors.md | 289 +++++++++++++++++++++++ docs/zh/mkdocs.yml | 1 + 2 files changed, 290 insertions(+) create mode 100644 docs/zh/docs/tutorial/handling-errors.md diff --git a/docs/zh/docs/tutorial/handling-errors.md b/docs/zh/docs/tutorial/handling-errors.md new file mode 100644 index 00000000..1126b7ad --- /dev/null +++ b/docs/zh/docs/tutorial/handling-errors.md @@ -0,0 +1,289 @@ +# 处理错误 + +某些情况下,需要向客户端返回错误提示。 + +这里所谓的客户端包括前端浏览器、其他应用程序、物联网设备等。 + +需要向客户端返回错误提示的场景主要如下: + +- 客户端没有执行操作的权限 +- 客户端没有访问资源的权限 +- 客户端要访问的项目不存在 +- 等等 ... + +遇到这些情况时,通常要返回 **4XX**(400 至 499)**HTTP 状态码**。 + +**4XX** 状态码与表示请求成功的 **2XX**(200 至 299) HTTP 状态码类似。 + +只不过,**4XX** 状态码表示客户端发生的错误。 + +大家都知道**「404 Not Found」**错误,还有调侃这个错误的笑话吧? + +## 使用 `HTTPException` + +向客户端返回 HTTP 错误响应,可以使用 `HTTPException`。 + +### 导入 `HTTPException` + +```Python hl_lines="1" +{!../../../docs_src/handling_errors/tutorial001.py!} + +``` + +### 触发 `HTTPException` + +`HTTPException` 是额外包含了和 API 有关数据的常规 Python 异常。 + +因为是 Python 异常,所以不能 `return`,只能 `raise`。 + +如在调用*路径操作函数*里的工具函数时,触发了 `HTTPException`,FastAPI 就不再继续执行*路径操作函数*中的后续代码,而是立即终止请求,并把 `HTTPException` 的 HTTP 错误发送至客户端。 + +在介绍依赖项与安全的章节中,您可以了解更多用 `raise` 异常代替 `return` 值的优势。 + +本例中,客户端用 `ID` 请求的 `item` 不存在时,触发状态码为 `404` 的异常: + +```Python hl_lines="11" +{!../../../docs_src/handling_errors/tutorial001.py!} + +``` + +### 响应结果 + +请求为 `http://example.com/items/foo`(`item_id` 为 `「foo」`)时,客户端会接收到 HTTP 状态码 - 200 及如下 JSON 响应结果: + +```JSON +{ + "item": "The Foo Wrestlers" +} + +``` + +但如果客户端请求 `http://example.com/items/bar`(`item_id` `「bar」` 不存在时),则会接收到 HTTP 状态码 - 404(「未找到」错误)及如下 JSON 响应结果: + +```JSON +{ + "detail": "Item not found" +} + +``` + +!!! tip "提示" + + 触发 `HTTPException` 时,可以用参数 `detail` 传递任何能转换为 JSON 的值,不仅限于 `str`。 + + 还支持传递 `dict`、`list` 等数据结构。 + + **FastAPI** 能自动处理这些数据,并将之转换为 JSON。 + + +## 添加自定义响应头 + +有些场景下要为 HTTP 错误添加自定义响应头。例如,出于某些方面的安全需要。 + +一般情况下可能不会需要在代码中直接使用响应头。 + +但对于某些高级应用场景,还是需要添加自定义响应头: + +```Python hl_lines="14" +{!../../../docs_src/handling_errors/tutorial002.py!} + +``` + +## 安装自定义异常处理器 + +添加自定义处理器,要使用 [Starlette 的异常工具](https://www.starlette.io/exceptions/)。 + +假设要触发的自定义异常叫作 `UnicornException`。 + +且需要 FastAPI 实现全局处理该异常。 + +此时,可以用 `@app.exception_handler()` 添加自定义异常控制器: + +```Python hl_lines="5-7 13-18 24" +{!../../../docs_src/handling_errors/tutorial003.py!} + +``` + +请求 `/unicorns/yolo` 时,路径操作会触发 `UnicornException`。 + +但该异常将会被 `unicorn_exception_handler` 处理。 + +接收到的错误信息清晰明了,HTTP 状态码为 `418`,JSON 内容如下: + +```JSON +{"message": "Oops! yolo did something. There goes a rainbow..."} + +``` + +!!! note "技术细节" + + `from starlette.requests import Request` 和 `from starlette.responses import JSONResponse` 也可以用于导入 `Request` 和 `JSONResponse`。 + + **FastAPI** 提供了与 `starlette.responses` 相同的 `fastapi.responses` 作为快捷方式,但大部分响应操作都可以直接从 Starlette 导入。同理,`Request` 也是如此。 + + +## 覆盖默认异常处理器 + +**FastAPI** 自带了一些默认异常处理器。 + +触发 `HTTPException` 或请求无效数据时,这些处理器返回默认的 JSON 响应结果。 + +不过,也可以使用自定义处理器覆盖默认异常处理器。 + +### 覆盖请求验证异常 + +请求中包含无效数据时,**FastAPI** 内部会触发 `RequestValidationError`。 + +该异常也内置了默认异常处理器。 + +覆盖默认异常处理器时需要导入 `RequestValidationError`,并用 `@app.excption_handler(RequestValidationError)` 装饰异常处理器。 + +这样,异常处理器就可以接收 `Request` 与异常。 + +```Python hl_lines="2 14-16" +{!../../../docs_src/handling_errors/tutorial004.py!} + +``` + +访问 `/items/foo`,可以看到以下内容替换了默认 JSON 错误信息: + +```JSON +{ + "detail": [ + { + "loc": [ + "path", + "item_id" + ], + "msg": "value is not a valid integer", + "type": "type_error.integer" + } + ] +} + +``` + +以下是文本格式的错误信息: + +``` +1 validation error +path -> item_id + value is not a valid integer (type=type_error.integer) + +``` + +### `RequestValidationError` vs `ValidationError` + +!!! warning "警告" + + 如果您觉得现在还用不到以下技术细节,可以先跳过下面的内容。 + + +`RequestValidationError` 是 Pydantic 的 `ValidationError` 的子类。 + +**FastAPI** 调用的就是 `RequestValidationError` 类,因此,如果在 `response_model` 中使用 Pydantic 模型,且数据有错误时,在日志中就会看到这个错误。 + +但客户端或用户看不到这个错误。反之,客户端接收到的是 HTTP 状态码为 `500` 的「内部服务器错误」。 + +这是因为在*响应*或代码(不是在客户端的请求里)中出现的 Pydantic `ValidationError` 是代码的 bug。 + +修复错误时,客户端或用户不能访问错误的内部信息,否则会造成安全隐患。 + +### 覆盖 `HTTPException` 错误处理器 + +同理,也可以覆盖 `HTTPException` 处理器。 + +例如,只为错误返回纯文本响应,而不是返回 JSON 格式的内容: + +```Python hl_lines="3-4 9-11 22" +{!../../../docs_src/handling_errors/tutorial004.py!} + +``` + +!!! note "技术细节" + + 还可以使用 `from starlette.responses import PlainTextResponse`。 + + **FastAPI** 提供了与 `starlette.responses` 相同的 `fastapi.responses` 作为快捷方式,但大部分响应都可以直接从 Starlette 导入。 + + +### 使用 `RequestValidationError` 的请求体 + +`RequestValidationError` 包含其接收到的无效数据请求的 `body` 。 + +开发时,可以用这个请求体生成日志、调试错误,并返回给用户。 + +```Python hl_lines="14" +{!../../../docs_src/handling_errors/tutorial005.py!} + +``` + +现在试着发送一个无效的 `item`,例如: + +```JSON +{ + "title": "towel", + "size": "XL" +} + +``` + +收到的响应包含 `body` 信息,并说明数据是无效的: + +```JSON hl_lines="12-15" +{ + "detail": [ + { + "loc": [ + "body", + "size" + ], + "msg": "value is not a valid integer", + "type": "type_error.integer" + } + ], + "body": { + "title": "towel", + "size": "XL" + } +} + +``` + +### FastAPI `HTTPException` vs Starlette `HTTPException` + +**FastAPI** 也提供了自有的 `HTTPException`。 + +**FastAPI** 的 `HTTPException` 继承自 Starlette 的 `HTTPException` 错误类。 + +它们之间的唯一区别是,**FastAPI** 的 `HTTPException` 可以在响应中添加响应头。 + +OAuth 2.0 等安全工具需要在内部调用这些响应头。 + +因此你可以继续像平常一样在代码中触发 **FastAPI** 的 `HTTPException` 。 + +但注册异常处理器时,应该注册到来自 Starlette 的 `HTTPException`。 + +这样做是为了,当 Starlette 的内部代码、扩展或插件触发 Starlette `HTTPException` 时,处理程序能够捕获、并处理此异常。 + +注意,本例代码中同时使用了这两个 `HTTPException`,此时,要把 Starlette 的 `HTTPException` 命名为 `StarletteHTTPException`: + +```Python +from starlette.exceptions import HTTPException as StarletteHTTPException + +``` + +### 复用 **FastAPI** 异常处理器 + +FastAPI 支持先对异常进行某些处理,然后再使用 **FastAPI** 中处理该异常的默认异常处理器。 + +从 `fastapi.exception_handlers` 中导入要复用的默认异常处理器: + +```Python hl_lines="2-5 15 21" +{!../../../docs_src/handling_errors/tutorial006.py!} + +``` + +虽然,本例只是输出了夸大其词的错误信息。 + +但也足以说明,可以在处理异常之后再复用默认的异常处理器。 \ No newline at end of file diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index 1bceab21..ed114221 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -75,6 +75,7 @@ nav: - tutorial/cookie-params.md - tutorial/request-forms.md - tutorial/request-files.md + - tutorial/handling-errors.md - tutorial/body-updates.md - 安全性: - tutorial/security/index.md From dd7bbae837d3f5a620c07c0b712cb4310b90e727 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:44:04 +0000 Subject: [PATCH 43/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 7f400fb5..6d1268f7 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add Chinese translation for Tutorial - Handling - Errors. PR [#3299](https://github.com/tiangolo/fastapi/pull/3299) by [@jaystone776](https://github.com/jaystone776). * 🌐 Add Chinese translation for Tutorial - Form - Data. PR [#3248](https://github.com/tiangolo/fastapi/pull/3248) by [@jaystone776](https://github.com/jaystone776). * 👥 Update FastAPI People. PR [#3319](https://github.com/tiangolo/fastapi/pull/3319) by [@github-actions[bot]](https://github.com/apps/github-actions). * 🌐 Add Chinese translation for Tutorial - Body - Updates. PR [#3237](https://github.com/tiangolo/fastapi/pull/3237) by [@jaystone776](https://github.com/jaystone776). From c00c2d1ecf3133a284ee55994633c4b341989bcb Mon Sep 17 00:00:00 2001 From: jaystone776 <1732865113@qq.com> Date: Fri, 2 Jul 2021 22:54:22 +0800 Subject: [PATCH 44/50] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translatio?= =?UTF-8?q?n=20for=20Tutorial=20-=20Request=20-=20Forms=20-=20and=20-=20Fi?= =?UTF-8?q?les=20(#3249)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- .../docs/tutorial/request-forms-and-files.md | 38 +++++++++++++++++++ docs/zh/mkdocs.yml | 1 + 2 files changed, 39 insertions(+) create mode 100644 docs/zh/docs/tutorial/request-forms-and-files.md diff --git a/docs/zh/docs/tutorial/request-forms-and-files.md b/docs/zh/docs/tutorial/request-forms-and-files.md new file mode 100644 index 00000000..a27ba93d --- /dev/null +++ b/docs/zh/docs/tutorial/request-forms-and-files.md @@ -0,0 +1,38 @@ +# 请求表单与文件 + +FastAPI 支持同时使用 `File` 和 `Form` 定义文件和表单字段。 + +!!! info "说明" + + 接收上传文件或表单数据,要预先安装 `python-multipart`。 + + 例如,`pip install python-multipart`。 + +## 导入 `File` 与 `Form` + +```Python hl_lines="1" +{!../../../docs_src/request_forms_and_files/tutorial001.py!} +``` + +## 定义 `File` 与 `Form` 参数 + +创建文件和表单参数的方式与 `Body` 和 `Query` 一样: + +```Python hl_lines="8" +{!../../../docs_src/request_forms_and_files/tutorial001.py!} +``` + +文件和表单字段作为表单数据上传与接收。 + +声明文件可以使用 `bytes` 或 `UploadFile` 。 + +!!! warning "警告" + + 可在一个*路径操作*中声明多个 `File` 与 `Form` 参数,但不能同时声明要接收 JSON 的 `Body` 字段。因为此时请求体的编码为 `multipart/form-data`,不是 `application/json`。 + + 这不是 **FastAPI** 的问题,而是 HTTP 协议的规定。 + +## 小结 + +在同一个请求中接收数据和文件时,应同时使用 `File` 和 `Form`。 + diff --git a/docs/zh/mkdocs.yml b/docs/zh/mkdocs.yml index ed114221..85e470e5 100644 --- a/docs/zh/mkdocs.yml +++ b/docs/zh/mkdocs.yml @@ -75,6 +75,7 @@ nav: - tutorial/cookie-params.md - tutorial/request-forms.md - tutorial/request-files.md + - tutorial/request-forms-and-files.md - tutorial/handling-errors.md - tutorial/body-updates.md - 安全性: From a9f2a25febd1edcb232646d0af51d102c60af443 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 14:54:56 +0000 Subject: [PATCH 45/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 6d1268f7..461c917d 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Add Chinese translation for Tutorial - Request - Forms - and - Files. PR [#3249](https://github.com/tiangolo/fastapi/pull/3249) by [@jaystone776](https://github.com/jaystone776). * 🌐 Add Chinese translation for Tutorial - Handling - Errors. PR [#3299](https://github.com/tiangolo/fastapi/pull/3299) by [@jaystone776](https://github.com/jaystone776). * 🌐 Add Chinese translation for Tutorial - Form - Data. PR [#3248](https://github.com/tiangolo/fastapi/pull/3248) by [@jaystone776](https://github.com/jaystone776). * 👥 Update FastAPI People. PR [#3319](https://github.com/tiangolo/fastapi/pull/3319) by [@github-actions[bot]](https://github.com/apps/github-actions). From 9c5b000956940f74847d9efda75dd9fb4cce4033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Victor=20Ribeiro=20Silva?= Date: Fri, 2 Jul 2021 12:00:11 -0300 Subject: [PATCH 46/50] =?UTF-8?q?=F0=9F=8C=90=20Portuguese=20translation?= =?UTF-8?q?=20of=20Tutorial=20-=20Body=20-=20Fields=20(#3420)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastián Ramírez --- docs/pt/docs/tutorial/body-fields.md | 48 ++++++++++++++++++++++++++++ docs/pt/mkdocs.yml | 1 + 2 files changed, 49 insertions(+) create mode 100644 docs/pt/docs/tutorial/body-fields.md diff --git a/docs/pt/docs/tutorial/body-fields.md b/docs/pt/docs/tutorial/body-fields.md new file mode 100644 index 00000000..8f3313ae --- /dev/null +++ b/docs/pt/docs/tutorial/body-fields.md @@ -0,0 +1,48 @@ +# Corpo - Campos + +Da mesma forma que você pode declarar validações adicionais e metadados nos parâmetros de *funções de operações de rota* com `Query`, `Path` e `Body`, você pode declarar validações e metadados dentro de modelos do Pydantic usando `Field` do Pydantic. + +## Importe `Field` + +Primeiro, você tem que importá-lo: + +```Python hl_lines="4" +{!../../../docs_src/body_fields/tutorial001.py!} +``` + +!!! warning "Aviso" + Note que `Field` é importado diretamente do `pydantic`, não do `fastapi` como todo o resto (`Query`, `Path`, `Body`, etc). + +## Declare atributos do modelo + +Você pode então utilizar `Field` com atributos do modelo: + +```Python hl_lines="11-14" +{!../../../docs_src/body_fields/tutorial001.py!} +``` + +`Field` funciona da mesma forma que `Query`, `Path` e `Body`, ele possui todos os mesmos parâmetros, etc. + +!!! note "Detalhes técnicos" + Na realidade, `Query`, `Path` e outros que você verá em seguida, criam objetos de subclasses de uma classe `Param` comum, que é ela mesma uma subclasse da classe `FieldInfo` do Pydantic. + + E `Field` do Pydantic retorna uma instância de `FieldInfo` também. + + `Body` também retorna objetos de uma subclasse de `FieldInfo` diretamente. E tem outras que você verá mais tarde que são subclasses da classe `Body`. + + Lembre-se que quando você importa `Query`, `Path`, e outros de `fastapi`, esse são na realidade funções que retornam classes especiais. + +!!! tip "Dica" + Note como cada atributo do modelo com um tipo, valor padrão e `Field` possuem a mesma estrutura que parâmetros de *funções de operações de rota*, com `Field` ao invés de `Path`, `Query` e `Body`. + +## Adicione informações extras + +Você pode declarar informação extra em `Field`, `Query`, `Body`, etc. E isso será incluído no JSON Schema gerado. + +Você irá aprender mais sobre adicionar informações extras posteriormente nessa documentação, quando estiver aprendendo a declarar exemplos. + +## Recapitulando + +Você pode usar `Field` do Pydantic para declarar validações extras e metadados para atributos do modelo. + +Você também pode usar os argumentos de palavras-chave extras para passar metadados do JSON Schema adicionais. diff --git a/docs/pt/mkdocs.yml b/docs/pt/mkdocs.yml index 230012d3..6102a859 100644 --- a/docs/pt/mkdocs.yml +++ b/docs/pt/mkdocs.yml @@ -55,6 +55,7 @@ nav: - Tutorial - Guia de Usuário: - tutorial/index.md - tutorial/first-steps.md + - tutorial/body-fields.md - alternatives.md - history-design-future.md - external-links.md From bd230fe4739d1c276d825879f5737fa2f8a663b7 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 15:00:53 +0000 Subject: [PATCH 47/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index 461c917d..fba17035 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 🌐 Portuguese translation of Tutorial - Body - Fields. PR [#3420](https://github.com/tiangolo/fastapi/pull/3420) by [@ComicShrimp](https://github.com/ComicShrimp). * 🌐 Add Chinese translation for Tutorial - Request - Forms - and - Files. PR [#3249](https://github.com/tiangolo/fastapi/pull/3249) by [@jaystone776](https://github.com/jaystone776). * 🌐 Add Chinese translation for Tutorial - Handling - Errors. PR [#3299](https://github.com/tiangolo/fastapi/pull/3299) by [@jaystone776](https://github.com/jaystone776). * 🌐 Add Chinese translation for Tutorial - Form - Data. PR [#3248](https://github.com/tiangolo/fastapi/pull/3248) by [@jaystone776](https://github.com/jaystone776). From 710a2f745cd972ca367ac17385443649c737e249 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 Jul 2021 17:17:49 +0200 Subject: [PATCH 48/50] =?UTF-8?q?=F0=9F=91=A5=20Update=20FastAPI=20People?= =?UTF-8?q?=20(#3450)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions Co-authored-by: Sebastián Ramírez --- docs/en/data/people.yml | 215 +++++++++++++++++++++------------------- 1 file changed, 111 insertions(+), 104 deletions(-) diff --git a/docs/en/data/people.yml b/docs/en/data/people.yml index d1898a93..6356a507 100644 --- a/docs/en/data/people.yml +++ b/docs/en/data/people.yml @@ -1,24 +1,24 @@ maintainers: - login: tiangolo answers: 1225 - prs: 230 + prs: 232 avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=05f95ca7fdead36edd9c86be46b4ef6c3c71f876&v=4 url: https://github.com/tiangolo experts: +- login: Kludex + count: 267 + avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=cf8455cb899806b774a3a71073f88583adec99f6&v=4 + url: https://github.com/Kludex - login: dmontagu count: 262 avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=58ed2a45798a4339700e2f62b2e12e6e54bf0396&v=4 url: https://github.com/dmontagu -- login: Kludex - count: 254 - avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=cf8455cb899806b774a3a71073f88583adec99f6&v=4 - url: https://github.com/Kludex - login: ycd - count: 214 + count: 216 avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=826f228edf0bab0d19ad1d5c4ba4df1047ccffef&v=4 url: https://github.com/ycd - login: Mause - count: 176 + count: 182 avatarUrl: https://avatars.githubusercontent.com/u/1405026?v=4 url: https://github.com/Mause - login: euri10 @@ -30,21 +30,21 @@ experts: avatarUrl: https://avatars.githubusercontent.com/u/331403?v=4 url: https://github.com/phy25 - login: ArcLightSlavik - count: 58 + count: 64 avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 url: https://github.com/ArcLightSlavik - login: falkben count: 56 avatarUrl: https://avatars.githubusercontent.com/u/653031?u=0c8d8f33d87f1aa1a6488d3f02105e9abc838105&v=4 url: https://github.com/falkben +- login: raphaelauv + count: 47 + avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4 + url: https://github.com/raphaelauv - login: sm-Fifteen count: 46 avatarUrl: https://avatars.githubusercontent.com/u/516999?u=437c0c5038558c67e887ccd863c1ba0f846c03da&v=4 url: https://github.com/sm-Fifteen -- login: raphaelauv - count: 44 - avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4 - url: https://github.com/raphaelauv - login: includeamin count: 38 avatarUrl: https://avatars.githubusercontent.com/u/11836741?u=8bd5ef7e62fe6a82055e33c4c0e0a7879ff8cfb6&v=4 @@ -77,6 +77,10 @@ experts: count: 24 avatarUrl: https://avatars.githubusercontent.com/u/9435877?u=719327b7d2c4c62212456d771bfa7c6b8dbb9eac&v=4 url: https://github.com/SirTelemak +- login: chbndrhnns + count: 22 + avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4 + url: https://github.com/chbndrhnns - login: acnebs count: 22 avatarUrl: https://avatars.githubusercontent.com/u/9054108?u=bfd127b3e6200f4d00afd714f0fc95c2512df19b&v=4 @@ -85,14 +89,14 @@ experts: count: 22 avatarUrl: https://avatars.githubusercontent.com/u/22559461?u=a9cc3238217e21dc8796a1a500f01b722adb082c&v=4 url: https://github.com/nsidnev +- login: frankie567 + count: 21 + avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=72adf1cb1d29787305c99700d669561952cea0af&v=4 + url: https://github.com/frankie567 - login: chris-allnutt count: 21 avatarUrl: https://avatars.githubusercontent.com/u/565544?v=4 url: https://github.com/chris-allnutt -- login: chbndrhnns - count: 20 - avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4 - url: https://github.com/chbndrhnns - login: retnikt count: 19 avatarUrl: https://avatars.githubusercontent.com/u/24581770?v=4 @@ -117,10 +121,10 @@ experts: count: 13 avatarUrl: https://avatars.githubusercontent.com/u/58201?u=4f1f9843d69433ca0d380d95146cfe119e5fdac4&v=4 url: https://github.com/haizaar -- login: frankie567 - count: 12 - avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=72adf1cb1d29787305c99700d669561952cea0af&v=4 - url: https://github.com/frankie567 +- login: acidjunk + count: 11 + avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4 + url: https://github.com/acidjunk - login: zamiramir count: 11 avatarUrl: https://avatars.githubusercontent.com/u/40475662?u=e58ef61034e8d0d6a312cc956fb09b9c3332b449&v=4 @@ -142,50 +146,38 @@ experts: avatarUrl: https://avatars.githubusercontent.com/u/20441825?u=ee1e59446b98f8ec2363caeda4c17164d0d9cc7d&v=4 url: https://github.com/stefanondisponibile last_month_active: -- login: Hultner - count: 15 - avatarUrl: https://avatars.githubusercontent.com/u/2669034?u=115e53df959309898ad8dc9443fbb35fee71df07&v=4 - url: https://github.com/Hultner - login: Kludex - count: 13 + count: 12 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=cf8455cb899806b774a3a71073f88583adec99f6&v=4 url: https://github.com/Kludex -- login: ArcLightSlavik - count: 8 - avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 - url: https://github.com/ArcLightSlavik -- login: raphaelauv - count: 4 - avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4 - url: https://github.com/raphaelauv -- login: chbndrhnns - count: 4 - avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4 - url: https://github.com/chbndrhnns -- login: dstlny - count: 4 - avatarUrl: https://avatars.githubusercontent.com/u/41964673?u=ed9c60d8ab5b4fea71640cdbccf0f83bdd6c43cb&v=4 - url: https://github.com/dstlny +- login: frankie567 + count: 9 + avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=72adf1cb1d29787305c99700d669561952cea0af&v=4 + url: https://github.com/frankie567 - login: Mause - count: 3 + count: 6 avatarUrl: https://avatars.githubusercontent.com/u/1405026?v=4 url: https://github.com/Mause -- login: waynerv - count: 3 - avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4 - url: https://github.com/waynerv -- login: panla - count: 3 - avatarUrl: https://avatars.githubusercontent.com/u/41326348?v=4 - url: https://github.com/panla +- login: ArcLightSlavik + count: 6 + avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 + url: https://github.com/ArcLightSlavik +- login: gyKa + count: 4 + avatarUrl: https://avatars.githubusercontent.com/u/1000842?v=4 + url: https://github.com/gyKa - login: ricky-sb count: 3 avatarUrl: https://avatars.githubusercontent.com/u/10700079?v=4 url: https://github.com/ricky-sb -- login: ycd +- login: captainCapitalism count: 3 - avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=826f228edf0bab0d19ad1d5c4ba4df1047ccffef&v=4 - url: https://github.com/ycd + avatarUrl: https://avatars.githubusercontent.com/u/32553875?v=4 + url: https://github.com/captainCapitalism +- login: acidjunk + count: 3 + avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4 + url: https://github.com/acidjunk top_contributors: - login: waynerv count: 25 @@ -212,7 +204,7 @@ top_contributors: avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=706e1ee3f248245f2d68b976d149d06fd5a2010d&v=4 url: https://github.com/RunningIkkyu - login: Serrones - count: 6 + count: 7 avatarUrl: https://avatars.githubusercontent.com/u/22691749?u=4795b880e13ca33a73e52fc0ef7dc9c60c8fce47&v=4 url: https://github.com/Serrones - login: hard-coders @@ -239,9 +231,13 @@ top_contributors: count: 4 avatarUrl: https://avatars.githubusercontent.com/u/39375566?u=5a44657c0544111ee3c132d9bb9951c2804f7969&v=4 url: https://github.com/komtaki +- login: Smlep + count: 4 + avatarUrl: https://avatars.githubusercontent.com/u/16785985?v=4 + url: https://github.com/Smlep top_reviewers: - login: Kludex - count: 75 + count: 80 avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=cf8455cb899806b774a3a71073f88583adec99f6&v=4 url: https://github.com/Kludex - login: tokusumi @@ -253,7 +249,7 @@ top_reviewers: avatarUrl: https://avatars.githubusercontent.com/u/59285379?v=4 url: https://github.com/Laineyzhang55 - login: ycd - count: 40 + count: 41 avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=826f228edf0bab0d19ad1d5c4ba4df1047ccffef&v=4 url: https://github.com/ycd - login: waynerv @@ -272,6 +268,14 @@ top_reviewers: count: 21 avatarUrl: https://avatars.githubusercontent.com/u/39375566?u=5a44657c0544111ee3c132d9bb9951c2804f7969&v=4 url: https://github.com/komtaki +- login: ArcLightSlavik + count: 20 + avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 + url: https://github.com/ArcLightSlavik +- login: cassiobotaro + count: 16 + avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=b0a652331da17efeb85cd6e3a4969182e5004804&v=4 + url: https://github.com/cassiobotaro - login: yanever count: 16 avatarUrl: https://avatars.githubusercontent.com/u/21978760?v=4 @@ -280,10 +284,6 @@ top_reviewers: count: 16 avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4 url: https://github.com/SwftAlpc -- login: ArcLightSlavik - count: 16 - avatarUrl: https://avatars.githubusercontent.com/u/31127044?u=81a84af39c89b898b0fbc5a04e8834f60f23e55a&v=4 - url: https://github.com/ArcLightSlavik - login: pedabraham count: 15 avatarUrl: https://avatars.githubusercontent.com/u/16860088?u=abf922a7b920bf8fdb7867d8b43e091f1e796178&v=4 @@ -292,10 +292,6 @@ top_reviewers: count: 15 avatarUrl: https://avatars.githubusercontent.com/u/63476957?u=6c86e59b48e0394d4db230f37fc9ad4d7e2c27c7&v=4 url: https://github.com/delhi09 -- login: cassiobotaro - count: 14 - avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=b0a652331da17efeb85cd6e3a4969182e5004804&v=4 - url: https://github.com/cassiobotaro - login: RunningIkkyu count: 12 avatarUrl: https://avatars.githubusercontent.com/u/31848542?u=706e1ee3f248245f2d68b976d149d06fd5a2010d&v=4 @@ -328,6 +324,10 @@ top_reviewers: count: 9 avatarUrl: https://avatars.githubusercontent.com/u/69092910?u=4ac58eab99bd37d663f3d23551df96d4fbdbf760&v=4 url: https://github.com/bezaca +- login: lsglucas + count: 8 + avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4 + url: https://github.com/lsglucas - login: rjNemo count: 8 avatarUrl: https://avatars.githubusercontent.com/u/56785022?u=d5c3a02567c8649e146fcfc51b6060ccaf8adef8&v=4 @@ -360,14 +360,14 @@ top_reviewers: count: 6 avatarUrl: https://avatars.githubusercontent.com/u/21287303?u=b049eac3e51a4c0473c2efe66b4d28a7d8f2b572&v=4 url: https://github.com/jovicon +- login: Mause + count: 6 + avatarUrl: https://avatars.githubusercontent.com/u/1405026?v=4 + url: https://github.com/Mause - login: nimctl count: 5 avatarUrl: https://avatars.githubusercontent.com/u/49960770?u=e39b11d47188744ee07b2a1c7ce1a1bdf3c80760&v=4 url: https://github.com/nimctl -- login: Mause - count: 5 - avatarUrl: https://avatars.githubusercontent.com/u/1405026?v=4 - url: https://github.com/Mause - login: juntatalor count: 5 avatarUrl: https://avatars.githubusercontent.com/u/8134632?v=4 @@ -396,6 +396,10 @@ top_reviewers: count: 4 avatarUrl: https://avatars.githubusercontent.com/u/31370133?v=4 url: https://github.com/Zxilly +- login: Bluenix2 + count: 4 + avatarUrl: https://avatars.githubusercontent.com/u/38372706?u=c9d28aff15958d6ebf1971148bfb3154ff943c4f&v=4 + url: https://github.com/Bluenix2 sponsors_50: - login: johnadjei avatarUrl: https://avatars.githubusercontent.com/u/767860?v=4 @@ -403,6 +407,9 @@ sponsors_50: - login: wdwinslow avatarUrl: https://avatars.githubusercontent.com/u/11562137?u=dc01daafb354135603a263729e3d26d939c0c452&v=4 url: https://github.com/wdwinslow +- login: bingwu-chime + avatarUrl: https://avatars.githubusercontent.com/u/67026650?u=603a6b345f25c20c6706a8a6c7f71ae688d649a5&v=4 + url: https://github.com/bingwu-chime sponsors: - login: kamalgill avatarUrl: https://avatars.githubusercontent.com/u/133923?u=0df9181d97436ce330e9acf90ab8a54b7022efe7&v=4 @@ -410,6 +417,9 @@ sponsors: - login: grillazz avatarUrl: https://avatars.githubusercontent.com/u/3415861?u=16d7d0ffa5dfb99f8834f8f76d90e138ba09b94a&v=4 url: https://github.com/grillazz +- login: tizz98 + avatarUrl: https://avatars.githubusercontent.com/u/5739698?u=f095a3659e3a8e7c69ccd822696990b521ea25f9&v=4 + url: https://github.com/tizz98 - login: jmaralc avatarUrl: https://avatars.githubusercontent.com/u/21101214?u=b15a9f07b7cbf6c9dcdbcb6550bbd2c52f55aa50&v=4 url: https://github.com/jmaralc @@ -431,6 +441,9 @@ sponsors: - login: falkben avatarUrl: https://avatars.githubusercontent.com/u/653031?u=0c8d8f33d87f1aa1a6488d3f02105e9abc838105&v=4 url: https://github.com/falkben +- login: jqueguiner + avatarUrl: https://avatars.githubusercontent.com/u/690878?u=e4835b2a985a0f2d52018e4926cb5a58c26a62e8&v=4 + url: https://github.com/jqueguiner - login: Mazyod avatarUrl: https://avatars.githubusercontent.com/u/860511?v=4 url: https://github.com/Mazyod @@ -452,9 +465,9 @@ sponsors: - login: madisonmay avatarUrl: https://avatars.githubusercontent.com/u/2645393?u=f22b93c6ea345a4d26a90a3834dfc7f0789fcb63&v=4 url: https://github.com/madisonmay -- login: jorgecarleitao - avatarUrl: https://avatars.githubusercontent.com/u/2772607?u=6ba4aa5ded7b492043ba76f3f900e3b4cc102b57&v=4 - url: https://github.com/jorgecarleitao +- login: saivarunk + avatarUrl: https://avatars.githubusercontent.com/u/2976867?u=71f4385e781e9a9e871a52f2d4686f9a8d69ba2f&v=4 + url: https://github.com/saivarunk - login: andre1sk avatarUrl: https://avatars.githubusercontent.com/u/3148093?v=4 url: https://github.com/andre1sk @@ -479,6 +492,9 @@ sponsors: - login: ginomempin avatarUrl: https://avatars.githubusercontent.com/u/6091865?v=4 url: https://github.com/ginomempin +- login: iwpnd + avatarUrl: https://avatars.githubusercontent.com/u/6152183?u=b2286006daafff5f991557344fee20b5da59639a&v=4 + url: https://github.com/iwpnd - login: s3ich4n avatarUrl: https://avatars.githubusercontent.com/u/6926298?u=ba3025d698e1c986655e776ae383a3d60d9d578e&v=4 url: https://github.com/s3ich4n @@ -488,9 +504,6 @@ sponsors: - login: christippett avatarUrl: https://avatars.githubusercontent.com/u/7218120?u=434b9d29287d7de25772d94ddc74a9bd6d969284&v=4 url: https://github.com/christippett -- login: yukiyan - avatarUrl: https://avatars.githubusercontent.com/u/7304122?u=fadb64baf3934c708349bbea1142d260a6b6ce6b&v=4 - url: https://github.com/yukiyan - login: Kludex avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=cf8455cb899806b774a3a71073f88583adec99f6&v=4 url: https://github.com/Kludex @@ -503,18 +516,12 @@ sponsors: - login: cristeaadrian avatarUrl: https://avatars.githubusercontent.com/u/9112724?v=4 url: https://github.com/cristeaadrian -- login: opunsoars - avatarUrl: https://avatars.githubusercontent.com/u/9273060?u=97f5ecec274e159b22787ca2f466f13ab1797758&v=4 - url: https://github.com/opunsoars - login: otivvormes avatarUrl: https://avatars.githubusercontent.com/u/11317418?u=6de1edefb6afd0108c0ad2816bd6efc4464a9c44&v=4 url: https://github.com/otivvormes - login: iambobmae avatarUrl: https://avatars.githubusercontent.com/u/12390270?u=c9a35c2ee5092a9b4135ebb1f91b7f521c467031&v=4 url: https://github.com/iambobmae -- login: Cozmo25 - avatarUrl: https://avatars.githubusercontent.com/u/12619962?u=679dcd6785121e14f6254e9dd0961baf3b1fef5d&v=4 - url: https://github.com/Cozmo25 - login: ronaldnwilliams avatarUrl: https://avatars.githubusercontent.com/u/13632749?u=ac41a086d0728bf66a9d2bee9e5e377041ff44a4&v=4 url: https://github.com/ronaldnwilliams @@ -578,9 +585,6 @@ sponsors: - login: dudikbender avatarUrl: https://avatars.githubusercontent.com/u/53487583?u=494f85229115076121b3639a3806bbac1c6ae7f6&v=4 url: https://github.com/dudikbender -- login: Brontomerus - avatarUrl: https://avatars.githubusercontent.com/u/61284158?u=4aee24daee1921daa722cde3fcb6701e3e37ea31&v=4 - url: https://github.com/Brontomerus - login: primer-io avatarUrl: https://avatars.githubusercontent.com/u/62146168?v=4 url: https://github.com/primer-io @@ -593,24 +597,24 @@ sponsors: - login: anthonycepeda avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=892f700c79f9732211bd5221bf16eec32356a732&v=4 url: https://github.com/anthonycepeda -- login: pqhaa - avatarUrl: https://avatars.githubusercontent.com/u/81242906?u=a71c5869241fc14dea6e413fb4b84287fefed38e&v=4 - url: https://github.com/pqhaa -- login: saldistefano - avatarUrl: https://avatars.githubusercontent.com/u/82109221?v=4 - url: https://github.com/saldistefano - login: linux-china avatarUrl: https://avatars.githubusercontent.com/u/46711?v=4 url: https://github.com/linux-china - login: jhb avatarUrl: https://avatars.githubusercontent.com/u/142217?v=4 url: https://github.com/jhb +- login: yourkin + avatarUrl: https://avatars.githubusercontent.com/u/178984?v=4 + url: https://github.com/yourkin - login: jmagnusson avatarUrl: https://avatars.githubusercontent.com/u/190835?v=4 url: https://github.com/jmagnusson - login: slafs avatarUrl: https://avatars.githubusercontent.com/u/210173?v=4 url: https://github.com/slafs +- login: adamghill + avatarUrl: https://avatars.githubusercontent.com/u/317045?u=f1349d5ffe84a19f324e204777859fbf69ddf633&v=4 + url: https://github.com/adamghill - login: eteq avatarUrl: https://avatars.githubusercontent.com/u/346587?v=4 url: https://github.com/eteq @@ -620,11 +624,11 @@ sponsors: - login: hongqn avatarUrl: https://avatars.githubusercontent.com/u/405587?u=470b4c04832e45141fd5264d3354845cc9fc6466&v=4 url: https://github.com/hongqn -- login: lukin0110 - avatarUrl: https://avatars.githubusercontent.com/u/992275?u=d20b7e18b213ae7004585b382eccb542db5ffe48&v=4 - url: https://github.com/lukin0110 +- login: rinckd + avatarUrl: https://avatars.githubusercontent.com/u/546002?u=1fcc7e664dc86524a0af6837a0c222829c3fd4e5&v=4 + url: https://github.com/rinckd - login: Pytlicek - avatarUrl: https://avatars.githubusercontent.com/u/1430522?v=4 + avatarUrl: https://avatars.githubusercontent.com/u/1430522?u=169dba3bfbc04ed214a914640ff435969f19ddb3&v=4 url: https://github.com/Pytlicek - login: okken avatarUrl: https://avatars.githubusercontent.com/u/1568356?u=0a991a21bdc62e2bea9ad311652f2c45f453dc84&v=4 @@ -635,6 +639,9 @@ sponsors: - login: cbonoz avatarUrl: https://avatars.githubusercontent.com/u/2351087?u=fd3e8030b2cc9fbfbb54a65e9890c548a016f58b&v=4 url: https://github.com/cbonoz +- login: rglsk + avatarUrl: https://avatars.githubusercontent.com/u/2768101?u=e349c88673f2155fe021331377c656a9d74bcc25&v=4 + url: https://github.com/rglsk - login: Atem18 avatarUrl: https://avatars.githubusercontent.com/u/2875254?v=4 url: https://github.com/Atem18 @@ -659,9 +666,6 @@ sponsors: - login: JonasKs avatarUrl: https://avatars.githubusercontent.com/u/5310116?u=98a049f3e1491bffb91e1feb7e93def6881a9389&v=4 url: https://github.com/JonasKs -- login: iwpnd - avatarUrl: https://avatars.githubusercontent.com/u/6152183?u=b2286006daafff5f991557344fee20b5da59639a&v=4 - url: https://github.com/iwpnd - login: holec avatarUrl: https://avatars.githubusercontent.com/u/6438041?u=f5af71ec85b3a9d7b8139cb5af0512b02fa9ab1e&v=4 url: https://github.com/holec @@ -680,6 +684,9 @@ sponsors: - login: hard-coders avatarUrl: https://avatars.githubusercontent.com/u/9651103?u=f2d3d2038c55d86d7f9348f4e6c5e30191e4ee8b&v=4 url: https://github.com/hard-coders +- login: satwikkansal + avatarUrl: https://avatars.githubusercontent.com/u/10217535?u=b12d6ef74ea297de9e46da6933b1a5b7ba9e6a61&v=4 + url: https://github.com/satwikkansal - login: pheanex avatarUrl: https://avatars.githubusercontent.com/u/10408624?u=5b6bab6ee174aa6e991333e06eb29f628741013d&v=4 url: https://github.com/pheanex @@ -689,12 +696,15 @@ sponsors: - login: JimFawkes avatarUrl: https://avatars.githubusercontent.com/u/12075115?u=dc58ecfd064d72887c34bf500ddfd52592509acd&v=4 url: https://github.com/JimFawkes -- login: sebastianmarines - avatarUrl: https://avatars.githubusercontent.com/u/18373185?u=3f74dbd238bd3ab40179323c5906bb162da5b5a7&v=4 - url: https://github.com/sebastianmarines +- login: logan-connolly + avatarUrl: https://avatars.githubusercontent.com/u/16244943?u=8ae66dfbba936463cc8aa0dd7a6d2b4c0cc757eb&v=4 + url: https://github.com/logan-connolly - login: iPr0ger avatarUrl: https://avatars.githubusercontent.com/u/19322290?v=4 url: https://github.com/iPr0ger +- login: sadikkuzu + avatarUrl: https://avatars.githubusercontent.com/u/23168063?u=765ed469c44c004560079210ccdad5b29938eaa9&v=4 + url: https://github.com/sadikkuzu - login: ghandic avatarUrl: https://avatars.githubusercontent.com/u/23500353?u=e2e1d736f924d9be81e8bfc565b6d8836ba99773&v=4 url: https://github.com/ghandic @@ -710,9 +720,6 @@ sponsors: - login: rgreen32 avatarUrl: https://avatars.githubusercontent.com/u/35779241?u=c9d64ad1ab364b6a1ec8e3d859da9ca802d681d8&v=4 url: https://github.com/rgreen32 -- login: leynier - avatarUrl: https://avatars.githubusercontent.com/u/36774373?u=60eee7ab14aada5aab8af6fbd11d14732750a7ab&v=4 - url: https://github.com/leynier - login: askurihin avatarUrl: https://avatars.githubusercontent.com/u/37978981?v=4 url: https://github.com/askurihin @@ -723,10 +730,10 @@ sponsors: avatarUrl: https://avatars.githubusercontent.com/u/40203625?u=9638bfeacfa5940358188f8205ce662bba022b53&v=4 url: https://github.com/JitPackJoyride - login: es3n1n - avatarUrl: https://avatars.githubusercontent.com/u/40367813?u=f562f0f93b108a923be6aba1ec041128286c3c50&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/40367813?u=e881a3880f1e342d19a1ea7c8e1b6d76c52dc294&v=4 url: https://github.com/es3n1n - login: ilias-ant - avatarUrl: https://avatars.githubusercontent.com/u/42189572?u=064bf3a60fcb3c445ab038386321098920b3f4e4&v=4 + avatarUrl: https://avatars.githubusercontent.com/u/42189572?u=a2d6121bac4d125d92ec207460fa3f1842d37e66&v=4 url: https://github.com/ilias-ant - login: kbhatiya999 avatarUrl: https://avatars.githubusercontent.com/u/47816034?v=4 From f78464451073b3f72b65495b2b11ef6ddd869ac4 Mon Sep 17 00:00:00 2001 From: github-actions Date: Fri, 2 Jul 2021 15:18:24 +0000 Subject: [PATCH 49/50] =?UTF-8?q?=F0=9F=93=9D=20Update=20release=20notes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en/docs/release-notes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md index fba17035..32df4ed0 100644 --- a/docs/en/docs/release-notes.md +++ b/docs/en/docs/release-notes.md @@ -2,6 +2,7 @@ ## Latest Changes +* 👥 Update FastAPI People. PR [#3450](https://github.com/tiangolo/fastapi/pull/3450) by [@github-actions[bot]](https://github.com/apps/github-actions). * 🌐 Portuguese translation of Tutorial - Body - Fields. PR [#3420](https://github.com/tiangolo/fastapi/pull/3420) by [@ComicShrimp](https://github.com/ComicShrimp). * 🌐 Add Chinese translation for Tutorial - Request - Forms - and - Files. PR [#3249](https://github.com/tiangolo/fastapi/pull/3249) by [@jaystone776](https://github.com/jaystone776). * 🌐 Add Chinese translation for Tutorial - Handling - Errors. PR [#3299](https://github.com/tiangolo/fastapi/pull/3299) by [@jaystone776](https://github.com/jaystone776). From 8d7b41abfa1d255547a28cfe10db717aeedba62a Mon Sep 17 00:00:00 2001 From: Ruidy Date: Fri, 2 Jul 2021 19:47:51 +0200 Subject: [PATCH 50/50] Apply suggestions from @Smlep Co-authored-by: Sam Courtemanche --- docs/fr/docs/history-design-future.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/fr/docs/history-design-future.md b/docs/fr/docs/history-design-future.md index 1fb39a0a..a9c79ec0 100644 --- a/docs/fr/docs/history-design-future.md +++ b/docs/fr/docs/history-design-future.md @@ -4,7 +4,7 @@ Il y a quelque temps,