From dc2fdd56af0fc9f98179486151650c522530a7e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Wed, 20 Dec 2023 18:05:37 +0100
Subject: [PATCH 001/217] =?UTF-8?q?=F0=9F=91=A5=20Update=20FastAPI=20Peopl?=
=?UTF-8?q?e=20(#10567)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: github-actions
---
docs/en/data/github_sponsors.yml | 97 ++++++++++-----------
docs/en/data/people.yml | 142 +++++++++++++++++--------------
2 files changed, 124 insertions(+), 115 deletions(-)
diff --git a/docs/en/data/github_sponsors.yml b/docs/en/data/github_sponsors.yml
index b9d74ea7b1db3..43b4b8c6b3280 100644
--- a/docs/en/data/github_sponsors.yml
+++ b/docs/en/data/github_sponsors.yml
@@ -1,5 +1,8 @@
sponsors:
-- - login: bump-sh
+- - login: codacy
+ avatarUrl: https://avatars.githubusercontent.com/u/1834093?v=4
+ url: https://github.com/codacy
+ - login: bump-sh
avatarUrl: https://avatars.githubusercontent.com/u/33217836?v=4
url: https://github.com/bump-sh
- login: cryptapi
@@ -11,9 +14,6 @@ sponsors:
- login: fern-api
avatarUrl: https://avatars.githubusercontent.com/u/102944815?v=4
url: https://github.com/fern-api
- - login: nanram22
- avatarUrl: https://avatars.githubusercontent.com/u/116367316?v=4
- url: https://github.com/nanram22
- - login: nihpo
avatarUrl: https://avatars.githubusercontent.com/u/1841030?u=0264956d7580f7e46687a762a7baa629f84cf97c&v=4
url: https://github.com/nihpo
@@ -32,12 +32,12 @@ sponsors:
- login: deepset-ai
avatarUrl: https://avatars.githubusercontent.com/u/51827949?v=4
url: https://github.com/deepset-ai
+ - login: databento
+ avatarUrl: https://avatars.githubusercontent.com/u/64141749?v=4
+ url: https://github.com/databento
- login: svix
avatarUrl: https://avatars.githubusercontent.com/u/80175132?v=4
url: https://github.com/svix
- - login: databento-bot
- avatarUrl: https://avatars.githubusercontent.com/u/98378480?u=494f679996e39427f7ddb1a7de8441b7c96fb670&v=4
- url: https://github.com/databento-bot
- login: VincentParedes
avatarUrl: https://avatars.githubusercontent.com/u/103889729?v=4
url: https://github.com/VincentParedes
@@ -65,10 +65,7 @@ sponsors:
- login: Trivie
avatarUrl: https://avatars.githubusercontent.com/u/8161763?v=4
url: https://github.com/Trivie
-- - login: moellenbeck
- avatarUrl: https://avatars.githubusercontent.com/u/169372?v=4
- url: https://github.com/moellenbeck
- - login: birkjernstrom
+- - login: birkjernstrom
avatarUrl: https://avatars.githubusercontent.com/u/281715?u=4be14b43f76b4bd497b1941309bb390250b405e6&v=4
url: https://github.com/birkjernstrom
- login: yasyf
@@ -83,15 +80,15 @@ sponsors:
- login: mainframeindustries
avatarUrl: https://avatars.githubusercontent.com/u/55092103?v=4
url: https://github.com/mainframeindustries
+ - login: deployplex
+ avatarUrl: https://avatars.githubusercontent.com/u/57115726?v=4
+ url: https://github.com/deployplex
- - login: povilasb
avatarUrl: https://avatars.githubusercontent.com/u/1213442?u=b11f58ed6ceea6e8297c9b310030478ebdac894d&v=4
url: https://github.com/povilasb
- login: primer-io
avatarUrl: https://avatars.githubusercontent.com/u/62146168?v=4
url: https://github.com/primer-io
-- - login: NateXVI
- avatarUrl: https://avatars.githubusercontent.com/u/48195620?u=4bc8751ae50cb087c40c1fe811764aa070b9eea6&v=4
- url: https://github.com/NateXVI
- - login: Kludex
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
@@ -125,12 +122,12 @@ sponsors:
- login: tcsmith
avatarUrl: https://avatars.githubusercontent.com/u/989034?u=7d8d741552b3279e8f4d3878679823a705a46f8f&v=4
url: https://github.com/tcsmith
- - login: mrkmcknz
- avatarUrl: https://avatars.githubusercontent.com/u/1089376?u=2b9b8a8c25c33a4f6c220095638bd821cdfd13a3&v=4
- url: https://github.com/mrkmcknz
- login: mickaelandrieu
avatarUrl: https://avatars.githubusercontent.com/u/1247388?u=599f6e73e452a9453f2bd91e5c3100750e731ad4&v=4
url: https://github.com/mickaelandrieu
+ - login: knallgelb
+ avatarUrl: https://avatars.githubusercontent.com/u/2358812?u=c48cb6362b309d74cbf144bd6ad3aed3eb443e82&v=4
+ url: https://github.com/knallgelb
- login: Shark009
avatarUrl: https://avatars.githubusercontent.com/u/3163309?u=0c6f4091b0eda05c44c390466199826e6dc6e431&v=4
url: https://github.com/Shark009
@@ -174,7 +171,7 @@ sponsors:
avatarUrl: https://avatars.githubusercontent.com/u/6152183?u=c485eefca5c6329600cae63dd35e4f5682ce6924&v=4
url: https://github.com/iwpnd
- login: FernandoCelmer
- avatarUrl: https://avatars.githubusercontent.com/u/6262214?u=ab6108a843a2fb9df0934f482375d2907609f3ff&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/6262214?u=d29fff3fd862fda4ca752079f13f32e84c762ea4&v=4
url: https://github.com/FernandoCelmer
- login: simw
avatarUrl: https://avatars.githubusercontent.com/u/6322526?v=4
@@ -188,6 +185,9 @@ sponsors:
- login: wdwinslow
avatarUrl: https://avatars.githubusercontent.com/u/11562137?u=dc01daafb354135603a263729e3d26d939c0c452&v=4
url: https://github.com/wdwinslow
+ - login: drcat101
+ avatarUrl: https://avatars.githubusercontent.com/u/11951946?u=e714b957185b8cf3d301cced7fc3ad2842122c6a&v=4
+ url: https://github.com/drcat101
- login: jsoques
avatarUrl: https://avatars.githubusercontent.com/u/12414216?u=620921d94196546cc8b9eae2cc4cbc3f95bab42f&v=4
url: https://github.com/jsoques
@@ -212,9 +212,6 @@ sponsors:
- login: Filimoa
avatarUrl: https://avatars.githubusercontent.com/u/21352040?u=0be845711495bbd7b756e13fcaeb8efc1ebd78ba&v=4
url: https://github.com/Filimoa
- - login: rahulsalgare
- avatarUrl: https://avatars.githubusercontent.com/u/21974430?u=ade6f182b94554ab8491d7421de5e78f711dcaf8&v=4
- url: https://github.com/rahulsalgare
- login: BrettskiPy
avatarUrl: https://avatars.githubusercontent.com/u/30988215?u=d8a94a67e140d5ee5427724b292cc52d8827087a&v=4
url: https://github.com/BrettskiPy
@@ -269,9 +266,12 @@ sponsors:
- login: pyt3h
avatarUrl: https://avatars.githubusercontent.com/u/99658549?v=4
url: https://github.com/pyt3h
-- - login: SebTota
- avatarUrl: https://avatars.githubusercontent.com/u/25122511?v=4
- url: https://github.com/SebTota
+ - login: apitally
+ avatarUrl: https://avatars.githubusercontent.com/u/138365043?v=4
+ url: https://github.com/apitally
+- - login: getsentry
+ avatarUrl: https://avatars.githubusercontent.com/u/1396951?v=4
+ url: https://github.com/getsentry
- - login: pawamoy
avatarUrl: https://avatars.githubusercontent.com/u/3999221?u=b030e4c89df2f3a36bc4710b925bdeb6745c9856&v=4
url: https://github.com/pawamoy
@@ -299,6 +299,9 @@ sponsors:
- login: securancy
avatarUrl: https://avatars.githubusercontent.com/u/606673?v=4
url: https://github.com/securancy
+ - login: natehouk
+ avatarUrl: https://avatars.githubusercontent.com/u/805439?u=d8e4be629dc5d7efae7146157e41ee0bd129d9bc&v=4
+ url: https://github.com/natehouk
- login: browniebroke
avatarUrl: https://avatars.githubusercontent.com/u/861044?u=5abfca5588f3e906b31583d7ee62f6de4b68aa24&v=4
url: https://github.com/browniebroke
@@ -323,9 +326,9 @@ sponsors:
- login: anthonycorletti
avatarUrl: https://avatars.githubusercontent.com/u/3477132?v=4
url: https://github.com/anthonycorletti
- - login: nikeee
- avatarUrl: https://avatars.githubusercontent.com/u/4068864?u=bbe73151f2b409c120160d032dc9aa6875ef0c4b&v=4
- url: https://github.com/nikeee
+ - login: erhan
+ avatarUrl: https://avatars.githubusercontent.com/u/3872888?u=cd9a20fcd33c5598d9d7797a78dedfc9148592f6&v=4
+ url: https://github.com/erhan
- login: Alisa-lisa
avatarUrl: https://avatars.githubusercontent.com/u/4137964?u=e7e393504f554f4ff15863a1e01a5746863ef9ce&v=4
url: https://github.com/Alisa-lisa
@@ -366,7 +369,7 @@ sponsors:
avatarUrl: https://avatars.githubusercontent.com/u/8574425?u=aad2a9674273c9275fe414d99269b7418d144089&v=4
url: https://github.com/albertkun
- login: xncbf
- avatarUrl: https://avatars.githubusercontent.com/u/9462045?u=866a1311e4bd3ec5ae84185c4fcc99f397c883d7&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/9462045?u=05cb2d7c797a02f666805ad4639d9582f31d432c&v=4
url: https://github.com/xncbf
- login: DMantis
avatarUrl: https://avatars.githubusercontent.com/u/9536869?v=4
@@ -398,9 +401,6 @@ sponsors:
- login: jangia
avatarUrl: https://avatars.githubusercontent.com/u/17927101?u=9261b9bb0c3e3bb1ecba43e8915dc58d8c9a077e&v=4
url: https://github.com/jangia
- - login: timzaz
- avatarUrl: https://avatars.githubusercontent.com/u/19709244?u=264d7db95c28156363760229c30ee1116efd4eeb&v=4
- url: https://github.com/timzaz
- login: shuheng-liu
avatarUrl: https://avatars.githubusercontent.com/u/22414322?u=813c45f30786c6b511b21a661def025d8f7b609e&v=4
url: https://github.com/shuheng-liu
@@ -419,15 +419,15 @@ sponsors:
- login: joerambo
avatarUrl: https://avatars.githubusercontent.com/u/26282974?v=4
url: https://github.com/joerambo
- - login: msniezynski
- avatarUrl: https://avatars.githubusercontent.com/u/27588547?u=0e3be5ac57dcfdf124f470bcdf74b5bf79af1b6c&v=4
- url: https://github.com/msniezynski
- login: rlnchow
avatarUrl: https://avatars.githubusercontent.com/u/28018479?u=a93ca9cf1422b9ece155784a72d5f2fdbce7adff&v=4
url: https://github.com/rlnchow
- login: mertguvencli
avatarUrl: https://avatars.githubusercontent.com/u/29762151?u=16a906d90df96c8cff9ea131a575c4bc171b1523&v=4
url: https://github.com/mertguvencli
+ - login: White-Mask
+ avatarUrl: https://avatars.githubusercontent.com/u/31826970?u=8625355dc25ddf9c85a8b2b0b9932826c4c8f44c&v=4
+ url: https://github.com/White-Mask
- login: HosamAlmoghraby
avatarUrl: https://avatars.githubusercontent.com/u/32025281?u=aa1b09feabccbf9dc506b81c71155f32d126cefa&v=4
url: https://github.com/HosamAlmoghraby
@@ -435,14 +435,11 @@ sponsors:
avatarUrl: https://avatars.githubusercontent.com/u/33275230?u=eb223cad27017bb1e936ee9b429b450d092d0236&v=4
url: https://github.com/engineerjoe440
- login: bnkc
- avatarUrl: https://avatars.githubusercontent.com/u/34930566?u=1a104991a2ea90bfe304bc0b9ef191c7e4891a0e&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/34930566?u=ea88e4bd668c984cff1bca3e71ab2deb37fafdc4&v=4
url: https://github.com/bnkc
- login: declon
avatarUrl: https://avatars.githubusercontent.com/u/36180226?v=4
url: https://github.com/declon
- - login: miraedbswo
- avatarUrl: https://avatars.githubusercontent.com/u/36796047?u=9e7a5b3e558edc61d35d0f9dfac37541bae7f56d&v=4
- url: https://github.com/miraedbswo
- login: DSMilestone6538
avatarUrl: https://avatars.githubusercontent.com/u/37230924?u=f299dce910366471523155e0cb213356d34aadc1&v=4
url: https://github.com/DSMilestone6538
@@ -458,9 +455,6 @@ sponsors:
- login: ArtyomVancyan
avatarUrl: https://avatars.githubusercontent.com/u/44609997?v=4
url: https://github.com/ArtyomVancyan
- - login: josehenriqueroveda
- avatarUrl: https://avatars.githubusercontent.com/u/46685746?u=2e672057a7dbe1dba47e57c378fc0cac336022eb&v=4
- url: https://github.com/josehenriqueroveda
- login: hgalytoby
avatarUrl: https://avatars.githubusercontent.com/u/50397689?u=f4888c2c54929bd86eed0d3971d09fcb306e5088&v=4
url: https://github.com/hgalytoby
@@ -473,12 +467,18 @@ sponsors:
- login: 0417taehyun
avatarUrl: https://avatars.githubusercontent.com/u/63915557?u=47debaa860fd52c9b98c97ef357ddcec3b3fb399&v=4
url: https://github.com/0417taehyun
+ - login: fernandosmither
+ avatarUrl: https://avatars.githubusercontent.com/u/66154723?u=a76a037b5d674938a75d2cff862fb6dfd63ec214&v=4
+ url: https://github.com/fernandosmither
- login: romabozhanovgithub
avatarUrl: https://avatars.githubusercontent.com/u/67696229?u=e4b921eef096415300425aca249348f8abb78ad7&v=4
url: https://github.com/romabozhanovgithub
- login: mbukeRepo
avatarUrl: https://avatars.githubusercontent.com/u/70356088?u=d2eb23e2b222a3b316c4183b05a3236b32819dc2&v=4
url: https://github.com/mbukeRepo
+ - login: PelicanQ
+ avatarUrl: https://avatars.githubusercontent.com/u/77930606?v=4
+ url: https://github.com/PelicanQ
- - login: ssbarnea
avatarUrl: https://avatars.githubusercontent.com/u/102495?u=b4bf6818deefe59952ac22fec6ed8c76de1b8f7c&v=4
url: https://github.com/ssbarnea
@@ -491,18 +491,15 @@ sponsors:
- login: sadikkuzu
avatarUrl: https://avatars.githubusercontent.com/u/23168063?u=d179c06bb9f65c4167fcab118526819f8e0dac17&v=4
url: https://github.com/sadikkuzu
- - login: samnimoh
- avatarUrl: https://avatars.githubusercontent.com/u/33413170?u=147bc516be6cb647b28d7e3b3fea3a018a331145&v=4
- url: https://github.com/samnimoh
+ - login: msniezynski
+ avatarUrl: https://avatars.githubusercontent.com/u/27588547?u=0e3be5ac57dcfdf124f470bcdf74b5bf79af1b6c&v=4
+ url: https://github.com/msniezynski
- login: danburonline
avatarUrl: https://avatars.githubusercontent.com/u/34251194?u=2cad4388c1544e539ecb732d656e42fb07b4ff2d&v=4
url: https://github.com/danburonline
- login: rwxd
avatarUrl: https://avatars.githubusercontent.com/u/40308458?u=cd04a39e3655923be4f25c2ba8a5a07b3da3230a&v=4
url: https://github.com/rwxd
- - login: shywn-mrk
- avatarUrl: https://avatars.githubusercontent.com/u/51455763?u=389e2608e4056fe5e1f23e9ad56a9415277504d3&v=4
- url: https://github.com/shywn-mrk
- - login: almeida-matheus
- avatarUrl: https://avatars.githubusercontent.com/u/66216198?u=54335eaa0ced626be5c1ff52fead1ebc032286ec&v=4
- url: https://github.com/almeida-matheus
+ - login: IvanReyesO7
+ avatarUrl: https://avatars.githubusercontent.com/u/74359151?u=4b2c368f71e1411b462a8c2290c920ad35dc1af8&v=4
+ url: https://github.com/IvanReyesO7
diff --git a/docs/en/data/people.yml b/docs/en/data/people.yml
index db06cbdafcc6e..2e84f11285cbc 100644
--- a/docs/en/data/people.yml
+++ b/docs/en/data/people.yml
@@ -1,12 +1,12 @@
maintainers:
- login: tiangolo
- answers: 1868
- prs: 496
+ answers: 1870
+ prs: 508
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=740f11212a731f56798f558ceddb0bd07642afa7&v=4
url: https://github.com/tiangolo
experts:
- login: Kludex
- count: 501
+ count: 512
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
- login: dmontagu
@@ -26,21 +26,21 @@ experts:
avatarUrl: https://avatars.githubusercontent.com/u/13659033?u=e8bea32d07a5ef72f7dde3b2079ceb714923ca05&v=4
url: https://github.com/JarroVGIT
- login: jgould22
- count: 168
+ count: 186
avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
url: https://github.com/jgould22
- login: euri10
count: 153
avatarUrl: https://avatars.githubusercontent.com/u/1104190?u=321a2e953e6645a7d09b732786c7a8061e0f8a8b&v=4
url: https://github.com/euri10
+- login: iudeen
+ count: 126
+ avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4
+ url: https://github.com/iudeen
- login: phy25
count: 126
avatarUrl: https://avatars.githubusercontent.com/u/331403?v=4
url: https://github.com/phy25
-- login: iudeen
- count: 122
- avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4
- url: https://github.com/iudeen
- login: raphaelauv
count: 83
avatarUrl: https://avatars.githubusercontent.com/u/10202690?u=e6f86f5c0c3026a15d6b51792fa3e532b12f1371&v=4
@@ -61,14 +61,14 @@ experts:
count: 49
avatarUrl: https://avatars.githubusercontent.com/u/516999?u=437c0c5038558c67e887ccd863c1ba0f846c03da&v=4
url: https://github.com/sm-Fifteen
+- login: yinziyan1206
+ count: 45
+ avatarUrl: https://avatars.githubusercontent.com/u/37829370?u=da44ca53aefd5c23f346fab8e9fd2e108294c179&v=4
+ url: https://github.com/yinziyan1206
- login: acidjunk
count: 45
avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4
url: https://github.com/acidjunk
-- login: insomnes
- count: 45
- avatarUrl: https://avatars.githubusercontent.com/u/16958893?u=f8be7088d5076d963984a21f95f44e559192d912&v=4
- url: https://github.com/insomnes
- login: Dustyposa
count: 45
avatarUrl: https://avatars.githubusercontent.com/u/27180793?u=5cf2877f50b3eb2bc55086089a78a36f07042889&v=4
@@ -77,18 +77,18 @@ experts:
count: 45
avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=612704256e38d6ac9cbed24f10e4b6ac2da74ecb&v=4
url: https://github.com/adriangb
-- login: yinziyan1206
- count: 44
- avatarUrl: https://avatars.githubusercontent.com/u/37829370?u=da44ca53aefd5c23f346fab8e9fd2e108294c179&v=4
- url: https://github.com/yinziyan1206
-- login: odiseo0
- count: 43
- avatarUrl: https://avatars.githubusercontent.com/u/87550035?u=241a71f6b7068738b81af3e57f45ffd723538401&v=4
- url: https://github.com/odiseo0
+- login: insomnes
+ count: 45
+ avatarUrl: https://avatars.githubusercontent.com/u/16958893?u=f8be7088d5076d963984a21f95f44e559192d912&v=4
+ url: https://github.com/insomnes
- login: frankie567
count: 43
avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=c159fe047727aedecbbeeaa96a1b03ceb9d39add&v=4
url: https://github.com/frankie567
+- login: odiseo0
+ count: 43
+ avatarUrl: https://avatars.githubusercontent.com/u/87550035?u=241a71f6b7068738b81af3e57f45ffd723538401&v=4
+ url: https://github.com/odiseo0
- login: includeamin
count: 40
avatarUrl: https://avatars.githubusercontent.com/u/11836741?u=8bd5ef7e62fe6a82055e33c4c0e0a7879ff8cfb6&v=4
@@ -101,14 +101,14 @@ experts:
count: 37
avatarUrl: https://avatars.githubusercontent.com/u/5167622?u=de8f597c81d6336fcebc37b32dfd61a3f877160c&v=4
url: https://github.com/STeveShary
+- login: n8sty
+ count: 36
+ avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
+ url: https://github.com/n8sty
- login: krishnardt
count: 35
avatarUrl: https://avatars.githubusercontent.com/u/31960541?u=47f4829c77f4962ab437ffb7995951e41eeebe9b&v=4
url: https://github.com/krishnardt
-- login: n8sty
- count: 32
- avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
- url: https://github.com/n8sty
- login: panla
count: 32
avatarUrl: https://avatars.githubusercontent.com/u/41326348?u=ba2fda6b30110411ecbf406d187907e2b420ac19&v=4
@@ -137,18 +137,22 @@ experts:
count: 21
avatarUrl: https://avatars.githubusercontent.com/u/51059348?u=5fe59a56e1f2f9ccd8005d71752a8276f133ae1a&v=4
url: https://github.com/rafsaf
-- login: JavierSanchezCastro
+- login: chris-allnutt
count: 20
- avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
- url: https://github.com/JavierSanchezCastro
+ avatarUrl: https://avatars.githubusercontent.com/u/565544?v=4
+ url: https://github.com/chris-allnutt
+- login: ebottos94
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/100039558?u=e2c672da5a7977fd24d87ce6ab35f8bf5b1ed9fa&v=4
+ url: https://github.com/ebottos94
- login: nsidnev
count: 20
avatarUrl: https://avatars.githubusercontent.com/u/22559461?u=a9cc3238217e21dc8796a1a500f01b722adb082c&v=4
url: https://github.com/nsidnev
-- login: chris-allnutt
+- login: JavierSanchezCastro
count: 20
- avatarUrl: https://avatars.githubusercontent.com/u/565544?v=4
- url: https://github.com/chris-allnutt
+ avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
+ url: https://github.com/JavierSanchezCastro
- login: chrisK824
count: 19
avatarUrl: https://avatars.githubusercontent.com/u/79946379?u=03d85b22d696a58a9603e55fbbbe2de6b0f4face&v=4
@@ -161,10 +165,10 @@ experts:
count: 18
avatarUrl: https://avatars.githubusercontent.com/u/24581770?v=4
url: https://github.com/retnikt
-- login: ebottos94
+- login: nymous
count: 17
- avatarUrl: https://avatars.githubusercontent.com/u/100039558?u=e2c672da5a7977fd24d87ce6ab35f8bf5b1ed9fa&v=4
- url: https://github.com/ebottos94
+ avatarUrl: https://avatars.githubusercontent.com/u/4216559?u=360a36fb602cded27273cbfc0afc296eece90662&v=4
+ url: https://github.com/nymous
- login: Hultner
count: 17
avatarUrl: https://avatars.githubusercontent.com/u/2669034?u=115e53df959309898ad8dc9443fbb35fee71df07&v=4
@@ -181,39 +185,47 @@ experts:
count: 17
avatarUrl: https://avatars.githubusercontent.com/u/16540232?u=05d2beb8e034d584d0a374b99d8826327bd7f614&v=4
url: https://github.com/caeser1996
-- login: nymous
+- login: dstlny
count: 16
- avatarUrl: https://avatars.githubusercontent.com/u/4216559?u=360a36fb602cded27273cbfc0afc296eece90662&v=4
- url: https://github.com/nymous
+ avatarUrl: https://avatars.githubusercontent.com/u/41964673?u=9f2174f9d61c15c6e3a4c9e3aeee66f711ce311f&v=4
+ url: https://github.com/dstlny
- login: jonatasoli
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/26334101?u=071c062d2861d3dd127f6b4a5258cd8ef55d4c50&v=4
url: https://github.com/jonatasoli
-- login: dstlny
- count: 16
- avatarUrl: https://avatars.githubusercontent.com/u/41964673?u=9f2174f9d61c15c6e3a4c9e3aeee66f711ce311f&v=4
- url: https://github.com/dstlny
- login: abhint
count: 15
avatarUrl: https://avatars.githubusercontent.com/u/25699289?u=b5d219277b4d001ac26fb8be357fddd88c29d51b&v=4
url: https://github.com/abhint
last_month_active:
+- login: jgould22
+ count: 18
+ avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
+ url: https://github.com/jgould22
- login: Kludex
- count: 8
+ count: 10
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
+- login: White-Mask
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/31826970?u=8625355dc25ddf9c85a8b2b0b9932826c4c8f44c&v=4
+ url: https://github.com/White-Mask
- login: n8sty
- count: 7
+ count: 4
avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
url: https://github.com/n8sty
-- login: chrisK824
+- login: hasansezertasan
count: 4
- avatarUrl: https://avatars.githubusercontent.com/u/79946379?u=03d85b22d696a58a9603e55fbbbe2de6b0f4face&v=4
- url: https://github.com/chrisK824
-- login: danielfcollier
+ avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=e389634d494d503cca867f76c2d00cacc273a46e&v=4
+ url: https://github.com/hasansezertasan
+- login: pythonweb2
count: 3
- avatarUrl: https://avatars.githubusercontent.com/u/38995330?u=5799be795fc310f75f3a5fe9242307d59b194520&v=4
- url: https://github.com/danielfcollier
+ avatarUrl: https://avatars.githubusercontent.com/u/32141163?v=4
+ url: https://github.com/pythonweb2
+- login: ebottos94
+ count: 3
+ avatarUrl: https://avatars.githubusercontent.com/u/100039558?u=e2c672da5a7977fd24d87ce6ab35f8bf5b1ed9fa&v=4
+ url: https://github.com/ebottos94
top_contributors:
- login: waynerv
count: 25
@@ -349,17 +361,17 @@ top_contributors:
url: https://github.com/rostik1410
top_reviewers:
- login: Kludex
- count: 139
+ count: 145
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
+- login: BilalAlpaslan
+ count: 82
+ avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4
+ url: https://github.com/BilalAlpaslan
- login: yezz123
count: 80
avatarUrl: https://avatars.githubusercontent.com/u/52716203?u=d7062cbc6eb7671d5dc9cc0e32a24ae335e0f225&v=4
url: https://github.com/yezz123
-- login: BilalAlpaslan
- count: 79
- avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4
- url: https://github.com/BilalAlpaslan
- login: iudeen
count: 54
avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4
@@ -376,14 +388,14 @@ top_reviewers:
count: 47
avatarUrl: https://avatars.githubusercontent.com/u/59285379?v=4
url: https://github.com/Laineyzhang55
+- login: Xewus
+ count: 47
+ avatarUrl: https://avatars.githubusercontent.com/u/85196001?u=f8e2dc7e5104f109cef944af79050ea8d1b8f914&v=4
+ url: https://github.com/Xewus
- login: ycd
count: 45
avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=bba5af018423a2858d49309bed2a899bb5c34ac5&v=4
url: https://github.com/ycd
-- login: Xewus
- count: 44
- avatarUrl: https://avatars.githubusercontent.com/u/85196001?u=f8e2dc7e5104f109cef944af79050ea8d1b8f914&v=4
- url: https://github.com/Xewus
- login: cikay
count: 41
avatarUrl: https://avatars.githubusercontent.com/u/24587499?u=e772190a051ab0eaa9c8542fcff1892471638f2b&v=4
@@ -412,14 +424,14 @@ top_reviewers:
count: 26
avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4
url: https://github.com/lsglucas
+- login: Ryandaydev
+ count: 25
+ avatarUrl: https://avatars.githubusercontent.com/u/4292423?u=ba0eea19429e7cf77cf2ab8ad2f3d3af202bc1cf&v=4
+ url: https://github.com/Ryandaydev
- login: LorhanSohaky
count: 24
avatarUrl: https://avatars.githubusercontent.com/u/16273730?u=095b66f243a2cd6a0aadba9a095009f8aaf18393&v=4
url: https://github.com/LorhanSohaky
-- login: Ryandaydev
- count: 24
- avatarUrl: https://avatars.githubusercontent.com/u/4292423?u=809f3d1074d04bbc28012a7f17f06ea56f5bd71a&v=4
- url: https://github.com/Ryandaydev
- login: dmontagu
count: 23
avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=540f30c937a6450812628b9592a1dfe91bbe148e&v=4
@@ -476,14 +488,14 @@ top_reviewers:
count: 15
avatarUrl: https://avatars.githubusercontent.com/u/63476957?u=6c86e59b48e0394d4db230f37fc9ad4d7e2c27c7&v=4
url: https://github.com/delhi09
+- login: peidrao
+ count: 14
+ avatarUrl: https://avatars.githubusercontent.com/u/32584628?u=a66902b40c13647d0ed0e573d598128240a4dd04&v=4
+ url: https://github.com/peidrao
- login: sh0nk
count: 13
avatarUrl: https://avatars.githubusercontent.com/u/6478810?u=af15d724875cec682ed8088a86d36b2798f981c0&v=4
url: https://github.com/sh0nk
-- login: peidrao
- count: 13
- avatarUrl: https://avatars.githubusercontent.com/u/32584628?u=a66902b40c13647d0ed0e573d598128240a4dd04&v=4
- url: https://github.com/peidrao
- login: wdh99
count: 13
avatarUrl: https://avatars.githubusercontent.com/u/108172295?u=8a8fb95d5afe3e0fa33257b2aecae88d436249eb&v=4
From e7756ae7dcffa0b73767d354ca158fd6b7bc87ed Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 20 Dec 2023 17:06:01 +0000
Subject: [PATCH 002/217] =?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 | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 835df984ce4c1..b8b6f9ae947ee 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,8 @@ hide:
## Latest Changes
+* ð¥ Update FastAPI People. PR [#10567](https://github.com/tiangolo/fastapi/pull/10567) by [@tiangolo](https://github.com/tiangolo).
+
## 0.105.0
### Features
From a4aa79e0b4cacc6b428d415d04d234a8c77af9d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Mon, 25 Dec 2023 18:57:35 +0100
Subject: [PATCH 003/217] =?UTF-8?q?=E2=9C=A8=20Add=20support=20for=20raisi?=
=?UTF-8?q?ng=20exceptions=20(including=20`HTTPException`)=20in=20dependen?=
=?UTF-8?q?cies=20with=20`yield`=20in=20the=20exit=20code,=20do=20not=20su?=
=?UTF-8?q?pport=20them=20in=20background=20tasks=20(#10831)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* â»ïž Refactor dependency AsyncExitStack logic, exit dependencies after creating the response, before sending it
* â
Update tests for dependencies exit, check they are finished before the response is sent
* ð¥ Remove ExitAsyncStackMiddleware as it's no longer needed
* ð Update docs for dependencies with yield
* ð Update release notes
* ð Add source examples for new dependencies with yield raising
* â
Add tests for new dependencies raising after yield
* ð Update release notes
---
docs/en/docs/release-notes.md | 102 ++++++++
.../dependencies/dependencies-with-yield.md | 95 ++++---
docs_src/dependencies/tutorial008b.py | 30 +++
docs_src/dependencies/tutorial008b_an.py | 31 +++
docs_src/dependencies/tutorial008b_an_py39.py | 32 +++
fastapi/applications.py | 52 ----
fastapi/concurrency.py | 1 -
fastapi/dependencies/utils.py | 9 +-
fastapi/middleware/asyncexitstack.py | 25 --
fastapi/routing.py | 231 ++++++++++--------
pyproject.toml | 9 +
tests/test_dependency_contextmanager.py | 20 +-
.../test_dependencies/test_tutorial008b.py | 23 ++
.../test_dependencies/test_tutorial008b_an.py | 23 ++
.../test_tutorial008b_an_py39.py | 23 ++
15 files changed, 492 insertions(+), 214 deletions(-)
create mode 100644 docs_src/dependencies/tutorial008b.py
create mode 100644 docs_src/dependencies/tutorial008b_an.py
create mode 100644 docs_src/dependencies/tutorial008b_an_py39.py
delete mode 100644 fastapi/middleware/asyncexitstack.py
create mode 100644 tests/test_tutorial/test_dependencies/test_tutorial008b.py
create mode 100644 tests/test_tutorial/test_dependencies/test_tutorial008b_an.py
create mode 100644 tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index b8b6f9ae947ee..12bc12d260e32 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,108 @@ hide:
## Latest Changes
+### Dependencies with `yield`, `HTTPException` and Background Tasks
+
+Dependencies with `yield` now can raise `HTTPException` and other exceptions after `yield`. ð
+
+Read the new docs here: [Dependencies with `yield` and `HTTPException`](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#dependencies-with-yield-and-httpexception).
+
+```Python
+from fastapi import Depends, FastAPI, HTTPException
+from typing_extensions import Annotated
+
+app = FastAPI()
+
+
+data = {
+ "plumbus": {"description": "Freshly pickled plumbus", "owner": "Morty"},
+ "portal-gun": {"description": "Gun to create portals", "owner": "Rick"},
+}
+
+
+class OwnerError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except OwnerError as e:
+ raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
+ if item_id not in data:
+ raise HTTPException(status_code=404, detail="Item not found")
+ item = data[item_id]
+ if item["owner"] != username:
+ raise OwnerError(username)
+ return item
+```
+
+---
+
+Before FastAPI 0.106.0, raising exceptions after `yield` was not possible, the exit code in dependencies with `yield` was executed *after* the response was sent, so [Exception Handlers](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank} would have already run.
+
+This was designed this way mainly to allow using the same objects "yielded" by dependencies inside of background tasks, because the exit code would be executed after the background tasks were finished.
+
+Nevertheless, as this would mean waiting for the response to travel through the network while unnecessarily holding a resource in a dependency with yield (for example a database connection), this was changed in FastAPI 0.106.0.
+
+Additionally, a background task is normally an independent set of logic that should be handled separately, with its own resources (e.g. its own database connection).
+
+If you used to rely on this behavior, now you should create the resources for background tasks inside the background task itself, and use internally only data that doesn't depend on the resources of dependencies with `yield`.
+
+For example, instead of using the same database session, you would create a new database session inside of the background task, and you would obtain the objects from the database using this new session. And then instead of passing the object from the database as a parameter to the background task function, you would pass the ID of that object and then obtain the object again inside the background task function.
+
+The sequence of execution before FastAPI 0.106.0 was like this diagram:
+
+Time flows from top to bottom. And each column is one of the parts interacting or executing code.
+
+```mermaid
+sequenceDiagram
+
+participant client as Client
+participant handler as Exception handler
+participant dep as Dep with yield
+participant operation as Path Operation
+participant tasks as Background tasks
+
+ Note over client,tasks: Can raise exception for dependency, handled after response is sent
+ Note over client,operation: Can raise HTTPException and can change the response
+ client ->> dep: Start request
+ Note over dep: Run code up to yield
+ opt raise
+ dep -->> handler: Raise HTTPException
+ handler -->> client: HTTP error response
+ dep -->> dep: Raise other exception
+ end
+ dep ->> operation: Run dependency, e.g. DB session
+ opt raise
+ operation -->> dep: Raise HTTPException
+ dep -->> handler: Auto forward exception
+ handler -->> client: HTTP error response
+ operation -->> dep: Raise other exception
+ dep -->> handler: Auto forward exception
+ end
+ operation ->> client: Return response to client
+ Note over client,operation: Response is already sent, can't change it anymore
+ opt Tasks
+ operation -->> tasks: Send background tasks
+ end
+ opt Raise other exception
+ tasks -->> dep: Raise other exception
+ end
+ Note over dep: After yield
+ opt Handle other exception
+ dep -->> dep: Handle exception, can't change response. E.g. close DB session.
+ end
+```
+
+The new execution flow can be found in the docs: [Execution of dependencies with `yield`](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#execution-of-dependencies-with-yield).
+
+### Internal
+
* ð¥ Update FastAPI People. PR [#10567](https://github.com/tiangolo/fastapi/pull/10567) by [@tiangolo](https://github.com/tiangolo).
## 0.105.0
diff --git a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
index fe18f1f1d9afe..4ead4682cba9a 100644
--- a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
+++ b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -1,8 +1,8 @@
# Dependencies with yield
-FastAPI supports dependencies that do some extra steps after finishing .
+FastAPI supports dependencies that do some extra steps after finishing .
-To do this, use `yield` instead of `return`, and write the extra steps after.
+To do this, use `yield` instead of `return`, and write the extra steps (code) after.
!!! tip
Make sure to use `yield` one single time.
@@ -21,7 +21,7 @@ To do this, use `yield` instead of `return`, and write the extra steps after.
For example, you could use this to create a database session and close it after finishing.
-Only the code prior to and including the `yield` statement is executed before sending a response:
+Only the code prior to and including the `yield` statement is executed before creating a response:
```Python hl_lines="2-4"
{!../../../docs_src/dependencies/tutorial007.py!}
@@ -40,7 +40,7 @@ The code following the `yield` statement is executed after the response has been
```
!!! tip
- You can use `async` or normal functions.
+ You can use `async` or regular functions.
**FastAPI** will do the right thing with each, the same as with normal dependencies.
@@ -114,7 +114,7 @@ And, in turn, `dependency_b` needs the value from `dependency_a` (here named `de
{!> ../../../docs_src/dependencies/tutorial008.py!}
```
-The same way, you could have dependencies with `yield` and `return` mixed.
+The same way, you could have some dependencies with `yield` and some other dependencies with `return`, and have some of those depend on some of the others.
And you could have a single dependency that requires several other dependencies with `yield`, etc.
@@ -131,24 +131,38 @@ You can have any combinations of dependencies that you want.
You saw that you can use dependencies with `yield` and have `try` blocks that catch exceptions.
-It might be tempting to raise an `HTTPException` or similar in the exit code, after the `yield`. But **it won't work**.
+The same way, you could raise an `HTTPException` or similar in the exit code, after the `yield`.
-The exit code in dependencies with `yield` is executed *after* the response is sent, so [Exception Handlers](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank} will have already run. There's nothing catching exceptions thrown by your dependencies in the exit code (after the `yield`).
+!!! tip
-So, if you raise an `HTTPException` after the `yield`, the default (or any custom) exception handler that catches `HTTPException`s and returns an HTTP 400 response won't be there to catch that exception anymore.
+ This is a somewhat advanced technique, and in most of the cases you won't really need it, as you can raise exceptions (including `HTTPException`) from inside of the rest of your application code, for example, in the *path operation function*.
-This is what allows anything set in the dependency (e.g. a DB session) to, for example, be used by background tasks.
+ But it's there for you if you need it. ð€
-Background tasks are run *after* the response has been sent. So there's no way to raise an `HTTPException` because there's not even a way to change the response that is *already sent*.
+=== "Python 3.9+"
-But if a background task creates a DB error, at least you can rollback or cleanly close the session in the dependency with `yield`, and maybe log the error or report it to a remote tracking system.
+ ```Python hl_lines="18-22 31"
+ {!> ../../../docs_src/dependencies/tutorial008b_an_py39.py!}
+ ```
-If you have some code that you know could raise an exception, do the most normal/"Pythonic" thing and add a `try` block in that section of the code.
+=== "Python 3.8+"
-If you have custom exceptions that you would like to handle *before* returning the response and possibly modifying the response, maybe even raising an `HTTPException`, create a [Custom Exception Handler](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
+ ```Python hl_lines="17-21 30"
+ {!> ../../../docs_src/dependencies/tutorial008b_an.py!}
+ ```
-!!! tip
- You can still raise exceptions including `HTTPException` *before* the `yield`. But not after.
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ Prefer to use the `Annotated` version if possible.
+
+ ```Python hl_lines="16-20 29"
+ {!> ../../../docs_src/dependencies/tutorial008b.py!}
+ ```
+
+An alternative you could use to catch exceptions (and possibly also raise another `HTTPException`) is ot create a [Custom Exception Handler](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
+
+## Execution of dependencies with `yield`
The sequence of execution is more or less like this diagram. Time flows from top to bottom. And each column is one of the parts interacting or executing code.
@@ -161,34 +175,30 @@ participant dep as Dep with yield
participant operation as Path Operation
participant tasks as Background tasks
- Note over client,tasks: Can raise exception for dependency, handled after response is sent
- Note over client,operation: Can raise HTTPException and can change the response
+ Note over client,operation: Can raise exceptions, including HTTPException
client ->> dep: Start request
Note over dep: Run code up to yield
- opt raise
- dep -->> handler: Raise HTTPException
+ opt raise Exception
+ dep -->> handler: Raise Exception
handler -->> client: HTTP error response
- dep -->> dep: Raise other exception
end
dep ->> operation: Run dependency, e.g. DB session
opt raise
- operation -->> dep: Raise HTTPException
- dep -->> handler: Auto forward exception
+ operation -->> dep: Raise Exception (e.g. HTTPException)
+ opt handle
+ dep -->> dep: Can catch exception, raise a new HTTPException, raise other exception
+ dep -->> handler: Auto forward exception
+ end
handler -->> client: HTTP error response
- operation -->> dep: Raise other exception
- dep -->> handler: Auto forward exception
end
+
operation ->> client: Return response to client
Note over client,operation: Response is already sent, can't change it anymore
opt Tasks
operation -->> tasks: Send background tasks
end
opt Raise other exception
- tasks -->> dep: Raise other exception
- end
- Note over dep: After yield
- opt Handle other exception
- dep -->> dep: Handle exception, can't change response. E.g. close DB session.
+ tasks -->> tasks: Handle exceptions in the background task code
end
```
@@ -198,10 +208,33 @@ participant tasks as Background tasks
After one of those responses is sent, no other response can be sent.
!!! tip
- This diagram shows `HTTPException`, but you could also raise any other exception for which you create a [Custom Exception Handler](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
+ This diagram shows `HTTPException`, but you could also raise any other exception that you catch in a dependency with `yield` or with a [Custom Exception Handler](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
If you raise any exception, it will be passed to the dependencies with yield, including `HTTPException`, and then **again** to the exception handlers. If there's no exception handler for that exception, it will then be handled by the default internal `ServerErrorMiddleware`, returning a 500 HTTP status code, to let the client know that there was an error in the server.
+## Dependencies with `yield`, `HTTPException` and Background Tasks
+
+!!! warning
+ You most probably don't need these technical details, you can skip this section and continue below.
+
+ These details are useful mainly if you were using a version of FastAPI prior to 0.106.0 and used resources from dependencies with `yield` in background tasks.
+
+Before FastAPI 0.106.0, raising exceptions after `yield` was not possible, the exit code in dependencies with `yield` was executed *after* the response was sent, so [Exception Handlers](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank} would have already run.
+
+This was designed this way mainly to allow using the same objects "yielded" by dependencies inside of background tasks, because the exit code would be executed after the background tasks were finished.
+
+Nevertheless, as this would mean waiting for the response to travel through the network while unnecessarily holding a resource in a dependency with yield (for example a database connection), this was changed in FastAPI 0.106.0.
+
+!!! tip
+
+ Additionally, a background task is normally an independent set of logic that should be handled separately, with its own resources (e.g. its own database connection).
+
+ So, this way you will probably have cleaner code.
+
+If you used to rely on this behavior, now you should create the resources for background tasks inside the background task itself, and use internally only data that doesn't depend on the resources of dependencies with `yield`.
+
+For example, instead of using the same database session, you would create a new database session inside of the background task, and you would obtain the objects from the database using this new session. And then instead of passing the object from the database as a parameter to the background task function, you would pass the ID of that object and then obtain the object again inside the background task function.
+
## Context Managers
### What are "Context Managers"
@@ -220,7 +253,7 @@ Underneath, the `open("./somefile.txt")` creates an object that is a called a "C
When the `with` block finishes, it makes sure to close the file, even if there were exceptions.
-When you create a dependency with `yield`, **FastAPI** will internally convert it to a context manager, and combine it with some other related tools.
+When you create a dependency with `yield`, **FastAPI** will internally create a context manager for it, and combine it with some other related tools.
### Using context managers in dependencies with `yield`
diff --git a/docs_src/dependencies/tutorial008b.py b/docs_src/dependencies/tutorial008b.py
new file mode 100644
index 0000000000000..4a1a70dcfcda9
--- /dev/null
+++ b/docs_src/dependencies/tutorial008b.py
@@ -0,0 +1,30 @@
+from fastapi import Depends, FastAPI, HTTPException
+
+app = FastAPI()
+
+
+data = {
+ "plumbus": {"description": "Freshly pickled plumbus", "owner": "Morty"},
+ "portal-gun": {"description": "Gun to create portals", "owner": "Rick"},
+}
+
+
+class OwnerError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except OwnerError as e:
+ raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: str = Depends(get_username)):
+ if item_id not in data:
+ raise HTTPException(status_code=404, detail="Item not found")
+ item = data[item_id]
+ if item["owner"] != username:
+ raise OwnerError(username)
+ return item
diff --git a/docs_src/dependencies/tutorial008b_an.py b/docs_src/dependencies/tutorial008b_an.py
new file mode 100644
index 0000000000000..3a0f1399a98f4
--- /dev/null
+++ b/docs_src/dependencies/tutorial008b_an.py
@@ -0,0 +1,31 @@
+from fastapi import Depends, FastAPI, HTTPException
+from typing_extensions import Annotated
+
+app = FastAPI()
+
+
+data = {
+ "plumbus": {"description": "Freshly pickled plumbus", "owner": "Morty"},
+ "portal-gun": {"description": "Gun to create portals", "owner": "Rick"},
+}
+
+
+class OwnerError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except OwnerError as e:
+ raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
+ if item_id not in data:
+ raise HTTPException(status_code=404, detail="Item not found")
+ item = data[item_id]
+ if item["owner"] != username:
+ raise OwnerError(username)
+ return item
diff --git a/docs_src/dependencies/tutorial008b_an_py39.py b/docs_src/dependencies/tutorial008b_an_py39.py
new file mode 100644
index 0000000000000..30c9cdc699c2e
--- /dev/null
+++ b/docs_src/dependencies/tutorial008b_an_py39.py
@@ -0,0 +1,32 @@
+from typing import Annotated
+
+from fastapi import Depends, FastAPI, HTTPException
+
+app = FastAPI()
+
+
+data = {
+ "plumbus": {"description": "Freshly pickled plumbus", "owner": "Morty"},
+ "portal-gun": {"description": "Gun to create portals", "owner": "Rick"},
+}
+
+
+class OwnerError(Exception):
+ pass
+
+
+def get_username():
+ try:
+ yield "Rick"
+ except OwnerError as e:
+ raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
+
+
+@app.get("/items/{item_id}")
+def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
+ if item_id not in data:
+ raise HTTPException(status_code=404, detail="Item not found")
+ item = data[item_id]
+ if item["owner"] != username:
+ raise OwnerError(username)
+ return item
diff --git a/fastapi/applications.py b/fastapi/applications.py
index 3021d75937d1c..597c60a56788f 100644
--- a/fastapi/applications.py
+++ b/fastapi/applications.py
@@ -22,7 +22,6 @@
)
from fastapi.exceptions import RequestValidationError, WebSocketRequestValidationError
from fastapi.logger import logger
-from fastapi.middleware.asyncexitstack import AsyncExitStackMiddleware
from fastapi.openapi.docs import (
get_redoc_html,
get_swagger_ui_html,
@@ -37,8 +36,6 @@
from starlette.exceptions import HTTPException
from starlette.middleware import Middleware
from starlette.middleware.base import BaseHTTPMiddleware
-from starlette.middleware.errors import ServerErrorMiddleware
-from starlette.middleware.exceptions import ExceptionMiddleware
from starlette.requests import Request
from starlette.responses import HTMLResponse, JSONResponse, Response
from starlette.routing import BaseRoute
@@ -966,55 +963,6 @@ class Item(BaseModel):
self.middleware_stack: Union[ASGIApp, None] = None
self.setup()
- def build_middleware_stack(self) -> ASGIApp:
- # Duplicate/override from Starlette to add AsyncExitStackMiddleware
- # inside of ExceptionMiddleware, inside of custom user middlewares
- debug = self.debug
- error_handler = None
- exception_handlers = {}
-
- for key, value in self.exception_handlers.items():
- if key in (500, Exception):
- error_handler = value
- else:
- exception_handlers[key] = value
-
- middleware = (
- [Middleware(ServerErrorMiddleware, handler=error_handler, debug=debug)]
- + self.user_middleware
- + [
- Middleware(
- ExceptionMiddleware, handlers=exception_handlers, debug=debug
- ),
- # Add FastAPI-specific AsyncExitStackMiddleware for dependencies with
- # contextvars.
- # This needs to happen after user middlewares because those create a
- # new contextvars context copy by using a new AnyIO task group.
- # The initial part of dependencies with 'yield' is executed in the
- # FastAPI code, inside all the middlewares. However, the teardown part
- # (after 'yield') is executed in the AsyncExitStack in this middleware.
- # If the AsyncExitStack lived outside of the custom middlewares and
- # contextvars were set in a dependency with 'yield' in that internal
- # contextvars context, the values would not be available in the
- # outer context of the AsyncExitStack.
- # By placing the middleware and the AsyncExitStack here, inside all
- # user middlewares, the code before and after 'yield' in dependencies
- # with 'yield' is executed in the same contextvars context. Thus, all values
- # set in contextvars before 'yield' are still available after 'yield,' as
- # expected.
- # Additionally, by having this AsyncExitStack here, after the
- # ExceptionMiddleware, dependencies can now catch handled exceptions,
- # e.g. HTTPException, to customize the teardown code (e.g. DB session
- # rollback).
- Middleware(AsyncExitStackMiddleware),
- ]
- )
-
- app = self.router
- for cls, options in reversed(middleware):
- app = cls(app=app, **options)
- return app
-
def openapi(self) -> Dict[str, Any]:
"""
Generate the OpenAPI schema of the application. This is called by FastAPI
diff --git a/fastapi/concurrency.py b/fastapi/concurrency.py
index 754061c862dad..894bd3ed11873 100644
--- a/fastapi/concurrency.py
+++ b/fastapi/concurrency.py
@@ -1,4 +1,3 @@
-from contextlib import AsyncExitStack as AsyncExitStack # noqa
from contextlib import asynccontextmanager as asynccontextmanager
from typing import AsyncGenerator, ContextManager, TypeVar
diff --git a/fastapi/dependencies/utils.py b/fastapi/dependencies/utils.py
index 4e88410a5ec1f..b73473484159c 100644
--- a/fastapi/dependencies/utils.py
+++ b/fastapi/dependencies/utils.py
@@ -1,5 +1,5 @@
import inspect
-from contextlib import contextmanager
+from contextlib import AsyncExitStack, contextmanager
from copy import deepcopy
from typing import (
Any,
@@ -46,7 +46,6 @@
)
from fastapi.background import BackgroundTasks
from fastapi.concurrency import (
- AsyncExitStack,
asynccontextmanager,
contextmanager_in_threadpool,
)
@@ -529,6 +528,7 @@ async def solve_dependencies(
response: Optional[Response] = None,
dependency_overrides_provider: Optional[Any] = None,
dependency_cache: Optional[Dict[Tuple[Callable[..., Any], Tuple[str]], Any]] = None,
+ async_exit_stack: AsyncExitStack,
) -> Tuple[
Dict[str, Any],
List[Any],
@@ -575,6 +575,7 @@ async def solve_dependencies(
response=response,
dependency_overrides_provider=dependency_overrides_provider,
dependency_cache=dependency_cache,
+ async_exit_stack=async_exit_stack,
)
(
sub_values,
@@ -590,10 +591,8 @@ async def solve_dependencies(
if sub_dependant.use_cache and sub_dependant.cache_key in dependency_cache:
solved = dependency_cache[sub_dependant.cache_key]
elif is_gen_callable(call) or is_async_gen_callable(call):
- stack = request.scope.get("fastapi_astack")
- assert isinstance(stack, AsyncExitStack)
solved = await solve_generator(
- call=call, stack=stack, sub_values=sub_values
+ call=call, stack=async_exit_stack, sub_values=sub_values
)
elif is_coroutine_callable(call):
solved = await call(**sub_values)
diff --git a/fastapi/middleware/asyncexitstack.py b/fastapi/middleware/asyncexitstack.py
deleted file mode 100644
index 30a0ae626c26c..0000000000000
--- a/fastapi/middleware/asyncexitstack.py
+++ /dev/null
@@ -1,25 +0,0 @@
-from typing import Optional
-
-from fastapi.concurrency import AsyncExitStack
-from starlette.types import ASGIApp, Receive, Scope, Send
-
-
-class AsyncExitStackMiddleware:
- def __init__(self, app: ASGIApp, context_name: str = "fastapi_astack") -> None:
- self.app = app
- self.context_name = context_name
-
- async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
- dependency_exception: Optional[Exception] = None
- async with AsyncExitStack() as stack:
- scope[self.context_name] = stack
- try:
- await self.app(scope, receive, send)
- except Exception as e:
- dependency_exception = e
- raise e
- if dependency_exception:
- # This exception was possibly handled by the dependency but it should
- # still bubble up so that the ServerErrorMiddleware can return a 500
- # or the ExceptionMiddleware can catch and handle any other exceptions
- raise dependency_exception
diff --git a/fastapi/routing.py b/fastapi/routing.py
index 54d53bbbfb812..589ecca2aaf73 100644
--- a/fastapi/routing.py
+++ b/fastapi/routing.py
@@ -216,95 +216,124 @@ def get_request_handler(
actual_response_class = response_class
async def app(request: Request) -> Response:
- try:
- body: Any = None
- if body_field:
- if is_body_form:
- body = await request.form()
- stack = request.scope.get("fastapi_astack")
- assert isinstance(stack, AsyncExitStack)
- stack.push_async_callback(body.close)
+ exception_to_reraise: Optional[Exception] = None
+ response: Union[Response, None] = None
+ async with AsyncExitStack() as async_exit_stack:
+ # TODO: remove this scope later, after a few releases
+ # This scope fastapi_astack is no longer used by FastAPI, kept for
+ # compatibility, just in case
+ request.scope["fastapi_astack"] = async_exit_stack
+ try:
+ body: Any = None
+ if body_field:
+ if is_body_form:
+ body = await request.form()
+ async_exit_stack.push_async_callback(body.close)
+ else:
+ body_bytes = await request.body()
+ if body_bytes:
+ json_body: Any = Undefined
+ content_type_value = request.headers.get("content-type")
+ if not content_type_value:
+ json_body = await request.json()
+ else:
+ 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:
+ validation_error = RequestValidationError(
+ [
+ {
+ "type": "json_invalid",
+ "loc": ("body", e.pos),
+ "msg": "JSON decode error",
+ "input": {},
+ "ctx": {"error": e.msg},
+ }
+ ],
+ body=e.doc,
+ )
+ exception_to_reraise = validation_error
+ raise validation_error from e
+ except HTTPException as e:
+ exception_to_reraise = e
+ raise
+ except Exception as e:
+ http_error = HTTPException(
+ status_code=400, detail="There was an error parsing the body"
+ )
+ exception_to_reraise = http_error
+ raise http_error from e
+ try:
+ solved_result = await solve_dependencies(
+ request=request,
+ dependant=dependant,
+ body=body,
+ dependency_overrides_provider=dependency_overrides_provider,
+ async_exit_stack=async_exit_stack,
+ )
+ values, errors, background_tasks, sub_response, _ = solved_result
+ except Exception as e:
+ exception_to_reraise = e
+ raise e
+ if errors:
+ validation_error = RequestValidationError(
+ _normalize_errors(errors), body=body
+ )
+ exception_to_reraise = validation_error
+ raise validation_error
+ else:
+ try:
+ raw_response = await run_endpoint_function(
+ dependant=dependant, values=values, is_coroutine=is_coroutine
+ )
+ except Exception as e:
+ exception_to_reraise = e
+ raise e
+ if isinstance(raw_response, Response):
+ if raw_response.background is None:
+ raw_response.background = background_tasks
+ response = raw_response
else:
- body_bytes = await request.body()
- if body_bytes:
- json_body: Any = Undefined
- content_type_value = request.headers.get("content-type")
- if not content_type_value:
- json_body = await request.json()
- else:
- 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(
- [
- {
- "type": "json_invalid",
- "loc": ("body", e.pos),
- "msg": "JSON decode error",
- "input": {},
- "ctx": {"error": e.msg},
- }
- ],
- body=e.doc,
- ) from e
- except HTTPException:
- raise
- except Exception as e:
- raise HTTPException(
- status_code=400, detail="There was an error parsing the body"
- ) from e
- solved_result = await solve_dependencies(
- request=request,
- dependant=dependant,
- body=body,
- dependency_overrides_provider=dependency_overrides_provider,
- )
- values, errors, background_tasks, sub_response, _ = solved_result
- if errors:
- raise RequestValidationError(_normalize_errors(errors), body=body)
- else:
- raw_response = await run_endpoint_function(
- dependant=dependant, values=values, is_coroutine=is_coroutine
- )
-
- if isinstance(raw_response, Response):
- if raw_response.background is None:
- raw_response.background = background_tasks
- return raw_response
- response_args: Dict[str, Any] = {"background": background_tasks}
- # If status_code was set, use it, otherwise use the default from the
- # response class, in the case of redirect it's 307
- current_status_code = (
- status_code if status_code else sub_response.status_code
- )
- if current_status_code is not None:
- response_args["status_code"] = current_status_code
- if sub_response.status_code:
- response_args["status_code"] = sub_response.status_code
- content = await serialize_response(
- field=response_field,
- response_content=raw_response,
- include=response_model_include,
- exclude=response_model_exclude,
- by_alias=response_model_by_alias,
- exclude_unset=response_model_exclude_unset,
- exclude_defaults=response_model_exclude_defaults,
- exclude_none=response_model_exclude_none,
- is_coroutine=is_coroutine,
- )
- response = actual_response_class(content, **response_args)
- if not is_body_allowed_for_status_code(response.status_code):
- response.body = b""
- response.headers.raw.extend(sub_response.headers.raw)
- return response
+ response_args: Dict[str, Any] = {"background": background_tasks}
+ # If status_code was set, use it, otherwise use the default from the
+ # response class, in the case of redirect it's 307
+ current_status_code = (
+ status_code if status_code else sub_response.status_code
+ )
+ if current_status_code is not None:
+ response_args["status_code"] = current_status_code
+ if sub_response.status_code:
+ response_args["status_code"] = sub_response.status_code
+ content = await serialize_response(
+ field=response_field,
+ response_content=raw_response,
+ include=response_model_include,
+ exclude=response_model_exclude,
+ by_alias=response_model_by_alias,
+ exclude_unset=response_model_exclude_unset,
+ exclude_defaults=response_model_exclude_defaults,
+ exclude_none=response_model_exclude_none,
+ is_coroutine=is_coroutine,
+ )
+ response = actual_response_class(content, **response_args)
+ if not is_body_allowed_for_status_code(response.status_code):
+ response.body = b""
+ response.headers.raw.extend(sub_response.headers.raw)
+ # This exception was possibly handled by the dependency but it should
+ # still bubble up so that the ServerErrorMiddleware can return a 500
+ # or the ExceptionMiddleware can catch and handle any other exceptions
+ if exception_to_reraise:
+ raise exception_to_reraise
+ assert response is not None, "An error occurred while generating the request"
+ return response
return app
@@ -313,16 +342,22 @@ def get_websocket_app(
dependant: Dependant, dependency_overrides_provider: Optional[Any] = None
) -> Callable[[WebSocket], Coroutine[Any, Any, Any]]:
async def app(websocket: WebSocket) -> None:
- solved_result = await solve_dependencies(
- request=websocket,
- dependant=dependant,
- dependency_overrides_provider=dependency_overrides_provider,
- )
- values, errors, _, _2, _3 = solved_result
- if errors:
- raise WebSocketRequestValidationError(_normalize_errors(errors))
- assert dependant.call is not None, "dependant.call must be a function"
- await dependant.call(**values)
+ async with AsyncExitStack() as async_exit_stack:
+ # TODO: remove this scope later, after a few releases
+ # This scope fastapi_astack is no longer used by FastAPI, kept for
+ # compatibility, just in case
+ websocket.scope["fastapi_astack"] = async_exit_stack
+ solved_result = await solve_dependencies(
+ request=websocket,
+ dependant=dependant,
+ dependency_overrides_provider=dependency_overrides_provider,
+ async_exit_stack=async_exit_stack,
+ )
+ values, errors, _, _2, _3 = solved_result
+ if errors:
+ raise WebSocketRequestValidationError(_normalize_errors(errors))
+ assert dependant.call is not None, "dependant.call must be a function"
+ await dependant.call(**values)
return app
diff --git a/pyproject.toml b/pyproject.toml
index e67486ae31bf8..fa072e59523da 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -84,6 +84,12 @@ module = "fastapi.tests.*"
ignore_missing_imports = true
check_untyped_defs = true
+[[tool.mypy.overrides]]
+module = "docs_src.*"
+disallow_incomplete_defs = false
+disallow_untyped_defs = false
+disallow_untyped_calls = false
+
[tool.pytest.ini_options]
addopts = [
"--strict-config",
@@ -167,6 +173,9 @@ ignore = [
"docs_src/security/tutorial005_an_py39.py" = ["B904"]
"docs_src/security/tutorial005_py310.py" = ["B904"]
"docs_src/security/tutorial005_py39.py" = ["B904"]
+"docs_src/dependencies/tutorial008b.py" = ["B904"]
+"docs_src/dependencies/tutorial008b_an.py" = ["B904"]
+"docs_src/dependencies/tutorial008b_an_py39.py" = ["B904"]
[tool.ruff.isort]
diff --git a/tests/test_dependency_contextmanager.py b/tests/test_dependency_contextmanager.py
index 03ef56c4d7e5b..b07f9aa5b6c6b 100644
--- a/tests/test_dependency_contextmanager.py
+++ b/tests/test_dependency_contextmanager.py
@@ -1,7 +1,9 @@
+import json
from typing import Dict
import pytest
from fastapi import BackgroundTasks, Depends, FastAPI
+from fastapi.responses import StreamingResponse
from fastapi.testclient import TestClient
app = FastAPI()
@@ -200,6 +202,13 @@ async def bg(state: dict):
return state
+@app.middleware("http")
+async def middleware(request, call_next):
+ response: StreamingResponse = await call_next(request)
+ response.headers["x-state"] = json.dumps(state.copy())
+ return response
+
+
client = TestClient(app)
@@ -274,9 +283,13 @@ def test_background_tasks():
assert data["context_b"] == "started b"
assert data["context_a"] == "started a"
assert data["bg"] == "not set"
+ middleware_state = json.loads(response.headers["x-state"])
+ assert middleware_state["context_b"] == "finished b with a: started a"
+ assert middleware_state["context_a"] == "finished a"
+ assert middleware_state["bg"] == "not set"
assert state["context_b"] == "finished b with a: started a"
assert state["context_a"] == "finished a"
- assert state["bg"] == "bg set - b: started b - a: started a"
+ assert state["bg"] == "bg set - b: finished b with a: started a - a: finished a"
def test_sync_raise_raises():
@@ -382,4 +395,7 @@ def test_sync_background_tasks():
assert data["sync_bg"] == "not set"
assert state["context_b"] == "finished b with a: started a"
assert state["context_a"] == "finished a"
- assert state["sync_bg"] == "sync_bg set - b: started b - a: started a"
+ assert (
+ state["sync_bg"]
+ == "sync_bg set - b: finished b with a: started a - a: finished a"
+ )
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008b.py b/tests/test_tutorial/test_dependencies/test_tutorial008b.py
new file mode 100644
index 0000000000000..ed4f4aaca8cd3
--- /dev/null
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008b.py
@@ -0,0 +1,23 @@
+from fastapi.testclient import TestClient
+
+from docs_src.dependencies.tutorial008b import app
+
+client = TestClient(app)
+
+
+def test_get_no_item():
+ response = client.get("/items/foo")
+ assert response.status_code == 404, response.text
+ assert response.json() == {"detail": "Item not found"}
+
+
+def test_owner_error():
+ response = client.get("/items/plumbus")
+ assert response.status_code == 400, response.text
+ assert response.json() == {"detail": "Onwer error: Rick"}
+
+
+def test_get_item():
+ response = client.get("/items/portal-gun")
+ assert response.status_code == 200, response.text
+ assert response.json() == {"description": "Gun to create portals", "owner": "Rick"}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008b_an.py b/tests/test_tutorial/test_dependencies/test_tutorial008b_an.py
new file mode 100644
index 0000000000000..aa76ad6afc940
--- /dev/null
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008b_an.py
@@ -0,0 +1,23 @@
+from fastapi.testclient import TestClient
+
+from docs_src.dependencies.tutorial008b_an import app
+
+client = TestClient(app)
+
+
+def test_get_no_item():
+ response = client.get("/items/foo")
+ assert response.status_code == 404, response.text
+ assert response.json() == {"detail": "Item not found"}
+
+
+def test_owner_error():
+ response = client.get("/items/plumbus")
+ assert response.status_code == 400, response.text
+ assert response.json() == {"detail": "Onwer error: Rick"}
+
+
+def test_get_item():
+ response = client.get("/items/portal-gun")
+ assert response.status_code == 200, response.text
+ assert response.json() == {"description": "Gun to create portals", "owner": "Rick"}
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py b/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
new file mode 100644
index 0000000000000..aa76ad6afc940
--- /dev/null
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
@@ -0,0 +1,23 @@
+from fastapi.testclient import TestClient
+
+from docs_src.dependencies.tutorial008b_an import app
+
+client = TestClient(app)
+
+
+def test_get_no_item():
+ response = client.get("/items/foo")
+ assert response.status_code == 404, response.text
+ assert response.json() == {"detail": "Item not found"}
+
+
+def test_owner_error():
+ response = client.get("/items/plumbus")
+ assert response.status_code == 400, response.text
+ assert response.json() == {"detail": "Onwer error: Rick"}
+
+
+def test_get_item():
+ response = client.get("/items/portal-gun")
+ assert response.status_code == 200, response.text
+ assert response.json() == {"description": "Gun to create portals", "owner": "Rick"}
From 678bed2fc9cbf38ba7a6ba9782e5be1a33d852c5 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Mon, 25 Dec 2023 17:57:54 +0000
Subject: [PATCH 004/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 12bc12d260e32..bc6fd9d110142 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -107,6 +107,10 @@ participant tasks as Background tasks
The new execution flow can be found in the docs: [Execution of dependencies with `yield`](https://fastapi.tiangolo.com/tutorial/dependencies/dependencies-with-yield/#execution-of-dependencies-with-yield).
+### Features
+
+* âš Add support for raising exceptions (including `HTTPException`) in dependencies with `yield` in the exit code, do not support them in background tasks. PR [#10831](https://github.com/tiangolo/fastapi/pull/10831) by [@tiangolo](https://github.com/tiangolo).
+
### Internal
* ð¥ Update FastAPI People. PR [#10567](https://github.com/tiangolo/fastapi/pull/10567) by [@tiangolo](https://github.com/tiangolo).
From bcd5a424cdca5973a2f4927de83c8eb2ca658011 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Mon, 25 Dec 2023 19:00:47 +0100
Subject: [PATCH 005/217] =?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 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index bc6fd9d110142..a2424a383224f 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,12 @@ hide:
## Latest Changes
+### Breaking Changes
+
+Using resources from dependencies with `yield` in background tasks is no longer supported.
+
+This change is what supports the new features, read below. ð€
+
### Dependencies with `yield`, `HTTPException` and Background Tasks
Dependencies with `yield` now can raise `HTTPException` and other exceptions after `yield`. ð
From 91510db62012b817627833e896ddb579056c5922 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Mon, 25 Dec 2023 19:01:26 +0100
Subject: [PATCH 006/217] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.10?=
=?UTF-8?q?6.0?=
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 a2424a383224f..fc38cb475f052 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,8 @@ hide:
## Latest Changes
+## 0.106.0
+
### Breaking Changes
Using resources from dependencies with `yield` in background tasks is no longer supported.
diff --git a/fastapi/__init__.py b/fastapi/__init__.py
index dd16ea34db1eb..4348bd98e4dad 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.105.0"
+__version__ = "0.106.0"
from starlette import status as status
From 5826c4f31f8b6e0d8a289d4c5a6c5a7f8ccb263a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Mon, 25 Dec 2023 19:06:04 +0100
Subject: [PATCH 007/217] =?UTF-8?q?=F0=9F=93=9D=20Tweak=20release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index fc38cb475f052..0c118e7c9edc0 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -57,7 +57,7 @@ def get_item(item_id: str, username: Annotated[str, Depends(get_username)]):
---
-Before FastAPI 0.106.0, raising exceptions after `yield` was not possible, the exit code in dependencies with `yield` was executed *after* the response was sent, so [Exception Handlers](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank} would have already run.
+Before FastAPI 0.106.0, raising exceptions after `yield` was not possible, the exit code in dependencies with `yield` was executed *after* the response was sent, so [Exception Handlers](https://fastapi.tiangolo.com/tutorial/handling-errors/#install-custom-exception-handlers) would have already run.
This was designed this way mainly to allow using the same objects "yielded" by dependencies inside of background tasks, because the exit code would be executed after the background tasks were finished.
From 8b5843ebcd1ccc9582ef34b9dba0a9162140396b Mon Sep 17 00:00:00 2001
From: Alejandra <90076947+alejsdev@users.noreply.github.com>
Date: Tue, 26 Dec 2023 12:13:50 -0500
Subject: [PATCH 008/217] =?UTF-8?q?=F0=9F=93=9D=20Restructure=20Docs=20sec?=
=?UTF-8?q?tion=20in=20Contributing=20page=20(#10844)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
ð Restructure Docs section in Contributing page
---
docs/en/docs/contributing.md | 58 ++++++++++++++++++++----------------
1 file changed, 32 insertions(+), 26 deletions(-)
diff --git a/docs/en/docs/contributing.md b/docs/en/docs/contributing.md
index cfdb607d772e0..35bc1c50197d4 100644
--- a/docs/en/docs/contributing.md
+++ b/docs/en/docs/contributing.md
@@ -150,32 +150,7 @@ For it to sort them correctly, you need to have FastAPI installed locally in you
First, make sure you set up your environment as described above, that will install all the requirements.
-The documentation uses MkDocs .
-
-And there are extra tools/scripts in place to handle translations in `./scripts/docs.py`.
-
-!!! tip
- You don't need to see the code in `./scripts/docs.py`, you just use it in the command line.
-
-All the documentation is in Markdown format in the directory `./docs/en/`.
-
-Many of the tutorials have blocks of code.
-
-In most of the cases, these blocks of code are actual complete applications that can be run as is.
-
-In fact, those blocks of code are not written inside the Markdown, they are Python files in the `./docs_src/` directory.
-
-And those Python files are included/injected in the documentation when generating the site.
-
-### Docs for tests
-
-Most of the tests actually run against the example source files in the documentation.
-
-This helps making sure that:
-
-* The documentation is up to date.
-* The documentation examples can be run as is.
-* Most of the features are covered by the documentation, ensured by test coverage.
+### Docs live
During local development, there is a script that builds the site and checks for any changes, live-reloading:
@@ -229,6 +204,37 @@ Completion will take effect once you restart the terminal.
+### Docs Structure
+
+The documentation uses MkDocs .
+
+And there are extra tools/scripts in place to handle translations in `./scripts/docs.py`.
+
+!!! tip
+ You don't need to see the code in `./scripts/docs.py`, you just use it in the command line.
+
+All the documentation is in Markdown format in the directory `./docs/en/`.
+
+Many of the tutorials have blocks of code.
+
+In most of the cases, these blocks of code are actual complete applications that can be run as is.
+
+In fact, those blocks of code are not written inside the Markdown, they are Python files in the `./docs_src/` directory.
+
+And those Python files are included/injected in the documentation when generating the site.
+
+### Docs for tests
+
+Most of the tests actually run against the example source files in the documentation.
+
+This helps making sure that:
+
+* The documentation is up to date.
+* The documentation examples can be run as is.
+* Most of the features are covered by the documentation, ensured by test coverage.
+
+
+
### Apps and docs at the same time
If you run the examples with, e.g.:
From 4de60e153a73ee51e6be3378b64fc16bbd251d8a Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 26 Dec 2023 17:14:13 +0000
Subject: [PATCH 009/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 0c118e7c9edc0..b5fbdfa4581fd 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,10 @@ hide:
## Latest Changes
+### Docs
+
+* ð Restructure Docs section in Contributing page. PR [#10844](https://github.com/tiangolo/fastapi/pull/10844) by [@alejsdev](https://github.com/alejsdev).
+
## 0.106.0
### Breaking Changes
From 505ae06c0bb2ba745587731ca88e4165b64003a6 Mon Sep 17 00:00:00 2001
From: Alejandra <90076947+alejsdev@users.noreply.github.com>
Date: Tue, 26 Dec 2023 12:23:20 -0500
Subject: [PATCH 010/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20docs:=20Node.js=20?=
=?UTF-8?q?script=20alternative=20to=20update=20OpenAPI=20for=20generated?=
=?UTF-8?q?=20clients=20(#10845)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/advanced/generate-clients.md | 14 ++++++++---
docs_src/generate_clients/tutorial004.js | 29 +++++++++++++++++++++++
2 files changed, 40 insertions(+), 3 deletions(-)
create mode 100644 docs_src/generate_clients/tutorial004.js
diff --git a/docs/en/docs/advanced/generate-clients.md b/docs/en/docs/advanced/generate-clients.md
index e8d771f7123f4..3a810baee1957 100644
--- a/docs/en/docs/advanced/generate-clients.md
+++ b/docs/en/docs/advanced/generate-clients.md
@@ -229,9 +229,17 @@ But for the generated client we could **modify** the OpenAPI operation IDs right
We could download the OpenAPI JSON to a file `openapi.json` and then we could **remove that prefixed tag** with a script like this:
-```Python
-{!../../../docs_src/generate_clients/tutorial004.py!}
-```
+=== "Python"
+
+ ```Python
+ {!> ../../../docs_src/generate_clients/tutorial004.py!}
+ ```
+
+=== "Node.js"
+
+ ```Python
+ {!> ../../../docs_src/generate_clients/tutorial004.js!}
+ ```
With that, the operation IDs would be renamed from things like `items-get_items` to just `get_items`, that way the client generator can generate simpler method names.
diff --git a/docs_src/generate_clients/tutorial004.js b/docs_src/generate_clients/tutorial004.js
new file mode 100644
index 0000000000000..18dc38267bcde
--- /dev/null
+++ b/docs_src/generate_clients/tutorial004.js
@@ -0,0 +1,29 @@
+import * as fs from "fs";
+
+const filePath = "./openapi.json";
+
+fs.readFile(filePath, (err, data) => {
+ const openapiContent = JSON.parse(data);
+ if (err) throw err;
+
+ const paths = openapiContent.paths;
+
+ Object.keys(paths).forEach((pathKey) => {
+ const pathData = paths[pathKey];
+ Object.keys(pathData).forEach((method) => {
+ const operation = pathData[method];
+ if (operation.tags && operation.tags.length > 0) {
+ const tag = operation.tags[0];
+ const operationId = operation.operationId;
+ const toRemove = `${tag}-`;
+ if (operationId.startsWith(toRemove)) {
+ const newOperationId = operationId.substring(toRemove.length);
+ operation.operationId = newOperationId;
+ }
+ }
+ });
+ });
+ fs.writeFile(filePath, JSON.stringify(openapiContent, null, 2), (err) => {
+ if (err) throw err;
+ });
+});
From a751032c0929cdc4a891666240f0dc4849cf58a9 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 26 Dec 2023 17:23:45 +0000
Subject: [PATCH 011/217] =?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 b5fbdfa4581fd..f683b18020868 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add docs: Node.js script alternative to update OpenAPI for generated clients. PR [#10845](https://github.com/tiangolo/fastapi/pull/10845) by [@alejsdev](https://github.com/alejsdev).
* ð Restructure Docs section in Contributing page. PR [#10844](https://github.com/tiangolo/fastapi/pull/10844) by [@alejsdev](https://github.com/alejsdev).
## 0.106.0
From d633953f13d70706daa3bbc03f6b3ab66648e02f Mon Sep 17 00:00:00 2001
From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
Date: Tue, 26 Dec 2023 20:03:07 +0100
Subject: [PATCH 012/217] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20Starlett?=
=?UTF-8?q?e=20to=200.28.0=20(#9636)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
pyproject.toml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index fa072e59523da..499d0e5dc8c12 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -40,7 +40,7 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
- "starlette>=0.27.0,<0.28.0",
+ "starlette>=0.28.0,<0.29.0",
"pydantic>=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0",
"typing-extensions>=4.8.0",
# TODO: remove this pin after upgrading Starlette 0.31.1
From 9090bf4084ac3bd9527a938a5dc814b139740a6b Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 26 Dec 2023 19:03:31 +0000
Subject: [PATCH 013/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index f683b18020868..d165ba52fbbc7 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,10 @@ hide:
## Latest Changes
+### Upgrades
+
+* â¬ïž Upgrade Starlette to 0.28.0. PR [#9636](https://github.com/tiangolo/fastapi/pull/9636) by [@adriangb](https://github.com/adriangb).
+
### Docs
* ð Add docs: Node.js script alternative to update OpenAPI for generated clients. PR [#10845](https://github.com/tiangolo/fastapi/pull/10845) by [@alejsdev](https://github.com/alejsdev).
From f933fd6ff8db06ff77be8406ad56b6b07f13a532 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 26 Dec 2023 20:04:08 +0100
Subject: [PATCH 014/217] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.10?=
=?UTF-8?q?7.0?=
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 d165ba52fbbc7..f7b6207c243fa 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,8 @@ hide:
## Latest Changes
+## 0.107.0
+
### Upgrades
* â¬ïž Upgrade Starlette to 0.28.0. PR [#9636](https://github.com/tiangolo/fastapi/pull/9636) by [@adriangb](https://github.com/adriangb).
diff --git a/fastapi/__init__.py b/fastapi/__init__.py
index 4348bd98e4dad..8a22b74b6759c 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.106.0"
+__version__ = "0.107.0"
from starlette import status as status
From c55f90df32101006ad3ddd8060d30f24c8f44eb9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 26 Dec 2023 21:12:34 +0100
Subject: [PATCH 015/217] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20Starlett?=
=?UTF-8?q?e=20to=20`>=3D0.29.0,<0.33.0`,=20update=20docs=20and=20usage=20?=
=?UTF-8?q?of=20templates=20with=20new=20Starlette=20arguments=20(#10846)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* ð Update docs for compatibility with Starlette 0.29.0 and new template arguments
* â¬ïž Upgrade Starlette to >=0.29.0,<0.33.0
* ð Remove AnyIO pin
---
docs/em/docs/advanced/templates.md | 2 +-
docs/en/docs/advanced/templates.md | 10 ++++++----
docs_src/templates/tutorial001.py | 4 +++-
pyproject.toml | 4 +---
4 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/docs/em/docs/advanced/templates.md b/docs/em/docs/advanced/templates.md
index 1fb57725af175..0a73a4f47e811 100644
--- a/docs/em/docs/advanced/templates.md
+++ b/docs/em/docs/advanced/templates.md
@@ -27,7 +27,7 @@ $ pip install jinja2
* ð£ `Request` ð¢ *â¡ ð ïž* ð ð ðš ð.
* âïž `templates` ð â â & ðš `TemplateResponse`, ð¶ââïž `request` 1ïžâ£ ð-ð² ð« Jinja2ïžâ£ "ð".
-```Python hl_lines="4 11 15-16"
+```Python hl_lines="4 11 15-18"
{!../../../docs_src/templates/tutorial001.py!}
```
diff --git a/docs/en/docs/advanced/templates.md b/docs/en/docs/advanced/templates.md
index 38618aeeb09cd..583abda7fb0e4 100644
--- a/docs/en/docs/advanced/templates.md
+++ b/docs/en/docs/advanced/templates.md
@@ -25,14 +25,16 @@ $ pip install jinja2
* Import `Jinja2Templates`.
* Create a `templates` object that you can re-use later.
* Declare a `Request` parameter in the *path operation* that will return a template.
-* Use the `templates` you created to render and return a `TemplateResponse`, passing the `request` as one of the key-value pairs in the Jinja2 "context".
+* Use the `templates` you created to render and return a `TemplateResponse`, pass the name of the template, the request object, and a "context" dictionary with key-value pairs to be used inside of the Jinja2 template.
-```Python hl_lines="4 11 15-16"
+```Python hl_lines="4 11 15-18"
{!../../../docs_src/templates/tutorial001.py!}
```
!!! note
- Notice that you have to pass the `request` as part of the key-value pairs in the context for Jinja2. So, you also have to declare it in your *path operation*.
+ Before FastAPI 0.108.0, Starlette 0.29.0, the `name` was the first parameter.
+
+ Also, before that, in previous versions, the `request` object was passed as part of the key-value pairs in the context for Jinja2.
!!! tip
By declaring `response_class=HTMLResponse` the docs UI will be able to know that the response will be HTML.
@@ -58,7 +60,7 @@ It will show the `id` taken from the "context" `dict` you passed:
## Templates and static files
-And you can also use `url_for()` inside of the template, and use it, for example, with the `StaticFiles` you mounted.
+You can also use `url_for()` inside of the template, and use it, for example, with the `StaticFiles` you mounted.
```jinja hl_lines="4"
{!../../../docs_src/templates/templates/item.html!}
diff --git a/docs_src/templates/tutorial001.py b/docs_src/templates/tutorial001.py
index 245e7110b195d..81ccc8d4d0b3f 100644
--- a/docs_src/templates/tutorial001.py
+++ b/docs_src/templates/tutorial001.py
@@ -13,4 +13,6 @@
@app.get("/items/{id}", response_class=HTMLResponse)
async def read_item(request: Request, id: str):
- return templates.TemplateResponse("item.html", {"request": request, "id": id})
+ return templates.TemplateResponse(
+ request=request, name="item.html", context={"id": id}
+ )
diff --git a/pyproject.toml b/pyproject.toml
index 499d0e5dc8c12..38728d99e945b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -40,11 +40,9 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
- "starlette>=0.28.0,<0.29.0",
+ "starlette>=0.29.0,<0.33.0",
"pydantic>=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0",
"typing-extensions>=4.8.0",
- # TODO: remove this pin after upgrading Starlette 0.31.1
- "anyio>=3.7.1,<4.0.0",
]
dynamic = ["version"]
From 43e2223804d79a4c7309660a411487f0fa47c1c7 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 26 Dec 2023 20:12:59 +0000
Subject: [PATCH 016/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index f7b6207c243fa..f82577e0cae10 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,10 @@ hide:
## Latest Changes
+### Upgrades
+
+* â¬ïž Upgrade Starlette to `>=0.29.0,<0.33.0`, update docs and usage of templates with new Starlette arguments. PR [#10846](https://github.com/tiangolo/fastapi/pull/10846) by [@tiangolo](https://github.com/tiangolo).
+
## 0.107.0
### Upgrades
From fe0249a23ebb294be183b3e2cab82addbd68c42c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 26 Dec 2023 21:17:18 +0100
Subject: [PATCH 017/217] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.10?=
=?UTF-8?q?8.0?=
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 f82577e0cae10..3c7936ea97624 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,8 @@ hide:
## Latest Changes
+## 0.108.0
+
### Upgrades
* â¬ïž Upgrade Starlette to `>=0.29.0,<0.33.0`, update docs and usage of templates with new Starlette arguments. PR [#10846](https://github.com/tiangolo/fastapi/pull/10846) by [@tiangolo](https://github.com/tiangolo).
diff --git a/fastapi/__init__.py b/fastapi/__init__.py
index 8a22b74b6759c..02ac83b5e4aee 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.107.0"
+__version__ = "0.108.0"
from starlette import status as status
From dd790c34ff6f92dba68bef0f46a4a18ba7015f94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 26 Dec 2023 21:37:34 +0100
Subject: [PATCH 018/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo=20in=20?=
=?UTF-8?q?dependencies=20with=20yield=20source=20examples=20(#10847)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs_src/dependencies/tutorial008b.py | 2 +-
docs_src/dependencies/tutorial008b_an.py | 2 +-
docs_src/dependencies/tutorial008b_an_py39.py | 2 +-
tests/test_tutorial/test_dependencies/test_tutorial008b.py | 2 +-
tests/test_tutorial/test_dependencies/test_tutorial008b_an.py | 2 +-
.../test_dependencies/test_tutorial008b_an_py39.py | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs_src/dependencies/tutorial008b.py b/docs_src/dependencies/tutorial008b.py
index 4a1a70dcfcda9..163e96600f9b3 100644
--- a/docs_src/dependencies/tutorial008b.py
+++ b/docs_src/dependencies/tutorial008b.py
@@ -17,7 +17,7 @@ def get_username():
try:
yield "Rick"
except OwnerError as e:
- raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
+ raise HTTPException(status_code=400, detail=f"Owner error: {e}")
@app.get("/items/{item_id}")
diff --git a/docs_src/dependencies/tutorial008b_an.py b/docs_src/dependencies/tutorial008b_an.py
index 3a0f1399a98f4..84d8f12c14887 100644
--- a/docs_src/dependencies/tutorial008b_an.py
+++ b/docs_src/dependencies/tutorial008b_an.py
@@ -18,7 +18,7 @@ def get_username():
try:
yield "Rick"
except OwnerError as e:
- raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
+ raise HTTPException(status_code=400, detail=f"Owner error: {e}")
@app.get("/items/{item_id}")
diff --git a/docs_src/dependencies/tutorial008b_an_py39.py b/docs_src/dependencies/tutorial008b_an_py39.py
index 30c9cdc699c2e..3b8434c816711 100644
--- a/docs_src/dependencies/tutorial008b_an_py39.py
+++ b/docs_src/dependencies/tutorial008b_an_py39.py
@@ -19,7 +19,7 @@ def get_username():
try:
yield "Rick"
except OwnerError as e:
- raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
+ raise HTTPException(status_code=400, detail=f"Owner error: {e}")
@app.get("/items/{item_id}")
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008b.py b/tests/test_tutorial/test_dependencies/test_tutorial008b.py
index ed4f4aaca8cd3..86acba9e4ff95 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial008b.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008b.py
@@ -14,7 +14,7 @@ def test_get_no_item():
def test_owner_error():
response = client.get("/items/plumbus")
assert response.status_code == 400, response.text
- assert response.json() == {"detail": "Onwer error: Rick"}
+ assert response.json() == {"detail": "Owner error: Rick"}
def test_get_item():
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008b_an.py b/tests/test_tutorial/test_dependencies/test_tutorial008b_an.py
index aa76ad6afc940..7f51fc52a5133 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial008b_an.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008b_an.py
@@ -14,7 +14,7 @@ def test_get_no_item():
def test_owner_error():
response = client.get("/items/plumbus")
assert response.status_code == 400, response.text
- assert response.json() == {"detail": "Onwer error: Rick"}
+ assert response.json() == {"detail": "Owner error: Rick"}
def test_get_item():
diff --git a/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py b/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
index aa76ad6afc940..7f51fc52a5133 100644
--- a/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
+++ b/tests/test_tutorial/test_dependencies/test_tutorial008b_an_py39.py
@@ -14,7 +14,7 @@ def test_get_no_item():
def test_owner_error():
response = client.get("/items/plumbus")
assert response.status_code == 400, response.text
- assert response.json() == {"detail": "Onwer error: Rick"}
+ assert response.json() == {"detail": "Owner error: Rick"}
def test_get_item():
From 84d400b9164f0a1727322de154855023b5eee73c Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 26 Dec 2023 20:37:55 +0000
Subject: [PATCH 019/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 3c7936ea97624..d17e624148edf 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,10 @@ hide:
## Latest Changes
+### Docs
+
+* âïž Fix typo in dependencies with yield source examples. PR [#10847](https://github.com/tiangolo/fastapi/pull/10847) by [@tiangolo](https://github.com/tiangolo).
+
## 0.108.0
### Upgrades
From 040ad986d48bb9a400de804f7f25abb856d85e1a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 26 Dec 2023 21:47:18 +0100
Subject: [PATCH 020/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo=20in=20?=
=?UTF-8?q?release=20notes?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/release-notes.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index d17e624148edf..bb96bce6684b4 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -63,7 +63,7 @@ def get_username():
try:
yield "Rick"
except OwnerError as e:
- raise HTTPException(status_code=400, detail=f"Onwer error: {e}")
+ raise HTTPException(status_code=400, detail=f"Owner error: {e}")
@app.get("/items/{item_id}")
From 1780c21e7ad8f4db048c443cdf9b03edfd34a1a2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Mon, 8 Jan 2024 22:49:53 +0400
Subject: [PATCH 021/217] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20GitHub?=
=?UTF-8?q?=20Action=20label-approved=20(#10905)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/label-approved.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/label-approved.yml b/.github/workflows/label-approved.yml
index 2113c468ac835..1138e6043436d 100644
--- a/.github/workflows/label-approved.yml
+++ b/.github/workflows/label-approved.yml
@@ -13,6 +13,6 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- - uses: docker://tiangolo/label-approved:0.0.2
+ - uses: docker://tiangolo/label-approved:0.0.3
with:
token: ${{ secrets.FASTAPI_LABEL_APPROVED }}
From 04016d3bf93927f0358a8ceaa7c6cf6669b709bd Mon Sep 17 00:00:00 2001
From: github-actions
Date: Mon, 8 Jan 2024 18:50:12 +0000
Subject: [PATCH 022/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index bb96bce6684b4..4cae0c5a397b8 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -11,6 +11,10 @@ hide:
* âïž Fix typo in dependencies with yield source examples. PR [#10847](https://github.com/tiangolo/fastapi/pull/10847) by [@tiangolo](https://github.com/tiangolo).
+### Internal
+
+* â¬ïž Upgrade GitHub Action label-approved. PR [#10905](https://github.com/tiangolo/fastapi/pull/10905) by [@tiangolo](https://github.com/tiangolo).
+
## 0.108.0
### Upgrades
From 3c7685273f799ad1d931be0923343320bbb1ca33 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 9 Jan 2024 18:21:10 +0400
Subject: [PATCH 023/217] =?UTF-8?q?=F0=9F=91=B7=20Upgrade=20GitHub=20Actio?=
=?UTF-8?q?n=20label-approved=20(#10913)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/label-approved.yml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/label-approved.yml b/.github/workflows/label-approved.yml
index 1138e6043436d..62daf260805f2 100644
--- a/.github/workflows/label-approved.yml
+++ b/.github/workflows/label-approved.yml
@@ -3,6 +3,7 @@ name: Label Approved
on:
schedule:
- cron: "0 12 * * *"
+ workflow_dispatch:
jobs:
label-approved:
@@ -13,6 +14,6 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- - uses: docker://tiangolo/label-approved:0.0.3
+ - uses: docker://tiangolo/label-approved:0.0.4
with:
token: ${{ secrets.FASTAPI_LABEL_APPROVED }}
From d5498274f924e7f3091928ff4962ae9992542c34 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 14:21:30 +0000
Subject: [PATCH 024/217] =?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 4cae0c5a397b8..b33edba84c854 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -13,6 +13,7 @@ hide:
### Internal
+* ð· Upgrade GitHub Action label-approved. PR [#10913](https://github.com/tiangolo/fastapi/pull/10913) by [@tiangolo](https://github.com/tiangolo).
* â¬ïž Upgrade GitHub Action label-approved. PR [#10905](https://github.com/tiangolo/fastapi/pull/10905) by [@tiangolo](https://github.com/tiangolo).
## 0.108.0
From e9ffa20c8e916336bd37c4f1477e0ec04445e0ce Mon Sep 17 00:00:00 2001
From: Andrey Otto
Date: Tue, 9 Jan 2024 21:28:58 +0700
Subject: [PATCH 025/217] =?UTF-8?q?=F0=9F=93=9D=20Update=20code=20examples?=
=?UTF-8?q?=20in=20docs=20for=20body,=20replace=20name=20`create=5Fitem`?=
=?UTF-8?q?=20with=20`update=5Fitem`=20when=20appropriate=20(#5913)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs_src/body/tutorial003.py | 2 +-
docs_src/body/tutorial003_py310.py | 2 +-
docs_src/body/tutorial004.py | 2 +-
docs_src/body/tutorial004_py310.py | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs_src/body/tutorial003.py b/docs_src/body/tutorial003.py
index 89a6b833ce237..2f33cc0389694 100644
--- a/docs_src/body/tutorial003.py
+++ b/docs_src/body/tutorial003.py
@@ -15,5 +15,5 @@ class Item(BaseModel):
@app.put("/items/{item_id}")
-async def create_item(item_id: int, item: Item):
+async def update_item(item_id: int, item: Item):
return {"item_id": item_id, **item.dict()}
diff --git a/docs_src/body/tutorial003_py310.py b/docs_src/body/tutorial003_py310.py
index a936f28fdc65d..440b210e6b47a 100644
--- a/docs_src/body/tutorial003_py310.py
+++ b/docs_src/body/tutorial003_py310.py
@@ -13,5 +13,5 @@ class Item(BaseModel):
@app.put("/items/{item_id}")
-async def create_item(item_id: int, item: Item):
+async def update_item(item_id: int, item: Item):
return {"item_id": item_id, **item.dict()}
diff --git a/docs_src/body/tutorial004.py b/docs_src/body/tutorial004.py
index e2df0df2baa27..0671e0a278581 100644
--- a/docs_src/body/tutorial004.py
+++ b/docs_src/body/tutorial004.py
@@ -15,7 +15,7 @@ class Item(BaseModel):
@app.put("/items/{item_id}")
-async def create_item(item_id: int, item: Item, q: Union[str, None] = None):
+async def update_item(item_id: int, item: Item, q: Union[str, None] = None):
result = {"item_id": item_id, **item.dict()}
if q:
result.update({"q": q})
diff --git a/docs_src/body/tutorial004_py310.py b/docs_src/body/tutorial004_py310.py
index 60cfd96109b9c..b352b70ab6010 100644
--- a/docs_src/body/tutorial004_py310.py
+++ b/docs_src/body/tutorial004_py310.py
@@ -13,7 +13,7 @@ class Item(BaseModel):
@app.put("/items/{item_id}")
-async def create_item(item_id: int, item: Item, q: str | None = None):
+async def update_item(item_id: int, item: Item, q: str | None = None):
result = {"item_id": item_id, **item.dict()}
if q:
result.update({"q": q})
From 136fe2b70fd631ed6c62216496255f27e9e12664 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 14:30:16 +0000
Subject: [PATCH 026/217] =?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 b33edba84c854..18f5c50b6e06d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Update code examples in docs for body, replace name `create_item` with `update_item` when appropriate. PR [#5913](https://github.com/tiangolo/fastapi/pull/5913) by [@OttoAndrey](https://github.com/OttoAndrey).
* âïž Fix typo in dependencies with yield source examples. PR [#10847](https://github.com/tiangolo/fastapi/pull/10847) by [@tiangolo](https://github.com/tiangolo).
### Internal
From 57d4d938412c9ac0daf8f32eacb2adc8023375d4 Mon Sep 17 00:00:00 2001
From: Keshav Malik <33570148+theinfosecguy@users.noreply.github.com>
Date: Tue, 9 Jan 2024 20:02:46 +0530
Subject: [PATCH 027/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20blog=20for=20FastA?=
=?UTF-8?q?PI=20&=20Supabase=20(#6018)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/en/data/external_links.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index 726e7eae7ec73..35c9b6718ed76 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -1,5 +1,9 @@
Articles:
English:
+ - author: Keshav Malik
+ author_link: https://theinfosecguy.xyz/
+ link: https://blog.theinfosecguy.xyz/building-a-crud-api-with-fastapi-and-supabase-a-step-by-step-guide
+ title: Building a CRUD API with FastAPI and Supabase
- author: Adejumo Ridwan Suleiman
author_link: https://www.linkedin.com/in/adejumoridwan/
link: https://medium.com/python-in-plain-english/build-an-sms-spam-classifier-serverless-database-with-faunadb-and-fastapi-23dbb275bc5b
From 4491ea688201db4f32d294b8a73862b9df367d99 Mon Sep 17 00:00:00 2001
From: Moustapha Sall <58856327+s-mustafa@users.noreply.github.com>
Date: Tue, 9 Jan 2024 09:35:33 -0500
Subject: [PATCH 028/217] =?UTF-8?q?=F0=9F=93=9D=20Update=20example=20sourc?=
=?UTF-8?q?e=20files=20for=20SQL=20databases=20with=20SQLAlchemy=20(#9508)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Marcelo Trylesinski
---
docs_src/sql_databases/sql_app/models.py | 4 ++--
docs_src/sql_databases/sql_app_py310/models.py | 4 ++--
docs_src/sql_databases/sql_app_py39/models.py | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs_src/sql_databases/sql_app/models.py b/docs_src/sql_databases/sql_app/models.py
index 62d8ab4aaac16..09ae2a8077f68 100644
--- a/docs_src/sql_databases/sql_app/models.py
+++ b/docs_src/sql_databases/sql_app/models.py
@@ -7,7 +7,7 @@
class User(Base):
__tablename__ = "users"
- id = Column(Integer, primary_key=True, index=True)
+ id = Column(Integer, primary_key=True)
email = Column(String, unique=True, index=True)
hashed_password = Column(String)
is_active = Column(Boolean, default=True)
@@ -18,7 +18,7 @@ class User(Base):
class Item(Base):
__tablename__ = "items"
- id = Column(Integer, primary_key=True, index=True)
+ id = Column(Integer, primary_key=True)
title = Column(String, index=True)
description = Column(String, index=True)
owner_id = Column(Integer, ForeignKey("users.id"))
diff --git a/docs_src/sql_databases/sql_app_py310/models.py b/docs_src/sql_databases/sql_app_py310/models.py
index 62d8ab4aaac16..09ae2a8077f68 100644
--- a/docs_src/sql_databases/sql_app_py310/models.py
+++ b/docs_src/sql_databases/sql_app_py310/models.py
@@ -7,7 +7,7 @@
class User(Base):
__tablename__ = "users"
- id = Column(Integer, primary_key=True, index=True)
+ id = Column(Integer, primary_key=True)
email = Column(String, unique=True, index=True)
hashed_password = Column(String)
is_active = Column(Boolean, default=True)
@@ -18,7 +18,7 @@ class User(Base):
class Item(Base):
__tablename__ = "items"
- id = Column(Integer, primary_key=True, index=True)
+ id = Column(Integer, primary_key=True)
title = Column(String, index=True)
description = Column(String, index=True)
owner_id = Column(Integer, ForeignKey("users.id"))
diff --git a/docs_src/sql_databases/sql_app_py39/models.py b/docs_src/sql_databases/sql_app_py39/models.py
index 62d8ab4aaac16..09ae2a8077f68 100644
--- a/docs_src/sql_databases/sql_app_py39/models.py
+++ b/docs_src/sql_databases/sql_app_py39/models.py
@@ -7,7 +7,7 @@
class User(Base):
__tablename__ = "users"
- id = Column(Integer, primary_key=True, index=True)
+ id = Column(Integer, primary_key=True)
email = Column(String, unique=True, index=True)
hashed_password = Column(String)
is_active = Column(Boolean, default=True)
@@ -18,7 +18,7 @@ class User(Base):
class Item(Base):
__tablename__ = "items"
- id = Column(Integer, primary_key=True, index=True)
+ id = Column(Integer, primary_key=True)
title = Column(String, index=True)
description = Column(String, index=True)
owner_id = Column(Integer, ForeignKey("users.id"))
From ed628ddb92505234b026d8ce2e2e8d07178137ba Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 14:37:20 +0000
Subject: [PATCH 029/217] =?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 18f5c50b6e06d..d44600ab85277 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Update example source files for SQL databases with SQLAlchemy. PR [#9508](https://github.com/tiangolo/fastapi/pull/9508) by [@s-mustafa](https://github.com/s-mustafa).
* ð Update code examples in docs for body, replace name `create_item` with `update_item` when appropriate. PR [#5913](https://github.com/tiangolo/fastapi/pull/5913) by [@OttoAndrey](https://github.com/OttoAndrey).
* âïž Fix typo in dependencies with yield source examples. PR [#10847](https://github.com/tiangolo/fastapi/pull/10847) by [@tiangolo](https://github.com/tiangolo).
From 897cde9fe2843655130bafb191764459456d0761 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 14:37:53 +0000
Subject: [PATCH 030/217] =?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 d44600ab85277..6f96b0a3d9a6d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add blog for FastAPI & Supabase. PR [#6018](https://github.com/tiangolo/fastapi/pull/6018) by [@theinfosecguy](https://github.com/theinfosecguy).
* ð Update example source files for SQL databases with SQLAlchemy. PR [#9508](https://github.com/tiangolo/fastapi/pull/9508) by [@s-mustafa](https://github.com/s-mustafa).
* ð Update code examples in docs for body, replace name `create_item` with `update_item` when appropriate. PR [#5913](https://github.com/tiangolo/fastapi/pull/5913) by [@OttoAndrey](https://github.com/OttoAndrey).
* âïž Fix typo in dependencies with yield source examples. PR [#10847](https://github.com/tiangolo/fastapi/pull/10847) by [@tiangolo](https://github.com/tiangolo).
From a1ea70804401625d50811e32840b08d94426805d Mon Sep 17 00:00:00 2001
From: Tristan Marion
Date: Tue, 9 Jan 2024 15:44:08 +0100
Subject: [PATCH 031/217] =?UTF-8?q?=F0=9F=93=9D=20Replace=20HTTP=20code=20?=
=?UTF-8?q?returned=20in=20case=20of=20existing=20user=20error=20in=20docs?=
=?UTF-8?q?=20for=20testing=20(#4482)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs_src/app_testing/app_b/main.py | 2 +-
docs_src/app_testing/app_b/test_main.py | 2 +-
docs_src/app_testing/app_b_py310/main.py | 2 +-
docs_src/app_testing/app_b_py310/test_main.py | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs_src/app_testing/app_b/main.py b/docs_src/app_testing/app_b/main.py
index 11558b8e813f4..45a103378388a 100644
--- a/docs_src/app_testing/app_b/main.py
+++ b/docs_src/app_testing/app_b/main.py
@@ -33,6 +33,6 @@ async def create_item(item: Item, x_token: str = Header()):
if x_token != fake_secret_token:
raise HTTPException(status_code=400, detail="Invalid X-Token header")
if item.id in fake_db:
- raise HTTPException(status_code=400, detail="Item already exists")
+ raise HTTPException(status_code=409, detail="Item already exists")
fake_db[item.id] = item
return item
diff --git a/docs_src/app_testing/app_b/test_main.py b/docs_src/app_testing/app_b/test_main.py
index d186b8ecbacfa..4e2b98e237c3a 100644
--- a/docs_src/app_testing/app_b/test_main.py
+++ b/docs_src/app_testing/app_b/test_main.py
@@ -61,5 +61,5 @@ def test_create_existing_item():
"description": "There goes my stealer",
},
)
- assert response.status_code == 400
+ assert response.status_code == 409
assert response.json() == {"detail": "Item already exists"}
diff --git a/docs_src/app_testing/app_b_py310/main.py b/docs_src/app_testing/app_b_py310/main.py
index b4c72de5c9431..eccedcc7ce2ec 100644
--- a/docs_src/app_testing/app_b_py310/main.py
+++ b/docs_src/app_testing/app_b_py310/main.py
@@ -31,6 +31,6 @@ async def create_item(item: Item, x_token: str = Header()):
if x_token != fake_secret_token:
raise HTTPException(status_code=400, detail="Invalid X-Token header")
if item.id in fake_db:
- raise HTTPException(status_code=400, detail="Item already exists")
+ raise HTTPException(status_code=409, detail="Item already exists")
fake_db[item.id] = item
return item
diff --git a/docs_src/app_testing/app_b_py310/test_main.py b/docs_src/app_testing/app_b_py310/test_main.py
index d186b8ecbacfa..4e2b98e237c3a 100644
--- a/docs_src/app_testing/app_b_py310/test_main.py
+++ b/docs_src/app_testing/app_b_py310/test_main.py
@@ -61,5 +61,5 @@ def test_create_existing_item():
"description": "There goes my stealer",
},
)
- assert response.status_code == 400
+ assert response.status_code == 409
assert response.json() == {"detail": "Item already exists"}
From fe694766ae5d4f56d017cfc28ff358a3a6193dcf Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 14:45:35 +0000
Subject: [PATCH 032/217] =?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 6f96b0a3d9a6d..8dfb1a9eaeef1 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Replace HTTP code returned in case of existing user error in docs for testing. PR [#4482](https://github.com/tiangolo/fastapi/pull/4482) by [@TristanMarion](https://github.com/TristanMarion).
* ð Add blog for FastAPI & Supabase. PR [#6018](https://github.com/tiangolo/fastapi/pull/6018) by [@theinfosecguy](https://github.com/theinfosecguy).
* ð Update example source files for SQL databases with SQLAlchemy. PR [#9508](https://github.com/tiangolo/fastapi/pull/9508) by [@s-mustafa](https://github.com/s-mustafa).
* ð Update code examples in docs for body, replace name `create_item` with `update_item` when appropriate. PR [#5913](https://github.com/tiangolo/fastapi/pull/5913) by [@OttoAndrey](https://github.com/OttoAndrey).
From 78ff6e3efd8899918957f6176585be3610c8c730 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 9 Jan 2024 18:57:33 +0400
Subject: [PATCH 033/217] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20GitHub?=
=?UTF-8?q?=20Action=20latest-changes=20(#10915)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/workflows/latest-changes.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/latest-changes.yml b/.github/workflows/latest-changes.yml
index b9b550d5ea807..27e062d090546 100644
--- a/.github/workflows/latest-changes.yml
+++ b/.github/workflows/latest-changes.yml
@@ -34,7 +34,7 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- - uses: docker://tiangolo/latest-changes:0.2.0
+ - uses: docker://tiangolo/latest-changes:0.3.0
# - uses: tiangolo/latest-changes@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
From 7fbb7963d31489fc157bf2de3e437d9084042080 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 14:57:58 +0000
Subject: [PATCH 034/217] =?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 8dfb1a9eaeef1..a33c1bc7980f0 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Internal
+* â¬ïž Upgrade GitHub Action latest-changes. PR [#10915](https://github.com/tiangolo/fastapi/pull/10915) by [@tiangolo](https://github.com/tiangolo).
* ð· Upgrade GitHub Action label-approved. PR [#10913](https://github.com/tiangolo/fastapi/pull/10913) by [@tiangolo](https://github.com/tiangolo).
* â¬ïž Upgrade GitHub Action label-approved. PR [#10905](https://github.com/tiangolo/fastapi/pull/10905) by [@tiangolo](https://github.com/tiangolo).
From 423cdd24ccd38957e50be5016c6feb88a5bb3ba4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 9 Jan 2024 19:02:53 +0400
Subject: [PATCH 035/217] =?UTF-8?q?=F0=9F=91=B7=20Upgrade=20custom=20GitHu?=
=?UTF-8?q?b=20Action=20comment-docs-preview-in-pr=20(#10916)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.github/actions/comment-docs-preview-in-pr/Dockerfile | 6 ++++--
.github/actions/comment-docs-preview-in-pr/app/main.py | 3 ++-
.github/actions/comment-docs-preview-in-pr/requirements.txt | 4 ++++
3 files changed, 10 insertions(+), 3 deletions(-)
create mode 100644 .github/actions/comment-docs-preview-in-pr/requirements.txt
diff --git a/.github/actions/comment-docs-preview-in-pr/Dockerfile b/.github/actions/comment-docs-preview-in-pr/Dockerfile
index 14b0d026956fb..42627fe190ebf 100644
--- a/.github/actions/comment-docs-preview-in-pr/Dockerfile
+++ b/.github/actions/comment-docs-preview-in-pr/Dockerfile
@@ -1,6 +1,8 @@
-FROM python:3.9
+FROM python:3.10
-RUN pip install httpx "pydantic==1.5.1" pygithub
+COPY ./requirements.txt /app/requirements.txt
+
+RUN pip install -r /app/requirements.txt
COPY ./app /app
diff --git a/.github/actions/comment-docs-preview-in-pr/app/main.py b/.github/actions/comment-docs-preview-in-pr/app/main.py
index 68914fdb9a818..8cc119fe0af8c 100644
--- a/.github/actions/comment-docs-preview-in-pr/app/main.py
+++ b/.github/actions/comment-docs-preview-in-pr/app/main.py
@@ -6,7 +6,8 @@
import httpx
from github import Github
from github.PullRequest import PullRequest
-from pydantic import BaseModel, BaseSettings, SecretStr, ValidationError
+from pydantic import BaseModel, SecretStr, ValidationError
+from pydantic_settings import BaseSettings
github_api = "https://api.github.com"
diff --git a/.github/actions/comment-docs-preview-in-pr/requirements.txt b/.github/actions/comment-docs-preview-in-pr/requirements.txt
new file mode 100644
index 0000000000000..74a3631f48fa3
--- /dev/null
+++ b/.github/actions/comment-docs-preview-in-pr/requirements.txt
@@ -0,0 +1,4 @@
+PyGithub
+pydantic>=2.5.3,<3.0.0
+pydantic-settings>=2.1.0,<3.0.0
+httpx
From 635d1a2d6dcd7c26af9d8b7db19dd8c1f25a777a Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:04:35 +0000
Subject: [PATCH 036/217] =?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 a33c1bc7980f0..ad11537eb5d39 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Internal
+* ð· Upgrade custom GitHub Action comment-docs-preview-in-pr. PR [#10916](https://github.com/tiangolo/fastapi/pull/10916) by [@tiangolo](https://github.com/tiangolo).
* â¬ïž Upgrade GitHub Action latest-changes. PR [#10915](https://github.com/tiangolo/fastapi/pull/10915) by [@tiangolo](https://github.com/tiangolo).
* ð· Upgrade GitHub Action label-approved. PR [#10913](https://github.com/tiangolo/fastapi/pull/10913) by [@tiangolo](https://github.com/tiangolo).
* â¬ïž Upgrade GitHub Action label-approved. PR [#10905](https://github.com/tiangolo/fastapi/pull/10905) by [@tiangolo](https://github.com/tiangolo).
From 7111d69f285469a1fb2f9389e8dc2de41a5bd113 Mon Sep 17 00:00:00 2001
From: pablocm83
Date: Tue, 9 Jan 2024 10:08:24 -0500
Subject: [PATCH 037/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Spanish=20translat?=
=?UTF-8?q?ion=20for=20`docs/es/docs/resources/index.md`=20(#10909)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/es/docs/resources/index.md | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 docs/es/docs/resources/index.md
diff --git a/docs/es/docs/resources/index.md b/docs/es/docs/resources/index.md
new file mode 100644
index 0000000000000..92898d319e6da
--- /dev/null
+++ b/docs/es/docs/resources/index.md
@@ -0,0 +1,3 @@
+# Recursos
+
+Recursos adicionales, enlaces externos, artÃculos y más. âïž
From e10bdb82cc9199b47c7804bfda842990723c4a03 Mon Sep 17 00:00:00 2001
From: pablocm83
Date: Tue, 9 Jan 2024 10:09:12 -0500
Subject: [PATCH 038/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Spanish=20translat?=
=?UTF-8?q?ion=20for=20`docs/es/docs/about/index.md`=20(#10908)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
docs/es/docs/about/index.md | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 docs/es/docs/about/index.md
diff --git a/docs/es/docs/about/index.md b/docs/es/docs/about/index.md
new file mode 100644
index 0000000000000..e83400a8dc100
--- /dev/null
+++ b/docs/es/docs/about/index.md
@@ -0,0 +1,3 @@
+# Acerca de
+
+Acerca de FastAPI, su diseño, inspiración y más. ð€
From d1299103236eb88b37553b94996bcf74c8fe4485 Mon Sep 17 00:00:00 2001
From: pablocm83
Date: Tue, 9 Jan 2024 10:09:47 -0500
Subject: [PATCH 039/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Spanish=20translat?=
=?UTF-8?q?ion=20for=20`docs/es/docs/help/index.md`=20(#10907)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/es/docs/help/index.md | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 docs/es/docs/help/index.md
diff --git a/docs/es/docs/help/index.md b/docs/es/docs/help/index.md
new file mode 100644
index 0000000000000..f6ce35e9c1b46
--- /dev/null
+++ b/docs/es/docs/help/index.md
@@ -0,0 +1,3 @@
+# Ayuda
+
+Ayuda y recibe ayuda, contribuye, involúcrate. ð€
From 631601787b6bc8835edc0967653bfa6378686473 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:11:10 +0000
Subject: [PATCH 040/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index ad11537eb5d39..872464de84b84 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -15,6 +15,10 @@ hide:
* ð Update code examples in docs for body, replace name `create_item` with `update_item` when appropriate. PR [#5913](https://github.com/tiangolo/fastapi/pull/5913) by [@OttoAndrey](https://github.com/OttoAndrey).
* âïž Fix typo in dependencies with yield source examples. PR [#10847](https://github.com/tiangolo/fastapi/pull/10847) by [@tiangolo](https://github.com/tiangolo).
+### Translations
+
+* ð Add Spanish translation for `docs/es/docs/resources/index.md`. PR [#10909](https://github.com/tiangolo/fastapi/pull/10909) by [@pablocm83](https://github.com/pablocm83).
+
### Internal
* ð· Upgrade custom GitHub Action comment-docs-preview-in-pr. PR [#10916](https://github.com/tiangolo/fastapi/pull/10916) by [@tiangolo](https://github.com/tiangolo).
From ca10d3927b7f16acf109a848769b27beb40251c2 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:11:39 +0000
Subject: [PATCH 041/217] =?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 872464de84b84..8a80aa2958994 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Spanish translation for `docs/es/docs/about/index.md`. PR [#10908](https://github.com/tiangolo/fastapi/pull/10908) by [@pablocm83](https://github.com/pablocm83).
* ð Add Spanish translation for `docs/es/docs/resources/index.md`. PR [#10909](https://github.com/tiangolo/fastapi/pull/10909) by [@pablocm83](https://github.com/pablocm83).
### Internal
From 5b63406aa5dcc0260a45c7bb0c86d607f3ff532c Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:12:19 +0000
Subject: [PATCH 042/217] =?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 8a80aa2958994..4c380ed3f92ef 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Spanish translation for `docs/es/docs/help/index.md`. PR [#10907](https://github.com/tiangolo/fastapi/pull/10907) by [@pablocm83](https://github.com/pablocm83).
* ð Add Spanish translation for `docs/es/docs/about/index.md`. PR [#10908](https://github.com/tiangolo/fastapi/pull/10908) by [@pablocm83](https://github.com/pablocm83).
* ð Add Spanish translation for `docs/es/docs/resources/index.md`. PR [#10909](https://github.com/tiangolo/fastapi/pull/10909) by [@pablocm83](https://github.com/pablocm83).
From 2090e9a3e258cc1517018ebdd6283171f334247c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hasan=20Sezer=20Ta=C5=9Fan?=
<13135006+hasansezertasan@users.noreply.github.com>
Date: Tue, 9 Jan 2024 18:14:23 +0300
Subject: [PATCH 043/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translat?=
=?UTF-8?q?ion=20for=20`docs/tr/docs/newsletter.md`=20(#10550)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/tr/docs/newsletter.md | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 docs/tr/docs/newsletter.md
diff --git a/docs/tr/docs/newsletter.md b/docs/tr/docs/newsletter.md
new file mode 100644
index 0000000000000..22ca1b1e2949e
--- /dev/null
+++ b/docs/tr/docs/newsletter.md
@@ -0,0 +1,5 @@
+# FastAPI ve ArkadaÅları BÃŒlteni
+
+
+
+
From eecc7a81136eaa6617b9491cfc3c10930c90e30c Mon Sep 17 00:00:00 2001
From: David Takacs <44911031+takacs@users.noreply.github.com>
Date: Tue, 9 Jan 2024 10:16:04 -0500
Subject: [PATCH 044/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Hungarian=20transl?=
=?UTF-8?q?ation=20for=20`/docs/hu/docs/index.md`=20(#10812)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Peter Panko
---
docs/hu/docs/index.md | 469 ++++++++++++++++++++++++++++++++++++++++++
docs/hu/mkdocs.yml | 1 +
2 files changed, 470 insertions(+)
create mode 100644 docs/hu/docs/index.md
create mode 100644 docs/hu/mkdocs.yml
diff --git a/docs/hu/docs/index.md b/docs/hu/docs/index.md
new file mode 100644
index 0000000000000..29c3c05ac6271
--- /dev/null
+++ b/docs/hu/docs/index.md
@@ -0,0 +1,469 @@
+
+
+
+
+ FastAPI keretrendszer, nagy teljesÃtmény, könnyen tanulható, gyorsan kódolható, productionre kész
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+---
+
+**Dokumentáció**: https://fastapi.tiangolo.com
+
+**Forrás kód**: https://github.com/tiangolo/fastapi
+
+---
+A FastAPI egy modern, gyors (nagy teljesÃtményű), webes keretrendszer API-ok épÃtéséhez Python 3.8+-al, a Python szabványos tÃpusjelöléseire épÃtve.
+
+
+Kulcs funkciók:
+
+* **Gyors**: Nagyon nagy teljesÃtmény, a **NodeJS**-el és a **Go**-val egyenrangú (a Starlettenek és a Pydantic-nek köszönhetÅen). [Az egyik leggyorsabb Python keretrendszer](#performance).
+* **Gyorsan kódolható**: A funkciók fejlesztési sebességét 200-300 százalékkal megnöveli. *
+* **Kevesebb hiba**: KörÃŒlbelÃŒl 40%-al csökkenti az emberi (fejlesztÅi) hibák számát. *
+* **IntuitÃv**: Kiváló szerkesztÅ támogatás. KiegészÃtés mindenhol. Kevesebb hibakereséssel töltött idÅ.
+* **Egyszerű**: Egyszerű tanulásra és használatra tervezve. Kevesebb dokumentáció olvasással töltött idÅ.
+* **Rövid**: Kód duplikáció minimalizálása. Több funkció minden paraméter deklarálásával. Kevesebb hiba.
+* **Robosztus**: Production ready kód. Automatikus interaktÃv dokumentáció val.
+* **Szabvány alapú**: Az API-ok nyÃlt szabványaira alapuló (és azokkal teljesen kompatibilis): OpenAPI (korábban Swagger néven ismert) és a JSON Schema .
+
+* Egy production alkalmazásokat épÃtÅ belsÅ fejlesztÅi csapat tesztjein alapuló becslés.
+
+## Szponzorok
+
+
+
+{% if sponsors %}
+{% for sponsor in sponsors.gold -%}
+
+{% endfor -%}
+{%- for sponsor in sponsors.silver -%}
+
+{% endfor %}
+{% endif %}
+
+
+
+További szponzorok
+
+## Vélemények
+
+"_[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products._"
+
+Kabir Khan -
Microsoft (ref)
+
+---
+
+"_We adopted the **FastAPI** library to spawn a **REST** server that can be queried to obtain **predictions**. [for Ludwig]_"
+
+Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala -
Uber (ref)
+
+---
+
+"_**Netflix** is pleased to announce the open-source release of our **crisis management** orchestration framework: **Dispatch**! [built with **FastAPI**]_"
+
+Kevin Glisson, Marc Vilanova, Forest Monsen -
Netflix (ref)
+
+---
+
+"_Iâm over the moon excited about **FastAPI**. Itâs so fun!_"
+
+
+
+---
+
+"_Honestly, what you've built looks super solid and polished. In many ways, it's what I wanted **Hug** to be - it's really inspiring to see someone build that._"
+
+
+
+---
+
+"_If you're looking to learn one **modern framework** for building REST APIs, check out **FastAPI** [...] It's fast, easy to use and easy to learn [...]_"
+
+"_We've switched over to **FastAPI** for our **APIs** [...] I think you'll like it [...]_"
+
+
+
+---
+
+"_If anyone is looking to build a production Python API, I would highly recommend **FastAPI**. It is **beautifully designed**, **simple to use** and **highly scalable**, it has become a **key component** in our API first development strategy and is driving many automations and services such as our Virtual TAC Engineer._"
+
+Deon Pillsbury -
Cisco (ref)
+
+---
+
+## **Typer**, a CLI-ok FastAPI-ja
+
+
+
+Ha egy olyan CLI alkalmazást fejlesztesz amit a parancssorban kell használni webes API helyett, tekintsd meg: **Typer** .
+
+**Typer** a FastAPI kistestvére. A **CLI-k FastAPI-ja**. âšïž ð
+
+## Követelmények
+
+Python 3.8+
+
+A FastAPI óriások vállán áll:
+
+* Starlette a webes részekhez.
+* Pydantic az adat részekhez.
+
+## TelepÃtés
+
+
+
+```console
+$ pip install fastapi
+
+---> 100%
+```
+
+
+
+A production-höz egy ASGI szerverre is szÌkség lesz, mint például az Uvicorn vagy a Hypercorn .
+
+
+
+```console
+$ pip install "uvicorn[standard]"
+
+---> 100%
+```
+
+
+
+## Példa
+
+### Hozd létre
+
+* Hozz létre a `main.py` fájlt a következŠtartalommal:
+
+```Python
+from typing import Union
+
+from fastapi import FastAPI
+
+app = FastAPI()
+
+
+@app.get("/")
+def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+def read_item(item_id: int, q: Union[str, None] = None):
+ return {"item_id": item_id, "q": q}
+```
+
+
+Vagy használd az async def
-et...
+
+Ha a kódod `async` / `await`-et, használ `async def`:
+
+```Python hl_lines="9 14"
+from typing import Union
+
+from fastapi import FastAPI
+
+app = FastAPI()
+
+
+@app.get("/")
+async def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+async def read_item(item_id: int, q: Union[str, None] = None):
+ return {"item_id": item_id, "q": q}
+```
+
+**Megjegyzés**:
+
+Ha nem tudod, tekintsd meg a _"Sietsz?"_ szekciót `async` és `await`-rÅl dokumentációba .
+
+
+
+### Futtasd le
+
+IndÃtsd el a szervert a következÅ paranccsal:
+
+
+
+```console
+$ uvicorn main:app --reload
+
+INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+INFO: Started reloader process [28720]
+INFO: Started server process [28722]
+INFO: Waiting for application startup.
+INFO: Application startup complete.
+```
+
+
+
+
+A parancsról uvicorn main:app --reload
...
+
+A `uvicorn main:app` parancs a következÅre utal:
+
+* `main`: fájl `main.py` (a Python "modul").
+* `app`: a `main.py`-ban a `app = FastAPI()` sorral létrehozott objektum.
+* `--reload`: kód változtatás esetén újra indÃtja a szervert. Csak fejlesztés közben használandó.
+
+
+
+### EllenÅrizd
+
+Nyisd meg a böngészÅd a következÅ cÃmen: http://127.0.0.1:8000/items/5?q=somequery .
+
+A következŠJSON választ fogod látni:
+
+```JSON
+{"item_id": 5, "q": "somequery"}
+```
+
+Máris létrehoztál egy API-t ami:
+
+* HTTP kéréseket fogad a `/` és `/items/{item_id}` _útvonalakon_.
+* Mindkét _útvonal_ a `GET` műveletet használja (másik elnevezés: HTTP _metódus_).
+* A `/items/{item_id}` _útvonalnak_ van egy _path paramétere_, az `item_id`, aminek `int` tÃpusúnak kell lennie.
+* A `/items/{item_id}` _útvonalnak_ még van egy opcionális, `str` tÃpusú _query paramétere_ is, a `q`.
+
+### InteraktÃv API dokumentáció
+
+Most nyisd meg a http://127.0.0.1:8000/docs cÃmet.
+
+Az automatikus interaktÃv API dokumentációt fogod látni (amit a Swagger UI -al hozunk létre):
+
+![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
+
+### AlternatÃv API dokumentáció
+
+Ãs most menj el a http://127.0.0.1:8000/redoc cÃmre.
+
+Az alternatÃv automatikus dokumentációt fogod látni. (lásd ReDoc ):
+
+![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
+
+## Példa frissÃtése
+
+MódosÃtsuk a `main.py` fájlt, hogy `PUT` kérések esetén tudjon body-t fogadni.
+
+Deklaráld a body-t standard Python tÃpusokkal, a Pydantic-nak köszönhetÅen.
+
+```Python hl_lines="4 9-12 25-27"
+from typing import Union
+
+from fastapi import FastAPI
+from pydantic import BaseModel
+
+app = FastAPI()
+
+
+class Item(BaseModel):
+ name: str
+ price: float
+ is_offer: Union[bool, None] = None
+
+
+@app.get("/")
+def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+def read_item(item_id: int, q: Union[str, None] = None):
+ return {"item_id": item_id, "q": q}
+
+
+@app.put("/items/{item_id}")
+def update_item(item_id: int, item: Item):
+ return {"item_name": item.name, "item_id": item_id}
+```
+
+A szerver automatikusan újraindul (mert hozzáadtuk a --reload paramétert a fenti `uvicorn` parancshoz).
+
+### InteraktÃv API dokumentáció frissÃtése
+
+Most menj el a http://127.0.0.1:8000/docs cÃmre.
+
+* Az interaktÃv API dokumentáció automatikusan frissÃŒlt Ãgy már benne van az új body.
+
+![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
+
+* Kattints rá a "Try it out" gombra, ennek segÃtségével kitöltheted a paramétereket és közvetlen használhatod az API-t:
+
+![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png)
+
+* Ezután kattints az "Execute" gompra, a felhasználói felÃŒlet kommunikálni fog az API-oddal. ElkÃŒldi a paramétereket és a visszakapott választ megmutatja a képernyÅdön.
+
+![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png)
+
+### AlternatÃv API dokumentáció frissÃtés
+
+Most menj el a http://127.0.0.1:8000/redoc cÃmre.
+
+* Az alternatÃv dokumentáció szintúgy tÃŒkrözni fogja az új kérési paraméter és body-t.
+
+![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
+
+### Ãsszefoglalás
+
+ÃsszegzésÃŒl, deklarálod **egyszer** a paraméterek, body, stb tÃpusát funkciós paraméterekként.
+
+Ezt standard modern Python tÃpusokkal csinálod.
+
+Nem kell új szintaxist, vagy specifikus könyvtár mert metódósait, stb. megtanulnod.
+
+Csak standard **Python 3.8+**.
+
+Például egy `int`-nek:
+
+```Python
+item_id: int
+```
+
+Egy komplexebb `Item` modellnek:
+
+```Python
+item: Item
+```
+
+... Ãs csupán egy deklarációval megkapod a:
+
+* SzerkesztŠtámogatást, beleértve:
+ * SzövegkiegészÃtés.
+ * TÃpus ellenÅrzés.
+* Adatok validációja:
+ * Automatikus és érthetŠhibák amikor az adatok hibásak.
+ * Validáció mélyen ágyazott objektumok esetén is.
+* Bemeneti adatok átváltása : a hálózatról érkezÅ Python adatokká és tÃpusokká. Adatok olvasása következÅ forrásokból:
+ * JSON.
+ * CÃm paraméterek.
+ * Query paraméterek.
+ * Cookie-k.
+ * Header-ök.
+ * Formok.
+ * Fájlok.
+* Kimeneti adatok átváltása : Python adatok is tÃpusokról hálózati adatokká:
+ * válts át Python tÃpusokat (`str`, `int`, `float`, `bool`, `list`, etc).
+ * `datetime` csak objektumokat.
+ * `UUID` objektumokat.
+ * Adatbázis modelleket.
+ * ...Ãs sok mást.
+* Automatikus interaktÃv dokumentáció, beleértve két alternatÃv dokumentációt is:
+ * Swagger UI.
+ * ReDoc.
+
+---
+
+Visszatérve az elÅzÅ kód példához. A **FastAPI**:
+
+* Validálja hogy van egy `item_id` mezŠa `GET` és `PUT` kérésekben.
+* Validálja hogy az `item_id` `int` tÃpusú a `GET` és `PUT` kérésekben.
+ * Ha nem akkor látni fogunk egy tiszta hibát ezzel kapcsolatban.
+* ellenÅrzi hogyha van egy opcionális query paraméter `q` névvel (azaz `http://127.0.0.1:8000/items/foo?q=somequery`) `GET` kérések esetén.
+ * Mivel a `q` paraméter `= None`-al van deklarálva, ezért opcionális.
+ * `None` nélkÌl ez a mezŠkötelezŠlenne (mint például a body `PUT` kérések esetén).
+* a `/items/{item_id}` cÃmre érkezÅ `PUT` kérések esetén, a JSON-t a következÅképpen olvassa be:
+ * EllenÅrzi hogy létezik a kötelezÅ `name` nevű attribútum és `string`.
+ * EllenÅrzi hogy létezik a kötelezÅ `price` nevű attribútum és `float`.
+ * EllenÅrzi hogy létezik a `is_offer` nevű opcionális paraméter, ami ha létezik akkor `bool`
+ * Ez ágyazott JSON objektumokkal is működik
+* JSONrÅl való automatikus konvertálás.
+* dokumentáljuk mindent OpenAPI-al amit használható:
+ * InteraktÃv dokumentációs rendszerekkel.
+ * Automatikus kliens kód generáló a rendszerekkel, több nyelven.
+* Hozzá tartozik kettÅ interaktÃv dokumentációs web felÃŒlet.
+
+---
+
+Eddig csak a felszÃnt kapargattuk, de a lényeg hogy most már könnyebben érthetÅ hogyan működik.
+
+Próbáld kicserélni a következŠsorban:
+
+```Python
+ return {"item_name": item.name, "item_id": item_id}
+```
+
+...ezt:
+
+```Python
+ ... "item_name": item.name ...
+```
+
+...erre:
+
+```Python
+ ... "item_price": item.price ...
+```
+
+... Ãs figyeld meg hogy a szerkesztÅ automatikusan tudni fogja a tÃpusokat és kiegészÃti azokat:
+
+![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
+
+Teljesebb példákért és funkciókért tekintsd meg a Tutorial - User Guide -t.
+
+**Spoiler veszély**: a Tutorial - User Guidehoz tartozik:
+
+* **Paraméterek** deklarációja kÃŒlönbözÅ helyekrÅl: **header-ök**, **cookie-k**, **form mezÅk** és **fájlok**.
+* Hogyan állÃts be **validációs feltételeket** mint a `maximum_length` vagy a `regex`.
+* Nagyon hatékony és erÅs **FÃŒggÅség Injekció ** rendszerek.
+* Biztonság és autentikáció beleértve, **OAuth2**, **JWT tokens** és **HTTP Basic** támogatást.
+* Több haladó (de ugyanannyira könnyű) technika **mélyen ágyazott JSON modellek deklarációjára** (Pydantic-nek köszönhetÅen).
+* **GraphQL** integráció Strawberry -vel és más könyvtárakkal.
+* több extra funkció (Starlette-nek köszönhetÅen) pl.:
+ * **WebSockets**
+ * rendkÃvÃŒl könnyű tesztek HTTPX és `pytest` alapokra épÃtve
+ * **CORS**
+ * **Cookie Sessions**
+ * ...és több.
+
+## TeljesÃtmény
+
+A fÃŒggetlen TechEmpower benchmarkok szerint az Uvicorn alatt futó **FastAPI** alkalmazások az egyik leggyorsabb Python keretrendszerek közé tartoznak , éppen lemaradva a Starlette és az Uvicorn (melyeket a FastAPI belsÅleg használ) mögött.(*)
+
+Ezeknek a további megértéséhez: Benchmarks .
+
+## Opcionális követelmények
+
+Pydantic által használt:
+
+* email_validator
- e-mail validációkra.
+* pydantic-settings
- BeállÃtások követésére.
+* pydantic-extra-types
- Extra tÃpusok Pydantic-hoz.
+
+Starlette által használt:
+
+* httpx
- Követelmény ha a `TestClient`-et akarod használni.
+* jinja2
- Követelmény ha az alap template konfigurációt akarod használni.
+* python-multipart
- Követelmény ha "parsing" -ot akarsz támogatni, `request.form()`-al.
+* itsdangerous
- Követelmény `SessionMiddleware` támogatáshoz.
+* pyyaml
- Követelmény a Starlette `SchemaGenerator`-ának támogatásához (valószÃnűleg erre nincs szÃŒkség FastAPI használása esetén).
+* ujson
- Követelmény ha `UJSONResponse`-t akarsz használni.
+
+FastAPI / Starlette által használt
+
+* uvicorn
- Szerverekhez amÃg betöltik és szolgáltatják az applikációdat.
+* orjson
- Követelmény ha `ORJSONResponse`-t akarsz használni.
+
+Ezeket mind telepÃtheted a `pip install "fastapi[all]"` paranccsal.
+
+## Licensz
+Ez a projekt az MIT license, licensz alatt fut
diff --git a/docs/hu/mkdocs.yml b/docs/hu/mkdocs.yml
new file mode 100644
index 0000000000000..de18856f445aa
--- /dev/null
+++ b/docs/hu/mkdocs.yml
@@ -0,0 +1 @@
+INHERIT: ../en/mkdocs.yml
From f9cbaa5f39f2cb199948f5dfa6d15c48e465e7d1 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:18:47 +0000
Subject: [PATCH 045/217] =?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 4c380ed3f92ef..3a1a1b79470a7 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Turkish translation for `docs/tr/docs/newsletter.md`. PR [#10550](https://github.com/tiangolo/fastapi/pull/10550) by [@hasansezertasan](https://github.com/hasansezertasan).
* ð Add Spanish translation for `docs/es/docs/help/index.md`. PR [#10907](https://github.com/tiangolo/fastapi/pull/10907) by [@pablocm83](https://github.com/pablocm83).
* ð Add Spanish translation for `docs/es/docs/about/index.md`. PR [#10908](https://github.com/tiangolo/fastapi/pull/10908) by [@pablocm83](https://github.com/pablocm83).
* ð Add Spanish translation for `docs/es/docs/resources/index.md`. PR [#10909](https://github.com/tiangolo/fastapi/pull/10909) by [@pablocm83](https://github.com/pablocm83).
From ce9aba258e47e5128afb0947b75527c05b17d2f7 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:22:55 +0000
Subject: [PATCH 046/217] =?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 3a1a1b79470a7..734ab2d601599 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Hungarian translation for `/docs/hu/docs/index.md`. PR [#10812](https://github.com/tiangolo/fastapi/pull/10812) by [@takacs](https://github.com/takacs).
* ð Add Turkish translation for `docs/tr/docs/newsletter.md`. PR [#10550](https://github.com/tiangolo/fastapi/pull/10550) by [@hasansezertasan](https://github.com/hasansezertasan).
* ð Add Spanish translation for `docs/es/docs/help/index.md`. PR [#10907](https://github.com/tiangolo/fastapi/pull/10907) by [@pablocm83](https://github.com/pablocm83).
* ð Add Spanish translation for `docs/es/docs/about/index.md`. PR [#10908](https://github.com/tiangolo/fastapi/pull/10908) by [@pablocm83](https://github.com/pablocm83).
From 3af6766e26607cfd1007cbf33f7440f3c879fe79 Mon Sep 17 00:00:00 2001
From: ArtemKhymenko
Date: Tue, 9 Jan 2024 17:25:48 +0200
Subject: [PATCH 047/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Ukrainian=20transl?=
=?UTF-8?q?ation=20for=20`docs/uk/docs/tutorial/body-fields.md`=20(#10670)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Maksym Zavalniuk
Co-authored-by: Rostyslav
---
docs/uk/docs/tutorial/body-fields.md | 116 +++++++++++++++++++++++++++
1 file changed, 116 insertions(+)
create mode 100644 docs/uk/docs/tutorial/body-fields.md
diff --git a/docs/uk/docs/tutorial/body-fields.md b/docs/uk/docs/tutorial/body-fields.md
new file mode 100644
index 0000000000000..eee993cbe3616
--- /dev/null
+++ b/docs/uk/docs/tutorial/body-fields.md
@@ -0,0 +1,116 @@
+# ТÑлП - ÐПлÑ
+
+Так ÑаЌП Ñк вО ЌПжеÑе вОзМаÑаÑО ЎПЎаÑÐºÐŸÐ²Ñ Ð²Ð°Ð»ÑЎаÑÑÑ Ñа ЌеÑÐ°ÐŽÐ°ÐœÑ Ñ Ð¿Ð°ÑаЌеÑÑаÑ
*ÑÑМкÑÑÑ ÐŸÐ±ÑПбкО ÑлÑÑ
Ñ* за ÐŽÐŸÐ¿ÐŸÐŒÐŸÐ³ÐŸÑ `Query`, `Path` Ñа `Body`, вО ЌПжеÑе вОзМаÑаÑО валÑЎаÑÑÑ Ñа ЌеÑÐ°ÐŽÐ°ÐœÑ Ð²ÑеÑÐµÐŽÐžÐœÑ ÐŒÐŸÐŽÐµÐ»ÐµÐ¹ Pydantic за ÐŽÐŸÐ¿ÐŸÐŒÐŸÐ³ÐŸÑ `Field` вÑÐŽ Pydantic.
+
+## ÐЌпПÑÑ `Field`
+
+СпПÑаÑÐºÑ Ð²Ð°ÐŒ пПÑÑÑбМП ÑЌпПÑÑÑваÑО Ñе:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ non-Annotated"
+
+ !!! tip
+ ÐаÑÑП кПÑОÑÑÑваÑОÑÑ `Annotated` веÑÑÑÑÑ, ÑкÑП Ñе ЌПжлОвП.
+
+ ```Python hl_lines="2"
+ {!> ../../../docs_src/body_fields/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ ÐаÑÑП кПÑОÑÑÑваÑОÑÑ `Annotated` веÑÑÑÑÑ, ÑкÑП Ñе ЌПжлОвП.
+
+ ```Python hl_lines="4"
+ {!> ../../../docs_src/body_fields/tutorial001.py!}
+ ```
+
+!!! warning
+ ÐвеÑÐœÑÑÑ ÑвагÑ, ÑП `Field` ÑЌпПÑÑÑÑÑÑÑÑ Ð¿ÑÑЌП з `pydantic`, а Ме з `fastapi`, Ñк вÑÑ ÑÐœÑÑ (`Query`, `Path`, `Body` ÑПÑП).
+
+## ÐгПлПÑÐµÐœÐœÑ Ð°ÑÑОбÑÑÑв ЌПЎелÑ
+
+ÐО ЌПжеÑе вОкПÑОÑÑПвÑваÑО `Field` з аÑÑОбÑÑаЌО ЌПЎелÑ:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="11-14"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11-14"
+ {!> ../../../docs_src/body_fields/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.8+"
+
+ ```Python hl_lines="12-15"
+ {!> ../../../docs_src/body_fields/tutorial001_an.py!}
+ ```
+
+=== "Python 3.10+ non-Annotated"
+
+ !!! tip
+ ÐаÑÑП кПÑОÑÑÑваÑОÑÑ `Annotated` веÑÑÑÑÑ, ÑкÑП Ñе ЌПжлОвП..
+
+ ```Python hl_lines="9-12"
+ {!> ../../../docs_src/body_fields/tutorial001_py310.py!}
+ ```
+
+=== "Python 3.8+ non-Annotated"
+
+ !!! tip
+ ÐаÑÑП кПÑОÑÑÑваÑОÑÑ `Annotated` веÑÑÑÑÑ, ÑкÑП Ñе ЌПжлОвП..
+
+ ```Python hl_lines="11-14"
+ {!> ../../../docs_src/body_fields/tutorial001.py!}
+ ```
+
+`Field` пÑаÑÑÑ Ñак ÑаЌП, Ñк `Query`, `Path` Ñ `Body`, Ñ ÐœÑПгП ÑÐ°ÐºÑ ÑÐ°ÐŒÑ Ð¿Ð°ÑаЌеÑÑО ÑПÑП.
+
+!!! note "ТеÑ
ÐœÑÑÐœÑ ÐŽÐµÑалÑ"
+ ÐаÑпÑавЎÑ, `Query`, `Path` Ñа ÑÐœÑÑ, ÑП вО пПбаÑОÑе ЎалÑ, ÑÑвПÑÑÑÑÑ ÐŸÐ±'ÑкÑО пÑЎклаÑÑв загалÑМПгП клаÑÑ `Param`, кПÑÑОй ÑаЌ Ñ Ð¿ÑЎклаÑПЌ клаÑÑ `FieldInfo` з Pydantic.
+
+ Ð `Field` вÑÐŽ Pydantic ÑакПж пПвеÑÑÐ°Ñ ÐµÐºÐ·ÐµÐŒÐ¿Ð»ÑÑ `FieldInfo`.
+
+ `Body` ÑакПж безпПÑеÑеЎМÑП пПвеÑÑÐ°Ñ ÐŸÐ±'ÑкÑО пÑЎклаÑÑ `FieldInfo`. Ð Ñ ÑÐœÑÑ Ð¿ÑЎклаÑО, ÑÐºÑ Ð²Ðž пПбаÑОÑе пÑзМÑÑе, ÑП Ñ Ð¿ÑЎклаÑаЌО клаÑÑ Body.
+
+ ÐаЌ'ÑÑайÑе, ÑП кПлО вО ÑЌпПÑÑÑÑÑе 'Query', 'Path' Ñа ÑÐœÑе з 'fastapi', вПМО ÑакÑОÑМП Ñ ÑÑМкÑÑÑЌО, ÑÐºÑ Ð¿ÐŸÐ²ÐµÑÑаÑÑÑ ÑпеÑÑалÑÐœÑ ÐºÐ»Ð°ÑО.
+
+!!! tip
+ ÐвеÑÐœÑÑÑ ÑвагÑ, ÑП кПжеМ аÑÑОбÑÑ ÐŒÐŸÐŽÐµÐ»Ñ Ñз ÑОпПЌ, зМаÑеММÑÐŒ за заЌПвÑÑваММÑÐŒ Ñа `Field` ÐŒÐ°Ñ ÑÑ ÑÐ°ÐŒÑ ÑÑÑÑкÑÑÑÑ, ÑП й паÑаЌеÑÑ *ÑÑМкÑÑÑ ÐŸÐ±ÑПбкО ÑлÑÑ
Ñ*, з `Field` заЌÑÑÑÑ `Path`, `Query` Ñ `Body`.
+
+## ÐÐŸÐŽÐ°Ð²Ð°ÐœÐœÑ ÐŽÐŸÐŽÐ°ÑÐºÐŸÐ²ÐŸÑ ÑÐœÑПÑЌаÑÑÑ
+
+ÐО ЌПжеÑе вОзМаÑОÑО ЎПЎаÑÐºÐŸÐ²Ñ ÑÐœÑПÑЌаÑÑÑ Ñ `Field`, `Query`, `Body` ÑПÑП. РвПМа бÑЎе вклÑÑеМа Ñ Ð·Ð³ÐµÐœÐµÑÐŸÐ²Ð°ÐœÑ JSON ÑÑ
еЌÑ.
+
+ÐО ÐŽÑзМаÑÑеÑÑ Ð±ÑлÑÑе пÑП ÐŽÐŸÐŽÐ°Ð²Ð°ÐœÐœÑ ÐŽÐŸÐŽÐ°ÑÐºÐŸÐ²ÐŸÑ ÑÐœÑПÑЌаÑÑÑ Ð¿ÑзМÑÑе Ñ ÐŽÐŸÐºÑЌеМÑаÑÑÑ, кПлО вОвÑаÑОЌеÑе вОзМаÑÐµÐœÐœÑ Ð¿ÑОклаЎÑв.
+
+!!! warning
+ ÐПЎаÑÐºÐŸÐ²Ñ ÐºÐ»ÑÑÑ, пеÑÐµÐŽÐ°ÐœÑ Ð² `Field`, ÑакПж бÑÐŽÑÑÑ Ð¿ÑОÑÑÑÐœÑ Ñ Ð·Ð³ÐµÐœÐµÑПваМÑй ÑÑ
ÐµÐŒÑ OpenAPI ÐŽÐ»Ñ Ð²Ð°ÑПгП ЎПЎаÑка.
+ ÐÑкÑлÑкО ÑÑ ÐºÐ»ÑÑÑ ÐœÐµ ПбПв'ÑзкПвП ЌПжÑÑÑ Ð±ÑÑО ÑаÑÑÐžÐœÐŸÑ ÑпеÑОÑÑкаÑÑÑ OpenAPI, ЎеÑÐºÑ ÑÐœÑÑÑÑЌеМÑО OpenAPI, МапÑОклаЎ, [OpenAPI валÑЎаÑПÑ](https://validator.swagger.io/), ЌПжÑÑÑ ÐœÐµ пÑаÑÑваÑО з ваÑÐŸÑ Ð·Ð³ÐµÐœÐµÑÐŸÐ²Ð°ÐœÐŸÑ ÑÑ
еЌПÑ.
+
+## ÐÑÐŽÑÑЌПк
+
+ÐО ЌПжеÑе вОкПÑОÑÑПвÑваÑО `Field` з Pydantic ÐŽÐ»Ñ Ð²ÐžÐ·ÐœÐ°ÑÐµÐœÐœÑ ÐŽÐŸÐŽÐ°ÑкПвОÑ
пеÑевÑÑПк Ñа ЌеÑаЎаМОÑ
ÐŽÐ»Ñ Ð°ÑÑОбÑÑÑв ЌПЎелÑ.
+
+ÐО ÑакПж ЌПжеÑе вОкПÑОÑÑПвÑваÑО ЎПЎаÑÐºÐŸÐ²Ñ ÑÐŒÐµÐœÐŸÐ²Ð°ÐœÑ Ð°ÑгÑЌеМÑО ÐŽÐ»Ñ Ð¿ÐµÑеЎаÑÑ ÐŽÐŸÐŽÐ°ÑкПвОÑ
ЌеÑаЎаМОÑ
JSON ÑÑ
еЌО.
From 4fa251beb5546ea1b72b1c7bf3d3ed35324928a4 Mon Sep 17 00:00:00 2001
From: pablocm83
Date: Tue, 9 Jan 2024 10:26:26 -0500
Subject: [PATCH 048/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Spanish=20translat?=
=?UTF-8?q?ion=20for=20`docs/es/docs/learn/index.md`=20(#10885)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/es/docs/learn/index.md | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 docs/es/docs/learn/index.md
diff --git a/docs/es/docs/learn/index.md b/docs/es/docs/learn/index.md
new file mode 100644
index 0000000000000..b8d26cf34fdab
--- /dev/null
+++ b/docs/es/docs/learn/index.md
@@ -0,0 +1,5 @@
+# Aprender
+
+Aquà están las secciones introductorias y los tutoriales para aprender **FastAPI**.
+
+PodrÃas considerar esto como un **libro**, un **curso**, la forma **oficial** y recomendada de aprender FastAPI. ð
From 23ad8275975bc3474d5f7ed448db4b6c3a83f432 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hasan=20Sezer=20Ta=C5=9Fan?=
<13135006+hasansezertasan@users.noreply.github.com>
Date: Tue, 9 Jan 2024 18:28:47 +0300
Subject: [PATCH 049/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Turkish=20translat?=
=?UTF-8?q?ion=20for=20`docs/tr/docs/external-links.md`=20(#10549)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/tr/docs/external-links.md | 33 +++++++++++++++++++++++++++++++++
1 file changed, 33 insertions(+)
create mode 100644 docs/tr/docs/external-links.md
diff --git a/docs/tr/docs/external-links.md b/docs/tr/docs/external-links.md
new file mode 100644
index 0000000000000..78eaf1729d80b
--- /dev/null
+++ b/docs/tr/docs/external-links.md
@@ -0,0 +1,33 @@
+# Harici BaÄlantılar ve Makaleler
+
+**FastAPI** sÃŒrekli bÃŒyÃŒyen harika bir topluluÄa sahiptir.
+
+**FastAPI** ile alakalı birçok yazı, makale, araç ve proje bulunmaktadır.
+
+Bunlardan bazılarının tamamlanmamıŠbir listesi aÅaÄıda bulunmaktadır.
+
+!!! tip "Ä°pucu"
+ EÄer **FastAPI** ile alakalı henÃŒz burada listelenmemiÅ bir makale, proje, araç veya baÅka bir Åeyiniz varsa, bunu eklediÄiniz bir Pull Request oluÅturabilirsiniz.
+
+{% for section_name, section_content in external_links.items() %}
+
+## {{ section_name }}
+
+{% for lang_name, lang_content in section_content.items() %}
+
+### {{ lang_name }}
+
+{% for item in lang_content %}
+
+* {{ item.title }} by {{ item.author }} .
+
+{% endfor %}
+{% endfor %}
+{% endfor %}
+
+## Projeler
+
+`fastapi` konulu en son GitHub projeleri:
+
+
+
From 0a3dc7d107aebee308896c6e1d49a71067db5660 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:28:54 +0000
Subject: [PATCH 050/217] =?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 734ab2d601599..db3a4d4b22457 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Ukrainian translation for `docs/uk/docs/tutorial/body-fields.md`. PR [#10670](https://github.com/tiangolo/fastapi/pull/10670) by [@ArtemKhymenko](https://github.com/ArtemKhymenko).
* ð Add Hungarian translation for `/docs/hu/docs/index.md`. PR [#10812](https://github.com/tiangolo/fastapi/pull/10812) by [@takacs](https://github.com/takacs).
* ð Add Turkish translation for `docs/tr/docs/newsletter.md`. PR [#10550](https://github.com/tiangolo/fastapi/pull/10550) by [@hasansezertasan](https://github.com/hasansezertasan).
* ð Add Spanish translation for `docs/es/docs/help/index.md`. PR [#10907](https://github.com/tiangolo/fastapi/pull/10907) by [@pablocm83](https://github.com/pablocm83).
From 0f4b6294bf17741cb2399fb2584c4da924168b95 Mon Sep 17 00:00:00 2001
From: Royc30ne
Date: Tue, 9 Jan 2024 23:29:37 +0800
Subject: [PATCH 051/217] =?UTF-8?q?=F0=9F=8C=90=20Update=20SQLAlchemy=20in?=
=?UTF-8?q?struction=20in=20Chinese=20translation=20`docs/zh/docs/tutorial?=
=?UTF-8?q?/sql-databases.md`=20(#9712)?=
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/sql-databases.md | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/docs/zh/docs/tutorial/sql-databases.md b/docs/zh/docs/tutorial/sql-databases.md
index 8b09dc6771a8f..a936eb27b4d6a 100644
--- a/docs/zh/docs/tutorial/sql-databases.md
+++ b/docs/zh/docs/tutorial/sql-databases.md
@@ -78,9 +78,23 @@ ORM å
·æåšä»£ç åæ°æ®åºè¡šïŒâ*å
³ç³»åâïŒäžç**对象**ä¹éŽ
ç°åšè®©æ们ççæ¯äžªæ件/æš¡åçäœçšã
+## å®è£
SQLAlchemy
+
+å
äžèœœ`SQLAlchemy`æéèŠçäŸèµïŒ
+
+
+
+```console
+$ pip install sqlalchemy
+
+---> 100%
+```
+
+
+
## å建 SQLAlchemy éšä»¶
-让æ们æ¶åå°æ件`sql_app/database.py`ã
+让æ们蜬å°æ件`sql_app/database.py`ã
### 富å
¥ SQLAlchemy éšä»¶
From d6b4c6c65c8ee8922940b7def38bf60ed1dfeb53 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:31:14 +0000
Subject: [PATCH 052/217] =?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 db3a4d4b22457..c3e1606cb80cc 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Spanish translation for `docs/es/docs/learn/index.md`. PR [#10885](https://github.com/tiangolo/fastapi/pull/10885) by [@pablocm83](https://github.com/pablocm83).
* ð Add Ukrainian translation for `docs/uk/docs/tutorial/body-fields.md`. PR [#10670](https://github.com/tiangolo/fastapi/pull/10670) by [@ArtemKhymenko](https://github.com/ArtemKhymenko).
* ð Add Hungarian translation for `/docs/hu/docs/index.md`. PR [#10812](https://github.com/tiangolo/fastapi/pull/10812) by [@takacs](https://github.com/takacs).
* ð Add Turkish translation for `docs/tr/docs/newsletter.md`. PR [#10550](https://github.com/tiangolo/fastapi/pull/10550) by [@hasansezertasan](https://github.com/hasansezertasan).
From 3256c3ff073fa24bcb1a1a089a78869f9b7de77e Mon Sep 17 00:00:00 2001
From: Aleksandr Andrukhov
Date: Tue, 9 Jan 2024 18:31:45 +0300
Subject: [PATCH 053/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Russian=20translat?=
=?UTF-8?q?ion=20for=20`docs/ru/docs/learn/index.md`=20(#10539)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
docs/ru/docs/learn/index.md | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 docs/ru/docs/learn/index.md
diff --git a/docs/ru/docs/learn/index.md b/docs/ru/docs/learn/index.md
new file mode 100644
index 0000000000000..b2e4cabc751a6
--- /dev/null
+++ b/docs/ru/docs/learn/index.md
@@ -0,0 +1,5 @@
+# ÐбÑÑеМОе
+
+ÐЎеÑÑ Ð¿ÑеЎÑÑÐ°Ð²Ð»ÐµÐœÑ Ð²Ð²ÐŸÐŽÐœÑе ÑÐ°Ð·ÐŽÐµÐ»Ñ Ðž ÑÑебМÑе пПÑÐŸÐ±ÐžÑ ÐŽÐ»Ñ ÐžÐ·ÑÑÐµÐœÐžÑ **FastAPI**.
+
+ÐÑ ÐŒÐŸÐ¶ÐµÑе ÑÑОÑаÑÑ ÑÑП **кМОгПй**, **кÑÑÑПЌ**, **ПÑОÑОалÑÐœÑÐŒ** О ÑекПЌеМЎÑеЌÑÐŒ ÑпПÑПбПЌ ОзÑÑÐµÐœÐžÑ FastAPI. ð
From 01b106c29089208507611e48d98409912f18ad80 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:31:54 +0000
Subject: [PATCH 054/217] =?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 c3e1606cb80cc..f410e96e964f5 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Turkish translation for `docs/tr/docs/external-links.md`. PR [#10549](https://github.com/tiangolo/fastapi/pull/10549) by [@hasansezertasan](https://github.com/hasansezertasan).
* ð Add Spanish translation for `docs/es/docs/learn/index.md`. PR [#10885](https://github.com/tiangolo/fastapi/pull/10885) by [@pablocm83](https://github.com/pablocm83).
* ð Add Ukrainian translation for `docs/uk/docs/tutorial/body-fields.md`. PR [#10670](https://github.com/tiangolo/fastapi/pull/10670) by [@ArtemKhymenko](https://github.com/ArtemKhymenko).
* ð Add Hungarian translation for `/docs/hu/docs/index.md`. PR [#10812](https://github.com/tiangolo/fastapi/pull/10812) by [@takacs](https://github.com/takacs).
From cb53749798f5ccbc4016cb37827cf46f4c75f0ce Mon Sep 17 00:00:00 2001
From: KAZAMA-DREAM <73453137+KAZAMA-DREAM@users.noreply.github.com>
Date: Tue, 9 Jan 2024 23:33:25 +0800
Subject: [PATCH 055/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translat?=
=?UTF-8?q?ion=20for=20`docs/zh/docs/learn/index.md`=20(#10479)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: KAZAMA
---
docs/zh/docs/learn/index.md | 5 +++++
1 file changed, 5 insertions(+)
create mode 100644 docs/zh/docs/learn/index.md
diff --git a/docs/zh/docs/learn/index.md b/docs/zh/docs/learn/index.md
new file mode 100644
index 0000000000000..38696f6feae03
--- /dev/null
+++ b/docs/zh/docs/learn/index.md
@@ -0,0 +1,5 @@
+# åŠä¹
+
+以äžæ¯åŠä¹ **FastAPI** çä»ç»éšååæçšã
+
+æšå¯ä»¥è®€äžºè¿æ¯äžæ¬ **乊**ïŒäžéš **诟çš**ïŒæ¯ **å®æ¹** äžæšèçåŠä¹ FastAPIçæ¹æ³ãð
From b4ad143e3753b19628e6f7f339184f95219b223c Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:33:53 +0000
Subject: [PATCH 056/217] =?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 f410e96e964f5..188e09a8f06c0 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Update SQLAlchemy instruction in Chinese translation `docs/zh/docs/tutorial/sql-databases.md`. PR [#9712](https://github.com/tiangolo/fastapi/pull/9712) by [@Royc30ne](https://github.com/Royc30ne).
* ð Add Turkish translation for `docs/tr/docs/external-links.md`. PR [#10549](https://github.com/tiangolo/fastapi/pull/10549) by [@hasansezertasan](https://github.com/hasansezertasan).
* ð Add Spanish translation for `docs/es/docs/learn/index.md`. PR [#10885](https://github.com/tiangolo/fastapi/pull/10885) by [@pablocm83](https://github.com/pablocm83).
* ð Add Ukrainian translation for `docs/uk/docs/tutorial/body-fields.md`. PR [#10670](https://github.com/tiangolo/fastapi/pull/10670) by [@ArtemKhymenko](https://github.com/ArtemKhymenko).
From 1021152f0a35a78954b36c7e6b534c4eeb9ff45b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hasan=20Sezer=20Ta=C5=9Fan?=
<13135006+hasansezertasan@users.noreply.github.com>
Date: Tue, 9 Jan 2024 18:35:44 +0300
Subject: [PATCH 057/217] =?UTF-8?q?=F0=9F=8C=90=20Update=20Turkish=20trans?=
=?UTF-8?q?lation=20for=20`docs/tr/docs/index.md`=20(#10444)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/tr/docs/index.md | 281 +++++++++++++++++++++---------------------
1 file changed, 141 insertions(+), 140 deletions(-)
diff --git a/docs/tr/docs/index.md b/docs/tr/docs/index.md
index e61f5b82cdfdf..ac8830880b35d 100644
--- a/docs/tr/docs/index.md
+++ b/docs/tr/docs/index.md
@@ -2,45 +2,47 @@
- FastAPI framework, yÃŒksek performanslı, öÄrenmesi kolay, geliÅtirmesi hızlı, kullanıma sunulmaya hazır.
+ FastAPI framework, yÃŒksek performanslı, öÄrenmesi oldukça kolay, kodlaması hızlı, kullanıma hazır
-
-
+
+
-
-
+
+
+
+
+
---
-**dokÃŒmantasyon**: https://fastapi.tiangolo.com
+**DokÃŒmantasyon**: https://fastapi.tiangolo.com
-**Kaynak kodu**: https://github.com/tiangolo/fastapi
+**Kaynak Kod**: https://github.com/tiangolo/fastapi
---
-FastAPI, Python 3.8+'nın standart type hintlerine dayanan modern ve hızlı (yÃŒksek performanslı) API'lar oluÅturmak için kullanılabilecek web framework'ÃŒ.
+FastAPI, Python 3.8+ 'nin standart tip belirteçleri ne dayalı, modern ve hızlı (yÃŒksek performanslı) API'lar oluÅturmak için kullanılabilecek web framework'tÃŒr.
-Ana özellikleri:
+Temel özellikleri Åunlardır:
-* **Hızlı**: çok yÃŒksek performanslı, **NodeJS** ve **Go** ile eÅdeÄer seviyede performans saÄlıyor, (Starlette ve Pydantic sayesinde.) [Python'un en hızlı frameworklerinden bir tanesi.](#performans).
-* **Kodlaması hızlı**: Yeni özellikler geliÅtirmek neredeyse %200 - %300 daha hızlı. *
-* **Daha az bug**: GeliÅtirici (insan) kaynaklı hatalar neredeyse %40 azaltıldı. *
-* **Sezgileri gÌçlÃŒ**: Editor (otomatik-tamamlama) desteÄi harika. Otomatik tamamlama her yerde. Debuglamak ile daha az zaman harcayacaksınız.
-* **Kolay**: ÃÄrenmesi ve kullanması kolay olacak Åekilde. DokÃŒman okumak için harcayacaÄınız sÃŒre azaltıldı.
-* **Kısa**: Kod tekrarını minimuma indirdik. Fonksiyon parametrelerinin tiplerini belirtmede farklı yollar sunarak karÅılaÅacaÄınız bug'ları azalttık.
-* **GÌçlÌ**: Otomatik dokÌmantasyon ile beraber, kullanıma hazır kod yaz.
+* **Hızlı**: Ãok yÃŒksek performanslı, **NodeJS** ve **Go** ile eÅit dÃŒzeyde (Starlette ve Pydantic sayesinde). [En hızlı Python framework'lerinden bir tanesidir](#performans).
+* **Kodlaması Hızlı**: GeliÅtirme hızını yaklaÅık %200 ile %300 aralıÄında arttırır. *
+* **Daha az hata**: Ä°nsan (geliÅtirici) kaynaklı hataları yaklaÅık %40 azaltır. *
+* **Sezgisel**: MuhteÅem bir editör desteÄi. Her yerde otomatik tamamlama . Hata ayıklama ile daha az zaman harcayacaksınız.
+* **Kolay**: ÃÄrenmesi ve kullanması kolay olacak Åekilde tasarlandı. DokÃŒman okuma ile daha az zaman harcayacaksınız.
+* **Kısa**: Kod tekrarı minimize edildi. Her parametre tanımlamasında birden fazla özellik ve daha az hatayla karÅılaÅacaksınız.
+* **GÌçlÃŒ**: Otomatik ve etkileÅimli dokÃŒmantasyon ile birlikte, kullanıma hazır kod elde edebilirsiniz.
+* **Standard öncelikli**: API'lar için açık standartlara dayalı (ve tamamen uyumlu); OpenAPI (eski adıyla Swagger) ve JSON Schema .
-* **Standartlar belirli**: Tamamiyle API'ların açık standartlara baÄlı ve (tam uyumlululuk içerisinde); OpenAPI (eski adıyla Swagger) ve JSON Schema .
+* ilgili kanılar, dahili geliÅtirme ekibinin geliÅtirdikleri ÃŒrÃŒnlere yaptıkları testlere dayanmaktadır.
-* Bahsi geçen rakamsal ifadeler tamamiyle, geliÅtirme takımının kendi sundukları ÃŒrÃŒnÃŒ geliÅtirirken yaptıkları testlere dayanmakta.
-
-## Sponsors
+## Sponsorlar
@@ -55,63 +57,61 @@ Ana özellikleri:
-Other sponsors
+DiÄer Sponsorlar
## GörÃŒÅler
-
-"_[...] BugÃŒnlerde **FastAPI**'ı çok fazla kullanıyorum [...] Aslına bakarsanız **Microsoft'taki Machine Learning servislerimizin** hepsinde kullanmayı dÃŒÅÃŒnÃŒyorum. FastAPI ile geliÅtirdiÄimiz servislerin bazıları çoktan **Windows**'un ana ÃŒrÃŒnlerine ve **Office** ÃŒrÃŒnlerine entegre edilmeye baÅlandı bile._"
+"_[...] BugÌnlerde **FastAPI**'ı çok fazla kullanıyorum. [...] Aslında bunu ekibimin **Microsoft'taki Machine Learning servislerinin** tamamında kullanmayı planlıyorum. Bunlardan bazıları **Windows**'un ana ÌrÌnlerine ve **Office** ÌrÌnlerine entegre ediliyor._"
Kabir Khan -
Microsoft (ref)
---
-
-"_**FastAPI**'ı **tahminlerimiz**'i sorgulanabilir hale getirmek için **REST** mimarisı ile beraber server ÃŒzerinde kullanmaya baÅladık._"
-
+"_**FastAPI**'ı **tahminlerimiz**'i sorgulanabilir hale getirecek bir **REST** sunucu oluÅturmak için benimsedik/kullanmaya baÅladık._"
Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala -
Uber (ref)
---
-
-"_**Netflix** **kriz yönetiminde** orkestrasyon yapabilmek için geliÅtirdiÄi yeni framework'ÃŒ **Dispatch**'in, açık kaynak versiyonunu paylaÅmaktan gurur duyuyor. [**FastAPI** ile yapıldı.]_"
+"_**Netflix**, **kriz yönetiminde** orkestrasyon yapabilmek için geliÅtirdiÄi yeni framework'ÃŒ **Dispatch**'in, açık kaynak sÃŒrÃŒmÃŒnÃŒ paylaÅmaktan gurur duyuyor. [**FastAPI** ile yapıldı.]_"
Kevin Glisson, Marc Vilanova, Forest Monsen -
Netflix (ref)
---
-
"_**FastAPI** için ayın ÃŒzerindeymiÅcesine heyecanlıyım. Ãok eÄlenceli!_"
-
---
-"_DÃŒrÃŒst olmak gerekirse, geliÅtirdiÄin Åey bir çok açıdan çok saÄlam ve parlak gözÃŒkÃŒyor. Açıkcası benim **Hug**'ı tasarlarken yapmaya çalıÅtıÄım Åey buydu - bunu birisinin baÅardıÄını görmek gerçekten çok ilham verici._"
+"_DÃŒrÃŒst olmak gerekirse, inÅa ettiÄiniz Åey gerçekten saÄlam ve profesyonel görÃŒnÃŒyor. Birçok açıdan **Hug**'ın olmasını istediÄim Åey tam da bu - böyle bir Åeyi inÅa eden birini görmek gerçekten ilham verici._"
-Timothy Crosley -
Hug 'ın Yaratıcısı (ref)
+Timothy Crosley -
Hug 'ın Yaratıcısı (ref)
---
-"_EÄer REST API geliÅtirmek için **modern bir framework** öÄrenme arayıÅında isen, **FastAPI**'a bir göz at [...] Hızlı, kullanımı ve öÄrenmesi kolay. [...]_"
+"_EÄer REST API geliÅtirmek için **modern bir framework** öÄrenme arayıÅında isen, **FastAPI**'a bir göz at [...] Hızlı, kullanımı ve öÄrenmesi kolay. [...]_"
+
+"_**API** servislerimizi **FastAPI**'a taÅıdık [...] Sizin de beÄeneceÄinizi dÃŒÅÃŒnÃŒyoruz. [...]_"
-"_Biz **API** servislerimizi **FastAPI**'a geçirdik [...] Sizin de beÄeneceÄinizi dÃŒÅÃŒnÃŒyoruz. [...]_"
+
+---
+"_Python ile kullanıma hazır bir API oluÅturmak isteyen herhangi biri için, **FastAPI**'ı Åiddetle tavsiye ederim. **Harika tasarlanmıÅ**, **kullanımı kolay** ve **yÃŒksek ölçeklenebilir**, API odaklı geliÅtirme stratejimizin **ana bileÅeni** haline geldi ve Virtual TAC Engineer gibi birçok otomasyon ve servisi yönetiyor._"
-
+Deon Pillsbury -
Cisco (ref)
---
-## **Typer**, komut satırı uygulamalarının FastAPI'ı
+## Komut Satırı Uygulamalarının FastAPI'ı: **Typer**
-EÄer API yerine komut satırı uygulaması geliÅtiriyor isen **Typer** 'a bir göz at.
+EÄer API yerine, terminalde kullanılmak ÃŒzere bir komut satırı uygulaması geliÅtiriyorsanız **Typer** 'a göz atabilirsiniz.
-**Typer** kısaca FastAPI'ın kÌçÌk kız kardeÅi. Komut satırı uygulamalarının **FastAPI'ı** olması hedeflendi. âšïž ð
+**Typer** kısaca FastAPI'ın kÌçÌk kardeÅi. Ve hedefi komut satırı uygulamalarının **FastAPI'ı** olmak. âšïž ð
## Gereksinimler
@@ -122,7 +122,7 @@ FastAPI iki devin omuzları ÌstÌnde duruyor:
* Web tarafı için Starlette .
* Data tarafı için Pydantic .
-## YÃŒkleme
+## Kurulum
@@ -134,7 +134,7 @@ $ pip install fastapi
-Uygulamanı kullanılabilir hale getirmek için Uvicorn ya da Hypercorn gibi bir ASGI serverına ihtiyacın olacak.
+Uygulamamızı kullanılabilir hale getirmek için Uvicorn ya da Hypercorn gibi bir ASGI sunucusuna ihtiyacımız olacak.
@@ -148,9 +148,9 @@ $ pip install "uvicorn[standard]"
## Ãrnek
-### Åimdi dene
+### Kodu OluÅturalım
-* `main.py` adında bir dosya oluÅtur :
+* `main.py` adında bir dosya oluÅturup içine Åu kodu yapıÅtıralım:
```Python
from typing import Union
@@ -173,9 +173,9 @@ def read_item(item_id: int, q: Union[str, None] = None):
Ya da async def
...
-EÄer kodunda `async` / `await` var ise, `async def` kullan:
+EÄer kodunuzda `async` / `await` varsa, `async def` kullanalım:
-```Python hl_lines="9 14"
+```Python hl_lines="9 14"
from typing import Union
from fastapi import FastAPI
@@ -195,13 +195,13 @@ async def read_item(item_id: int, q: Union[str, None] = None):
**Not**:
-EÄer ne olduÄunu bilmiyor isen _"Acelen mi var?"_ kısmını oku `async` ve `await` .
+EÄer bu konu hakkında bilginiz yoksa `async` ve `await` dokÃŒmantasyonundaki _"Aceleniz mi var?"_ kısmını kontrol edebilirsiniz.
-### ÃalıÅtır
+### Kodu ÃalıÅtıralım
-Serverı aÅaÄıdaki komut ile çalıÅtır:
+Sunucuyu aÅaÄıdaki komutla çalıÅtıralım:
@@ -218,56 +218,56 @@ INFO: Application startup complete.
-ÃalıÅtırdıÄımız uvicorn main:app --reload
hakkında...
+uvicorn main:app --reload
komutuyla ilgili...
-`uvicorn main:app` Åunları ifade ediyor:
+`uvicorn main:app` komutunu Åu Åekilde açıklayabiliriz:
* `main`: dosya olan `main.py` (yani Python "modÌlÌ").
-* `app`: ise `main.py` dosyasının içerisinde oluÅturduÄumuz `app = FastAPI()` 'a denk geliyor.
-* `--reload`: ise kodda herhangi bir deÄiÅiklik yaptıÄımızda serverın yapılan deÄiÅiklerileri algılayıp, deÄiÅiklikleri siz herhangi bir Åey yapmadan uygulamasını saÄlıyor.
+* `app`: ise `main.py` dosyasının içerisinde `app = FastAPI()` satırında oluÅturduÄumuz `FastAPI` nesnesi.
+* `--reload`: kod deÄiÅikliklerinin ardından sunucuyu otomatik olarak yeniden baÅlatır. Bu parameteyi sadece geliÅtirme aÅamasında kullanmalıyız.
-### DokÃŒmantasyonu kontrol et
+### Åimdi de Kontrol Edelim
-Browserını aç ve Åu linke git
http://127.0.0.1:8000/items/5?q=somequery .
+Tarayıcımızda Åu baÄlantıyı açalım
http://127.0.0.1:8000/items/5?q=somequery .
-Bir JSON yanıtı göreceksin:
+AÅaÄıdaki gibi bir JSON yanıtıyla karÅılaÅacaÄız:
```JSON
{"item_id": 5, "q": "somequery"}
```
-Az önce oluÅturduÄun API:
+Az önce oluÅturduÄumuz API:
-* `/` ve `/items/{item_id}` adreslerine HTTP talebi alabilir hale geldi.
-* Ä°ki _adresde_ `GET`
operasyonlarını (HTTP _metodları_ olarakta bilinen) yapabilir hale geldi.
-* `/items/{item_id}` _adresi_ ayrıca bir `item_id` _adres parametresine_ sahip ve bu bir `int` olmak zorunda.
-* `/items/{item_id}` _adresi_ opsiyonel bir `str` _sorgu paramtersine_ sahip bu da `q`.
+* `/` ve `/items/{item_id}`
_yollarına_ HTTP isteÄi alabilir.
+* Ä°ki _yolda_ `GET`
operasyonlarını (HTTP _metodları_ olarak da bilinen) kabul ediyor.
+* `/items/{item_id}` _yolu_ `item_id` adında bir _yol parametresine_ sahip ve bu parametre `int` deÄer almak zorundadır.
+* `/items/{item_id}` _yolu_ `q` adında bir _yol parametresine_ sahip ve bu parametre opsiyonel olmakla birlikte, `str` deÄer almak zorundadır.
-### Ä°nteraktif API dokÃŒmantasyonu
+### EtkileÅimli API DokÃŒmantasyonu
-Åimdi
http://127.0.0.1:8000/docs adresine git.
+Åimdi
http://127.0.0.1:8000/docs baÄlantısını açalım.
-Senin için otomatik oluÅturulmuÅ(
Swagger UI tarafından saÄlanan) interaktif bir API dokÃŒmanı göreceksin:
+
Swagger UI tarafından saÄlanan otomatik etkileÅimli bir API dokÃŒmantasyonu göreceÄiz:
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
-### Alternatif API dokÃŒmantasyonu
+### Alternatif API DokÃŒmantasyonu
-Åimdi
http://127.0.0.1:8000/redoc adresine git.
+Åimdi
http://127.0.0.1:8000/redoc baÄlantısını açalım.
-Senin için alternatif olarak (
ReDoc tarafından saÄlanan) bir API dokÃŒmantasyonu daha göreceksin:
+
ReDoc tarafından saÄlanan otomatik dokÃŒmantasyonu göreceÄiz:
![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
-## Ãrnek bir deÄiÅiklik
+## ÃrneÄi GÃŒncelleyelim
-Åimdi `main.py` dosyasını deÄiÅtirelim ve body ile `PUT` talebi alabilir hale getirelim.
+Åimdi `main.py` dosyasını, `PUT` isteÄiyle birlikte bir gövde alacak Åekilde deÄiÅtirelim.
-Åimdi Pydantic sayesinde, Python'un standart tiplerini kullanarak bir body tanımlayacaÄız.
+
Gövde yi Pydantic sayesinde standart python tiplerini kullanarak tanımlayalım.
-```Python hl_lines="4 9 10 11 12 25 26 27"
+```Python hl_lines="4 9-12 25-27"
from typing import Union
from fastapi import FastAPI
@@ -297,41 +297,41 @@ def update_item(item_id: int, item: Item):
return {"item_name": item.name, "item_id": item_id}
```
-Server otomatik olarak yeniden baÅlamalı (çÌnkÃŒ yukarıda `uvicorn`'u çalıÅtırırken `--reload` parametresini kullandık.).
+Sunucu otomatik olarak yeniden baÅlamıŠolmalı (çÌnkÃŒ yukarıda `uvicorn` komutuyla birlikte `--reload` parametresini kullandık).
-### Ä°nteraktif API dokÃŒmantasyonu'nda deÄiÅtirme yapmak
+### EtkileÅimli API DokÃŒmantasyonundaki DeÄiÅimi Görelim
-Åimdi
http://127.0.0.1:8000/docs baÄlantısına tekrar git.
+Åimdi
http://127.0.0.1:8000/docs baÄlantısına tekrar gidelim.
-* İnteraktif API dokÌmantasyonu, yeni body ile beraber çoktan yenilenmiŠolması lazım:
+* EtkileÅimli API dokÃŒmantasyonu, yeni gövdede dahil olmak ÃŒzere otomatik olarak gÃŒncellenmiÅ olacak:
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
-* "Try it out"a tıkla, bu senin API parametleri Ìzerinde deneme yapabilmene izin veriyor:
+* "Try it out" butonuna tıklayalım, bu iÅlem API parametleri ÃŒzerinde deÄiÅiklik yapmamıza ve doÄrudan API ile etkileÅime geçmemize imkan saÄlayacak:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png)
-* Åimdi "Execute" butonuna tıkla, kullanıcı arayÃŒzÃŒ otomatik olarak API'ın ile baÄlantı kurarak ona bu parametreleri gönderecek ve sonucu karÅına getirecek.
+* Åimdi "Execute" butonuna tıklayalım, kullanıcı arayÃŒzÃŒ API'ımız ile baÄlantı kurup parametreleri gönderecek ve sonucu ekranımıza getirecek:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png)
-### Alternatif API dokÃŒmantasyonunda deÄiÅtirmek
+### Alternatif API DokÃŒmantasyonundaki DeÄiÅimi Görelim
-Åimdi ise
http://127.0.0.1:8000/redoc adresine git.
+Åimdi ise
http://127.0.0.1:8000/redoc baÄlantısına tekrar gidelim.
-* Alternatif dokÃŒmantasyonda koddaki deÄiÅimler ile beraber kendini yeni query ve body ile gÃŒncelledi.
+* Alternatif dokÃŒmantasyonda yaptıÄımız deÄiÅiklikler ile birlikte yeni sorgu parametresi ve gövde bilgisi ile gÃŒncelemiÅ olacak:
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
### Ãzet
-Ãzetleyecek olursak, URL, sorgu veya request body'deki parametrelerini fonksiyon parametresi olarak kullanıyorsun. Bu parametrelerin veri tiplerini bir kere belirtmen yeterli.
+Ãzetlemek gerekirse, parametrelerin, gövdenin, vb. veri tiplerini fonksiyon parametreleri olarak **bir kere** tanımlıyoruz.
-Type-hinting iÅlemini Python dilindeki standart veri tipleri ile yapabilirsin
+Bu iÅlemi standart modern Python tipleriyle yapıyoruz.
-Yeni bir syntax'e alıÅmana gerek yok, metodlar ve classlar zaten spesifik kÃŒtÃŒphanelere ait.
+Yeni bir sözdizimi yapısını, bir kÃŒtÃŒphane özel metod veya sınıfları öÄrenmeye gerek yoktur.
-Sadece standart **Python 3.8+**.
+Hepsi sadece **Python 3.8+** standartlarına dayalıdır.
Ãrnek olarak, `int` tanımlamak için:
@@ -339,64 +339,64 @@ Sadece standart **Python 3.8+**.
item_id: int
```
-ya da daha kompleks `Item` tipi:
+ya da daha kompleks herhangi bir python modelini tanımlayabiliriz, örneÄin `Item` modeli için:
```Python
item: Item
```
-...sadece kısa bir parametre tipi belirtmekle beraber, sahip olacakların:
+...ve sadece kısa bir parametre tipi belirterek elde ettiklerimiz:
-* Editör desteÄi dahil olmak ÃŒzere:
+* Editör desteÄiyle birlikte:
* Otomatik tamamlama.
- * Tip sorguları.
-* Datanın tipe uyumunun sorgulanması:
- * EÄer data geçersiz ise, otomatik olarak hataları ayıklar.
- * Ãok derin JSON objelerinde bile veri tipi sorgusu yapar.
-* Gelen verinin
dönÃŒÅÃŒmÃŒnÃŒ aÅaÄıdaki veri tiplerini kullanarak gerçekleÅtirebiliyor.
+ * Tip kontrolÌ.
+* Veri DoÄrulama:
+ * Veri geçerli deÄilse, otomatik olarak açıklayıcı hatalar gösterir.
+ * Ãok
derin JSON nesnelerinde bile doÄrulama yapar.
+* Gelen verinin
dönÃŒÅÃŒmÃŒnÃŒ aÅaÄıdaki veri tiplerini kullanarak gerçekleÅtirir:
* JSON.
- * Path parametreleri.
- * Query parametreleri.
- * Cookies.
+ * Yol parametreleri.
+ * Sorgu parametreleri.
+ * Ãerezler.
* Headers.
- * Forms.
- * Files.
-* Giden verinin
dönÃŒÅÃŒmÃŒnÃŒ aÅaÄıdaki veri tiplerini kullanarak gerçekleÅtirebiliyor (JSON olarak):
- * Python tiplerinin (`str`, `int`, `float`, `bool`, `list`, vs) çevirisi.
- * `datetime` objesi.
- * `UUID` objesi.
+ * Formlar.
+ * Dosyalar.
+* Giden verinin
dönÃŒÅÃŒmÃŒnÃŒ aÅaÄıdaki veri tiplerini kullanarak gerçekleÅtirir (JSON olarak):
+ * Python tiplerinin (`str`, `int`, `float`, `bool`, `list`, vb) dönÃŒÅÃŒmÃŒ.
+ * `datetime` nesnesi.
+ * `UUID` nesnesi.
* Veritabanı modelleri.
- * ve daha fazlası...
-* 2 alternatif kullanıcı arayÌzÌ dahil olmak Ìzere, otomatik interaktif API dokÌmanu:
+ * ve çok daha fazlası...
+* 2 alternatif kullanıcı arayÃŒzÃŒ dahil olmak ÃŒzere, otomatik etkileÅimli API dokÃŒmantasyonu saÄlar:
* Swagger UI.
* ReDoc.
---
-Az önceki kod örneÄine geri dönelim, **FastAPI**'ın yapacaklarına bir bakıŠatalım:
+Az önceki örneÄe geri dönelim, **FastAPI**'ın yapacaklarına bir bakıŠatalım:
-* `item_id`'nin `GET` ve `PUT` talepleri içinde olup olmadıÄının doÄruluÄunu kontol edecek.
-* `item_id`'nin tipinin `int` olduÄunu `GET` ve `PUT` talepleri içinde olup olmadıÄının doÄruluÄunu kontol edecek.
- * EÄer `GET` ve `PUT` içinde yok ise ve `int` deÄil ise, sebebini belirten bir hata mesajı gösterecek
-* Opsiyonel bir `q` parametresinin `GET` talebi için (`http://127.0.0.1:8000/items/foo?q=somequery` içinde) olup olmadıÄını kontrol edecek
+* `item_id`'nin `GET` ve `PUT` istekleri için, yolda olup olmadıÄının kontol edecek.
+* `item_id`'nin `GET` ve `PUT` istekleri için, tipinin `int` olduÄunu doÄrulayacak.
+ * EÄer deÄilse, sebebini belirten bir hata mesajı gösterecek.
+* Opsiyonel bir `q` parametresinin `GET` isteÄi içinde (`http://127.0.0.1:8000/items/foo?q=somequery` gibi) olup olmadıÄını kontrol edecek
* `q` parametresini `= None` ile oluÅturduÄumuz için, opsiyonel bir parametre olacak.
- * EÄer `None` olmasa zorunlu bir parametre olacak idi (bu yÃŒzden body'de `PUT` parametresi var).
-* `PUT` talebi için `/items/{item_id}`'nin body'sini, JSON olarak okuyor:
- * `name` adında bir parametetre olup olmadıÄını ve var ise onun `str` olup olmadıÄını kontol ediyor.
- * `price` adında bir parametetre olup olmadıÄını ve var ise onun `float` olup olmadıÄını kontol ediyor.
- * `is_offer` adında bir parametetre olup olmadıÄını ve var ise onun `bool` olup olmadıÄını kontol ediyor.
- * Bunların hepsini en derin JSON modellerinde bile yapacaktır.
-* BÌtÌn veri tiplerini otomatik olarak JSON'a çeviriyor veya tam tersi.
-* Her Åeyi dokÃŒmanlayıp, çeÅitli yerlerde:
- * Ä°nteraktif dokÃŒmantasyon sistemleri.
- * Otomatik alıcı kodu ÃŒretim sistemlerinde ve çeÅitli dillerde.
-* İki ayrı web arayÌzÌyle direkt olarak interaktif bir dokÌmantasyon sunuyor.
+ * EÄer `None` olmasa zorunlu bir parametre olacaktı (`PUT` metodunun gövdesinde olduÄu gibi).
+* `PUT` isteÄi için `/items/{item_id}`'nin gövdesini, JSON olarak doÄrulayıp okuyacak:
+ * `name` adında zorunlu bir parametre olup olmadıÄını ve varsa tipinin `str` olup olmadıÄını kontol edecek.
+ * `price` adında zorunlu bir parametre olup olmadıÄını ve varsa tipinin `float` olup olmadıÄını kontol edecek.
+ * `is_offer` adında opsiyonel bir parametre olup olmadıÄını ve varsa tipinin `float` olup olmadıÄını kontol edecek.
+ * Bunların hepsi en derin JSON nesnelerinde bile çalıÅacak.
+* Verilerin JSON'a ve JSON'ın python nesnesine dönÃŒÅÃŒmÃŒ otomatik olarak yapılacak.
+* Her Åeyi OpenAPI ile uyumlu bir Åekilde otomatik olarak dokÃŒmanlayacak ve bunlarda aÅaÄıdaki gibi kullanılabilecek:
+ * EtkileÅimli dokÃŒmantasyon sistemleri.
+ * Bir çok programlama dili için otomatik istemci kodu Ìretim sistemleri.
+* Ä°ki ayrı etkileÅimli dokÃŒmantasyon arayÃŒzÃŒnÃŒ doÄrudan saÄlayacak.
---
-HenÃŒz yÃŒzeysel bir bakıŠattık, fakat sen çoktan çalıÅma mantıÄını anladın.
+Daha yeni baÅladık ama çalıÅma mantıÄını çoktan anlamıŠoldunuz.
-Åimdi aÅaÄıdaki satırı deÄiÅtirmeyi dene:
+Åimdi aÅaÄıdaki satırı deÄiÅtirmeyi deneyin:
```Python
return {"item_name": item.name, "item_id": item_id}
@@ -414,22 +414,22 @@ HenÃŒz yÃŒzeysel bir bakıŠattık, fakat sen çoktan çalıÅma mantıÄını
... "item_price": item.price ...
```
-...Åimdi editör desteÄinin nasıl veri tiplerini bildiÄini ve otomatik tamamladıÄını gör:
+...ve editörÃŒnÃŒn veri tiplerini bildiÄini ve otomatik tamamladıÄını göreceksiniz:
![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
-Daha fazla örnek ve özellik için
Tutorial - User Guide sayfasını git.
+Daha fazal özellik içeren, daha eksiksiz bir örnek için
ÃÄretici - Kullanıcı Rehberi sayfasını ziyaret edebilirsin.
-**Spoiler**: ÃÄretici - Kullanıcı rehberi Åunları içeriyor:
+**Spoiler**: ÃÄretici - Kullanıcı rehberi Åunları içerir:
-* **Parameterlerini** nasıl **headers**, **cookies**, **form fields** ve **files** olarak deklare edebileceÄini.
-* `maximum_length` ya da `regex` gibi Åeylerle nasıl **doÄrulama** yapabileceÄini.
-* Ãok gÌçlÃŒ ve kullanımı kolay **
Zorunluluk Entegrasyonu ** oluÅturmayı.
-* GÃŒvenlik ve kimlik doÄrulama, **JWT tokenleri**'yle beraber **OAuth2** desteÄi, ve **HTTP Basic** doÄrulaması.
-* Ä°leri seviye fakat ona göre oldukça basit olan **derince oluÅturulmuÅ JSON modelleri** (Pydantic sayesinde).
+* **Parameterlerin**, **headers**, **çerezler**, **form alanları** ve **dosyalar** olarak tanımlanması.
+* `maximum_length` ya da `regex` gibi **doÄrulama kısıtlamalarının** nasıl yapılabileceÄi.
+* Ãok gÌçlÃŒ ve kullanımı kolay **
BaÄımlılık Enjeksiyonu ** sistemi oluÅturmayı.
+* GÃŒvenlik ve kimlik doÄrulama, **JWT tokenleri** ile **OAuth2** desteÄi, ve **HTTP Basic** doÄrulaması.
+* İleri seviye fakat bir o kadarda basit olan **çok derin JSON modelleri** (Pydantic sayesinde).
+* **GraphQL** entegrasyonu:
Strawberry ve diÄer kÃŒtÃŒphaneleri kullanarak.
* DiÄer ekstra özellikler (Starlette sayesinde):
- * **WebSockets**
- * **GraphQL**
+ * **WebSocketler**
* HTTPX ve `pytest` sayesinde aÅırı kolay testler.
* **CORS**
* **Cookie Sessions**
@@ -437,33 +437,34 @@ Daha fazla örnek ve özellik için
Python'un en hızlı frameworklerinden birisi , sadece Starlette ve Uvicorn'dan daha yavaŠki FastAPI bunların Ìzerine kurulu.
+BaÄımsız TechEmpower kıyaslamaları gösteriyor ki, Uvicorn ile çalıÅtırılan **FastAPI** uygulamaları
en hızlı Python framework'lerinden birisi , sadece Starlette ve Uvicorn'dan yavaÅ, ki FastAPI bunların ÃŒzerine kurulu bir kÃŒtÃŒphanedir.
-Daha fazla bilgi için, bu bölÌme bir göz at
Benchmarks .
+Daha fazla bilgi için, bu bölÌme bir göz at
Kıyaslamalar .
-## Opsiyonel gereksinimler
+## Opsiyonel Gereksinimler
Pydantic tarafında kullanılan:
*
email_validator
- email doÄrulaması için.
+*
pydantic-settings
- ayar yönetimi için.
+*
pydantic-extra-types
- Pydantic ile birlikte kullanılabilecek ek tipler için.
Starlette tarafında kullanılan:
-*
httpx
- EÄer `TestClient` kullanmak istiyorsan gerekli.
-*
jinja2
- EÄer kendine ait template konfigÃŒrasyonu oluÅturmak istiyorsan gerekli
-*
python-multipart
- Form kullanmak istiyorsan gerekli
("dönÃŒÅÃŒmÃŒ") .
+*
httpx
- EÄer `TestClient` yapısını kullanacaksanız gereklidir.
+*
jinja2
- EÄer varsayılan template konfigÃŒrasyonunu kullanacaksanız gereklidir.
+*
python-multipart
- EÄer `request.form()` ile form
dönÃŒÅÃŒmÃŒ desteÄini kullanacaksanız gereklidir.
*
itsdangerous
- `SessionMiddleware` desteÄi için gerekli.
*
pyyaml
- `SchemaGenerator` desteÄi için gerekli (Muhtemelen FastAPI kullanırken ihtiyacınız olmaz).
-*
graphene
- `GraphQLApp` desteÄi için gerekli.
-*
ujson
- `UJSONResponse` kullanmak istiyorsan gerekli.
+*
ujson
- `UJSONResponse` kullanacaksanız gerekli.
Hem FastAPI hem de Starlette tarafından kullanılan:
-*
uvicorn
- oluÅturduÄumuz uygulamayı bir web sunucusuna servis etmek için gerekli
-*
orjson
- `ORJSONResponse` kullanmak istiyor isen gerekli.
+*
uvicorn
- oluÅturduÄumuz uygulamayı servis edecek web sunucusu görevini ÃŒstlenir.
+*
orjson
- `ORJSONResponse` kullanacaksanız gereklidir.
Bunların hepsini `pip install fastapi[all]` ile yÌkleyebilirsin.
## Lisans
-Bu proje, MIT lisansı Åartlarına göre lisanslanmıÅtır.
+Bu proje, MIT lisansı Åartları altında lisanslanmıÅtır.
From c471c9311371d12b3dd2ed80a5d078e8991a4c19 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:36:04 +0000
Subject: [PATCH 058/217] =?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 188e09a8f06c0..8706abf0f6088 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Russian translation for `docs/ru/docs/learn/index.md`. PR [#10539](https://github.com/tiangolo/fastapi/pull/10539) by [@AlertRED](https://github.com/AlertRED).
* ð Update SQLAlchemy instruction in Chinese translation `docs/zh/docs/tutorial/sql-databases.md`. PR [#9712](https://github.com/tiangolo/fastapi/pull/9712) by [@Royc30ne](https://github.com/Royc30ne).
* ð Add Turkish translation for `docs/tr/docs/external-links.md`. PR [#10549](https://github.com/tiangolo/fastapi/pull/10549) by [@hasansezertasan](https://github.com/hasansezertasan).
* ð Add Spanish translation for `docs/es/docs/learn/index.md`. PR [#10885](https://github.com/tiangolo/fastapi/pull/10885) by [@pablocm83](https://github.com/pablocm83).
From 031000fc6e242fb4582fe2753f6a62eea2890ef3 Mon Sep 17 00:00:00 2001
From: fhabers21 <58401847+fhabers21@users.noreply.github.com>
Date: Tue, 9 Jan 2024 16:36:32 +0100
Subject: [PATCH 059/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20German=20translati?=
=?UTF-8?q?on=20for=20`docs/de/docs/tutorial/first-steps.md`=20(#9530)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián RamÃrez
Co-authored-by: Georg Wicke-Arndt
---
docs/de/docs/tutorial/first-steps.md | 333 +++++++++++++++++++++++++++
1 file changed, 333 insertions(+)
create mode 100644 docs/de/docs/tutorial/first-steps.md
diff --git a/docs/de/docs/tutorial/first-steps.md b/docs/de/docs/tutorial/first-steps.md
new file mode 100644
index 0000000000000..5997f138f0ac3
--- /dev/null
+++ b/docs/de/docs/tutorial/first-steps.md
@@ -0,0 +1,333 @@
+# Erste Schritte
+
+Die einfachste FastAPI-Datei könnte wie folgt aussehen:
+
+```Python
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Kopieren Sie dies in eine Datei `main.py`.
+
+Starten Sie den Live-Server:
+
+
+
+```console
+$ uvicorn main:app --reload
+
+INFO : Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+INFO : Started reloader process [28720]
+INFO : Started server process [28722]
+INFO : Waiting for application startup.
+INFO : Application startup complete.
+```
+
+
+
+!!! note "Hinweis"
+ Der Befehl `uvicorn main:app` bezieht sich auf:
+
+ * `main`: die Datei `main.py` (das sogenannte Python-âModulâ).
+ * `app`: das Objekt, welches in der Datei `main.py` mit der Zeile `app = FastAPI()` erzeugt wurde.
+ * `--reload`: lÀsst den Server nach CodeÀnderungen neu starten. Verwenden Sie das nur wÀhrend der Entwicklung.
+
+In der Konsolenausgabe sollte es eine Zeile geben, die ungefÀhr so aussieht:
+
+```hl_lines="4"
+INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+```
+
+Diese Zeile zeigt die URL, unter der Ihre Anwendung auf Ihrem lokalen Computer bereitgestellt wird.
+
+### Testen Sie es
+
+Ãffnen Sie Ihren Browser unter http://127.0.0.1:8000.
+
+Sie werden folgende JSON-Antwort sehen:
+
+```JSON
+{"message": "Hello World"}
+```
+
+### Interaktive API-Dokumentation
+
+Gehen Sie als NÀchstes auf http://127.0.0.1:8000/docs .
+
+Sie werden die automatisch erzeugte, interaktive API-Dokumentation sehen (bereitgestellt durch Swagger UI ):
+
+![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
+
+### Alternative API-Dokumentation
+
+Gehen Sie nun auf http://127.0.0.1:8000/redoc .
+
+Dort sehen Sie die alternative, automatische Dokumentation (bereitgestellt durch ReDoc ):
+
+![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
+
+### OpenAPI
+
+**FastAPI** generiert ein âSchemaâ mit all Ihren APIs unter Verwendung des **OpenAPI**-Standards zur Definition von APIs.
+
+#### âSchemaâ
+
+Ein âSchemaâ ist eine Definition oder Beschreibung von etwas. Nicht der eigentliche Code, der es implementiert, sondern lediglich eine abstrakte Beschreibung.
+
+#### API-âSchemaâ
+
+In diesem Fall ist OpenAPI eine Spezifikation, die vorschreibt, wie ein Schema fÃŒr Ihre API zu definieren ist.
+
+Diese Schemadefinition enthÀlt Ihre API-Pfade, die möglichen Parameter, welche diese entgegennehmen, usw.
+
+#### Daten-âSchemaâ
+
+Der Begriff âSchemaâ kann sich auch auf die Form von Daten beziehen, wie z.B. einen JSON-Inhalt.
+
+In diesem Fall sind die JSON-Attribute und deren Datentypen, usw. gemeint.
+
+#### OpenAPI und JSON Schema
+
+OpenAPI definiert ein API-Schema fÃŒr Ihre API. Dieses Schema enthÀlt Definitionen (oder âSchemasâ) der Daten, die von Ihrer API unter Verwendung von **JSON Schema**, dem Standard fÃŒr JSON-Datenschemata, gesendet und empfangen werden.
+
+#### ÃberprÃŒfen Sie die `openapi.json`
+
+Falls Sie wissen möchten, wie das rohe OpenAPI-Schema aussieht: FastAPI generiert automatisch ein JSON (Schema) mit den Beschreibungen Ihrer gesamten API.
+
+Sie können es direkt einsehen unter: http://127.0.0.1:8000/openapi.json .
+
+Es wird ein JSON angezeigt, welches ungefÀhr so aussieht:
+
+```JSON
+{
+ "openapi": "3.1.0",
+ "info": {
+ "title": "FastAPI",
+ "version": "0.1.0"
+ },
+ "paths": {
+ "/items/": {
+ "get": {
+ "responses": {
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+
+
+
+...
+```
+
+#### WofÃŒr OpenAPI gedacht ist
+
+Das OpenAPI-Schema ist die Grundlage fÃŒr die beiden enthaltenen interaktiven Dokumentationssysteme.
+
+Es gibt dutzende Alternativen, die alle auf OpenAPI basieren. Sie können jede dieser Alternativen problemlos zu Ihrer mit **FastAPI** erstellten Anwendung hinzufÌgen.
+
+Ebenfalls können Sie es verwenden, um automatisch Code fÌr Clients zu generieren, die mit Ihrer API kommunizieren. Zum Beispiel fÌr Frontend-, Mobile- oder IoT-Anwendungen.
+
+## RÃŒckblick, Schritt fÃŒr Schritt
+
+### Schritt 1: Importieren von `FastAPI`
+
+```Python hl_lines="1"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+`FastAPI` ist eine Python-Klasse, die die gesamte FunktionalitÀt fÌr Ihre API bereitstellt.
+
+!!! note "Technische Details"
+ `FastAPI` ist eine Klasse, die direkt von `Starlette` erbt.
+
+ Sie können alle Starlette -FunktionalitÀten auch mit `FastAPI` nutzen.
+
+### Schritt 2: Erzeugen einer `FastAPI`-âInstanzâ
+
+```Python hl_lines="3"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+In diesem Beispiel ist die Variable `app` eine âInstanzâ der Klasse `FastAPI`.
+
+Dies wird der Hauptinteraktionspunkt fÃŒr die Erstellung all Ihrer APIs sein.
+
+Die Variable `app` ist dieselbe, auf die sich der Befehl `uvicorn` bezieht:
+
+
+
+```console
+$ uvicorn main:app --reload
+
+INFO : Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+```
+
+
+
+Wenn Sie Ihre Anwendung wie folgt erstellen:
+
+```Python hl_lines="3"
+{!../../../docs_src/first_steps/tutorial002.py!}
+```
+
+Und in eine Datei `main.py` einfÃŒgen, dann wÃŒrden Sie `uvicorn` wie folgt aufrufen:
+
+
+
+```console
+$ uvicorn main:my_awesome_api --reload
+
+INFO : Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+```
+
+
+
+### Schritt 3: Erstellen einer *Pfadoperation*
+
+#### Pfad
+
+âPfadâ bezieht sich hier auf den letzten Teil der URL, beginnend mit dem ersten `/`.
+
+In einer URL wie:
+
+```
+https://example.com/items/foo
+```
+
+... wÀre der Pfad folglich:
+
+```
+/items/foo
+```
+
+!!! info
+ Ein âPfadâ wird hÀufig auch als âEndpunktâ oder âRouteâ bezeichnet.
+
+Bei der Erstellung einer API ist der âPfadâ die wichtigste Möglichkeit zur Trennung von âAnliegenâ und âRessourcenâ.
+
+#### Operation
+
+âOperationâ bezieht sich hier auf eine der HTTP-âMethodenâ.
+
+Eine von diesen:
+
+* `POST`
+* `GET`
+* `PUT`
+* `DELETE`
+
+... und die etwas Exotischeren:
+
+* `OPTIONS`
+* `HEAD`
+* `PATCH`
+* `TRACE`
+
+Im HTTP-Protokoll können Sie mit jedem Pfad ÃŒber eine (oder mehrere) dieser âMethodenâ kommunizieren.
+
+---
+
+Bei der Erstellung von APIs verwenden Sie normalerweise diese spezifischen HTTP-Methoden, um eine bestimmte Aktion durchzufÃŒhren.
+
+Normalerweise verwenden Sie:
+
+* `POST`: um Daten zu erzeugen (create).
+* `GET`: um Daten zu lesen (read).
+* `PUT`: um Daten zu aktualisieren (update).
+* `DELETE`: um Daten zu löschen (delete).
+
+In OpenAPI wird folglich jede dieser HTTP-Methoden als âOperationâ bezeichnet.
+
+Wir werden sie auch â**Operationen**â nennen.
+
+#### Definieren eines *Pfadoperation-Dekorators*
+
+```Python hl_lines="6"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Das `@app.get("/")` sagt **FastAPI**, dass die Funktion direkt darunter fÌr die Bearbeitung von Anfragen zustÀndig ist, die an:
+
+ * den Pfad `/`
+ * unter der Verwendung der get
-Operation gehen
+
+!!! info "`@decorator` Information"
+ Diese `@something`-Syntax wird in Python âDekoratorâ genannt.
+
+ Sie platzieren ihn ÃŒber einer Funktion. Wie ein hÃŒbscher, dekorativer Hut (daher kommt wohl der Begriff).
+
+ Ein âDekoratorâ nimmt die darunter stehende Funktion und macht etwas damit.
+
+ In unserem Fall teilt dieser Dekorator **FastAPI** mit, dass die folgende Funktion mit dem **Pfad** `/` und der **Operation** `get` zusammenhÀngt.
+
+ Dies ist der â**Pfadoperation-Dekorator**â.
+
+Sie können auch die anderen Operationen verwenden:
+
+* `@app.post()`
+* `@app.put()`
+* `@app.delete()`
+
+Oder die exotischeren:
+
+* `@app.options()`
+* `@app.head()`
+* `@app.patch()`
+* `@app.trace()`
+
+!!! tip "Tipp"
+ Es steht Ihnen frei, jede Operation (HTTP-Methode) so zu verwenden, wie Sie es möchten.
+
+ **FastAPI** erzwingt keine bestimmte Bedeutung.
+
+ Die hier aufgefÃŒhrten Informationen dienen als Leitfaden und sind nicht verbindlich.
+
+ Wenn Sie beispielsweise GraphQL verwenden, fÃŒhren Sie normalerweise alle Aktionen nur mit âPOSTâ-Operationen durch.
+
+### Schritt 4: Definieren der **Pfadoperation-Funktion**
+
+Das ist unsere â**Pfadoperation-Funktion**â:
+
+* **Pfad**: ist `/`.
+* **Operation**: ist `get`.
+* **Funktion**: ist die Funktion direkt unter dem âDekoratorâ (unter `@app.get("/")`).
+
+```Python hl_lines="7"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Dies ist eine Python-Funktion.
+
+Sie wird von **FastAPI** immer dann aufgerufen, wenn sie eine Anfrage an die URL "`/`" mittels einer `GET`-Operation erhÀlt.
+
+In diesem Fall handelt es sich um eine `async`-Funktion.
+
+---
+
+Sie könnten sie auch als normale Funktion anstelle von `async def` definieren:
+
+```Python hl_lines="7"
+{!../../../docs_src/first_steps/tutorial003.py!}
+```
+
+!!! note "Hinweis"
+ Wenn Sie den Unterschied nicht kennen, lesen Sie [Async: *âIn Eile?â*](../async.md#in-eile){.internal-link target=_blank}.
+
+### Schritt 5: den Inhalt zurÃŒckgeben
+
+```Python hl_lines="8"
+{!../../../docs_src/first_steps/tutorial001.py!}
+```
+
+Sie können ein `dict`, eine `list`, einzelne Werte wie `str`, `int`, usw. zurÌckgeben.
+
+Sie können auch Pydantic-Modelle zurÌckgeben (dazu spÀter mehr).
+
+Es gibt viele andere Objekte und Modelle, die automatisch zu JSON konvertiert werden (einschlieÃlich ORMs usw.). Versuchen Sie, Ihre Lieblingsobjekte zu verwenden. Es ist sehr wahrscheinlich, dass sie bereits unterstÃŒtzt werden.
+
+## Zusammenfassung
+
+* Importieren Sie `FastAPI`.
+* Erstellen Sie eine `app` Instanz.
+* Schreiben Sie einen **Pfadoperation-Dekorator** (wie z.B. `@app.get("/")`).
+* Schreiben Sie eine **Pfadoperation-Funktion** (wie z.B. oben `def root(): ...`).
+* Starten Sie den Entwicklungsserver (z.B. `uvicorn main:app --reload`).
From 271b4f31440d29af4264c68c0376c44b790cc0a5 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:37:13 +0000
Subject: [PATCH 060/217] =?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 8706abf0f6088..e200823d05e1a 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Chinese translation for `docs/zh/docs/learn/index.md`. PR [#10479](https://github.com/tiangolo/fastapi/pull/10479) by [@KAZAMA-DREAM](https://github.com/KAZAMA-DREAM).
* ð Add Russian translation for `docs/ru/docs/learn/index.md`. PR [#10539](https://github.com/tiangolo/fastapi/pull/10539) by [@AlertRED](https://github.com/AlertRED).
* ð Update SQLAlchemy instruction in Chinese translation `docs/zh/docs/tutorial/sql-databases.md`. PR [#9712](https://github.com/tiangolo/fastapi/pull/9712) by [@Royc30ne](https://github.com/Royc30ne).
* ð Add Turkish translation for `docs/tr/docs/external-links.md`. PR [#10549](https://github.com/tiangolo/fastapi/pull/10549) by [@hasansezertasan](https://github.com/hasansezertasan).
From 152171e455cbd7f93214e014c441da39a26ae7ed Mon Sep 17 00:00:00 2001
From: xzmeng
Date: Tue, 9 Jan 2024 23:37:29 +0800
Subject: [PATCH 061/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translat?=
=?UTF-8?q?ion=20for=20`docs/zh/docs/deployment/index.md`=20(#10275)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: åŽå®ç <108172295+wdh99@users.noreply.github.com>
---
docs/zh/docs/deployment/index.md | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
create mode 100644 docs/zh/docs/deployment/index.md
diff --git a/docs/zh/docs/deployment/index.md b/docs/zh/docs/deployment/index.md
new file mode 100644
index 0000000000000..1ec0c5c5b5976
--- /dev/null
+++ b/docs/zh/docs/deployment/index.md
@@ -0,0 +1,21 @@
+# éšçœ²
+
+éšçœ² **FastAPI** åºçšçšåºçžå¯¹å®¹æã
+
+## éšçœ²æ¯ä»ä¹ææ
+
+**éšçœ²**åºçšçšåºæå³çæ§è¡å¿
èŠçæ¥éª€ä»¥äœ¿å
¶**å¯äŸçšæ·äœ¿çš**ã
+
+对äº**Web API**æ¥è¯ŽïŒéåžžæ¶åå°äžäŒ å°**äºæå¡åš**äžïŒæé
äžäžªæ§èœåçš³å®æ§éœäžéç**æå¡åšçšåº**ïŒä»¥äŸ¿äœ ç**çšæ·**å¯ä»¥é«æå°**访é®**äœ çåºçšçšåºïŒèäžäŒåºç°äžææå
¶ä»é®é¢ã
+
+è¿äž**åŒå**é¶æ®µåœ¢æé²æ对æ¯ïŒåš**åŒå**é¶æ®µïŒäœ äžææŽæ¹ä»£ç ãç Žå代ç ãä¿®å€ä»£ç , æ¥ååæ¢åéå¯æå¡åšçã
+
+## éšçœ²çç¥
+
+æ ¹æ®äœ ç䜿çšåºæ¯å䜿çšçå·¥å
·ïŒæå€ç§æ¹æ³å¯ä»¥å®ç°æ€ç®çã
+
+äœ å¯ä»¥äœ¿çšäžäºå·¥å
·èªè¡**éšçœ²æå¡åš**ïŒäœ ä¹å¯ä»¥äœ¿çšèœäžºäœ å®æéšåå·¥äœç**äºæå¡**ïŒæå
¶ä»å¯èœçé项ã
+
+æå°åäœ å±ç€ºåšéšçœ² **FastAPI** åºçšçšåºæ¶äœ å¯èœåºè¯¥è®°äœçäžäºäž»èŠæŠå¿µïŒå°œç®¡å
¶äžå€§éšåéçšäºä»»äœå
¶ä»ç±»åç Web åºçšçšåºïŒã
+
+åšæ¥äžæ¥çéšåäžïŒäœ å°çå°æŽå€éèŠè®°äœçç»è以åäžäºæå·§ã âš
From 5eab5dbed659d4c97bb468bf29e99be57e122d05 Mon Sep 17 00:00:00 2001
From: xzmeng
Date: Tue, 9 Jan 2024 23:38:25 +0800
Subject: [PATCH 062/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translat?=
=?UTF-8?q?ion=20for=20`docs/zh/docs/deployment/https.md`=20(#10277)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Big Yellow Dog
Co-authored-by: Lion <121552599+socket-socket@users.noreply.github.com>
---
docs/zh/docs/deployment/https.md | 192 +++++++++++++++++++++++++++++++
1 file changed, 192 insertions(+)
create mode 100644 docs/zh/docs/deployment/https.md
diff --git a/docs/zh/docs/deployment/https.md b/docs/zh/docs/deployment/https.md
new file mode 100644
index 0000000000000..cf01a4585bec2
--- /dev/null
+++ b/docs/zh/docs/deployment/https.md
@@ -0,0 +1,192 @@
+# å
³äº HTTPS
+
+人们åŸå®¹æ讀䞺 HTTPS ä»
ä»
æ¯âå¯çšâæâæªå¯çšâçäžè¥¿ã
+
+äœå®é
æ
åµæ¯è¿å€æåŸå€ã
+
+!!!æ瀺
+ åŠæäœ åŸèµ¶æ¶éŽæäžåšä¹ïŒè¯·ç»§ç»é
读äžäžéšåïŒäžäžéšåäŒæäŸäžäžªstep-by-stepçæçšïŒåè¯äœ æä¹äœ¿çšäžåææ¯æ¥æäžåéœé
眮奜ã
+
+èŠä»çšæ·çè§è§**äºè§£ HTTPS çåºç¡ç¥è¯**ïŒè¯·æ¥ç https://howhttps.works/ ã
+
+ç°åšïŒä»**åŒå人åçè§è§**ïŒåšäºè§£ HTTPS æ¶éèŠè®°äœä»¥äžå ç¹ïŒ
+
+* èŠäœ¿çš HTTPSïŒ**æå¡åš**éèŠæ¥æç±**第äžæ¹**çæç**"è¯ä¹Š(certificate)"**ã
+ * è¿äºè¯ä¹Šå®é
äžæ¯ä»ç¬¬äžæ¹**è·å**çïŒèäžæ¯âçæâçã
+* è¯ä¹Šæ**çåœåšæ**ã
+ * å®ä»¬äŒ**è¿æ**ã
+ * ç¶åå®ä»¬éèŠ**æŽæ°**ïŒ**å次ä»ç¬¬äžæ¹è·å**ã
+* è¿æ¥çå å¯åçåš **TCP å±**ã
+ * è¿æ¯ HTTP åè®®**äžé¢çäžå±**ã
+ * å æ€ïŒ**è¯ä¹Šåå å¯**å€çæ¯åš **HTTPä¹å**å®æçã
+* **TCP äžç¥éåå**ã ä»
ä»
ç¥é IP å°åã
+ * æå
³æ请æ±ç **ç¹å®åå** çä¿¡æ¯äœäº **HTTP æ°æ®**äžã
+* **HTTPS è¯ä¹Š**âè¯æâ**æ䞪åå**ïŒäœåè®®åå å¯åçåš TCP å±ïŒåšç¥éæ£åšå€çåªäžªåå**ä¹å**ã
+* **é»è®€æ
åµäž**ïŒè¿æå³çäœ **æ¯äžª IP å°ååªèœæ¥æäžäžª HTTPS è¯ä¹Š**ã
+ * æ è®ºäœ çæå¡åšæå€å€§ïŒæè
æå¡åšäžçæ¯äžªåºçšçšåºæå€å°ã
+ * äžè¿ïŒå¯¹æ€æäžäžª**解å³æ¹æ¡**ã
+* **TLS** åè®®ïŒåš HTTP ä¹äžçTCP å±å€çå å¯çåè®®ïŒæäžäžª**æ©å±**ïŒç§°äžº **SNI **ã
+ * SNI æ©å±å
讞äžå°æå¡åšïŒå
·æ **å䞪 IP å°å**ïŒæ¥æ **å€äžª HTTPS è¯ä¹Š** 并æäŸ **å€äžª HTTPS åå/åºçšçšåº**ã
+ * 䞺æ€ïŒæå¡åšäžäŒæ**åç¬**çäžäžªç»ä»¶ïŒçšåºïŒäŸŠå¬**å
Œ
± IP å°å**ïŒè¿äžªç»ä»¶å¿
é¡»æ¥ææå¡åšäžç**ææ HTTPS è¯ä¹Š**ã
+* **è·åŸå®å
šè¿æ¥å**ïŒéä¿¡åè®®**ä»ç¶æ¯HTTP**ã
+ * å
å®¹æ¯ **å å¯è¿ç**ïŒå³äœ¿å®ä»¬æ¯éè¿ **HTTP åè®®** åéçã
+
+éåžžçåæ³æ¯åšæå¡åšäžè¿è¡**äžäžªçšåº/HTTP æå¡åš**并**管çææ HTTPS éšå**ïŒæ¥æ¶**å å¯ç HTTPS 请æ±**ïŒ å° **解å¯ç HTTP 请æ±** åéå°åšåäžæå¡åšäžè¿è¡çå®é
HTTP åºçšçšåºïŒåšæ¬äŸäžäžº **FastAPI** åºçšçšåºïŒïŒä»åºçšçšåºäžè·å **HTTP ååº**ïŒ äœ¿çšéåœç **HTTPS è¯ä¹Š**对å
¶è¿è¡å å¯å¹¶äœ¿çš **HTTPS** å°å
¶åéå客æ·ç«¯ã æ€æå¡åšé垞被称䞺 **TLS ç»æ¢ä»£ç(TLS Termination Proxy) **ã
+
+äœ å¯ä»¥çšäœ TLS ç»æ¢ä»£ççäžäºé项å
æ¬ïŒ
+
+* TraefikïŒä¹å¯ä»¥å€çè¯ä¹ŠæŽæ°ïŒ
+* CaddyïŒä¹å¯ä»¥å€çè¯ä¹ŠæŽæ°ïŒ
+* Nginx
+* HAProxy
+
+## Let's Encrypt
+
+åš Let's Encrypt ä¹åïŒè¿äº **HTTPS è¯ä¹Š** ç±åä¿¡ä»»ç第äžæ¹åºå®ã
+
+è¿å»ïŒè·åŸè¿äºè¯ä¹Šçè¿çšéåžžç¹çïŒéèŠå€§éçæ乊工äœïŒèäžè¯ä¹Šéåžžæ莵ã
+
+äœéå **Let's Encrypt ** å建äºã
+
+å®æ¯ Linux åºéäŒçäžäžªé¡¹ç®ã å®ä»¥èªåšæ¹åŒå
莹æäŸ **HTTPS è¯ä¹Š**ã è¿äºè¯ä¹Šå¯ä»¥äœ¿çšææ笊åæ åçå®å
šå å¯ïŒå¹¶äžæææåŸçïŒå€§çºŠ 3 䞪æïŒïŒå æ€**å®å
šæ§å®é
äžæŽå¥œ**ïŒå 䞺å®ä»¬ççåœåšæ猩çäºã
+
+åå¯ä»¥è¢«å®å
šå°éªè¯å¹¶èªåšçæè¯ä¹Šã è¿è¿å
讞èªåšæŽæ°è¿äºè¯ä¹Šã
+
+æ们çæ³æ³æ¯èªåšè·ååæŽæ°è¿äºè¯ä¹ŠïŒä»¥äŸ¿äœ å¯ä»¥æ°žè¿å
莹æ¥æ**å®å
šç HTTPS**ã
+
+## é¢ååŒå人åç HTTPS
+
+è¿éæäžäžª HTTPS API çèµ·æ¥æ¯ä»ä¹æ ·ç瀺äŸïŒæ们äŒåæ¥è¯ŽæïŒå¹¶äžäž»èŠå
³æ³šå¯¹åŒå人åéèŠçéšåã
+
+
+### åå
+
+第äžæ¥æ们èŠå
**è·å**äžäº**åå(Domain Name)**ã ç¶åå¯ä»¥åš DNS æå¡åšïŒå¯èœæ¯äœ çåäžå®¶äºæå¡åæäŸçïŒäžé
眮å®ã
+
+äœ å¯èœæ¥æäžäžªäºæå¡åšïŒèææºïŒæ类䌌çäžè¥¿ïŒå¹¶äžå®äŒæäžäžªåºå® **å
Œ
±IPå°å**ã
+
+åš DNS æå¡åšäžïŒäœ å¯ä»¥é
眮äžæ¡è®°åœïŒâA è®°åœâïŒä»¥å° **äœ çåå** æåäœ æå¡åšçå
Œ
± **IP å°å**ã
+
+è¿äžªæäœäžè¬åªéèŠåšæåŒå§æ§è¡äžæ¬¡ã
+
+!!! tip
+ ååè¿éšååçåš HTTPS ä¹åïŒç±äºè¿äžåéœäŸèµäºååå IP å°åïŒæ以å
åšè¿éæäžäžã
+
+### DNS
+
+ç°åšè®©æ们å
³æ³šçæ£ç HTTPS éšåã
+
+éŠå
ïŒæµè§åšå°éè¿ **DNS æå¡åš** æ¥è¯¢**ååçIP** æ¯ä»ä¹ïŒåšæ¬äŸäžäžº `someapp.example.com`ã
+
+DNS æå¡åšäŒåè¯æµè§åšäœ¿çšæ䞪ç¹å®ç **IP å°å**ã è¿å°æ¯äœ åš DNS æå¡åšäžäžºäœ çæå¡åšé
眮çå
Œ
± IP å°åã
+
+
+
+### TLS æ¡æåŒå§
+
+ç¶åïŒæµè§åšå°åš**ç«¯å£ 443**ïŒHTTPS 端å£ïŒäžäžè¯¥ IP å°åè¿è¡éä¿¡ã
+
+éä¿¡ç第äžéšååªæ¯å»ºç«å®¢æ·ç«¯åæå¡åšä¹éŽçè¿æ¥å¹¶å³å®å®ä»¬å°äœ¿çšçå å¯å¯é¥çã
+
+
+
+客æ·ç«¯åæå¡åšä¹éŽå»ºç« TLS è¿æ¥çè¿çšç§°äžº **TLS æ¡æ**ã
+
+### 垊æ SNI æ©å±ç TLS
+
+**æå¡åšäžåªæäžäžªè¿çš**å¯ä»¥äŸŠå¬ç¹å® **IP å°å**çç¹å® **端å£**ã å¯èœæå
¶ä»è¿çšåšåäž IP å°åçå
¶ä»ç«¯å£äžäŸŠå¬ïŒäœæ¯äžª IP å°åå端å£ç»ååªæäžäžªè¿çšã
+
+TLS (HTTPS) é»è®€äœ¿çšç«¯å£`443`ã è¿å°±æ¯æ们éèŠç端å£ã
+
+ç±äºåªæäžäžªè¿çšå¯ä»¥çå¬æ€ç«¯å£ïŒå æ€çå¬ç«¯å£çè¿çšå°æ¯ **TLS ç»æ¢ä»£ç**ã
+
+TLS ç»æ¢ä»£çå¯ä»¥è®¿é®äžäžªæå€äžª **TLS è¯ä¹Š**ïŒHTTPS è¯ä¹ŠïŒã
+
+䜿çšäžé¢è®šè®ºç **SNI æ©å±**ïŒTLS ç»æ¢ä»£çå°æ£æ¥åºè¯¥çšäºæ€è¿æ¥çå¯çš TLS (HTTPS) è¯ä¹ŠïŒå¹¶äœ¿çšäžå®¢æ·ç«¯ææçååçžå¹é
çè¯ä¹Šã
+
+åšè¿ç§æ
åµäžïŒå®å°äœ¿çš`someapp.example.com`çè¯ä¹Šã
+
+
+
+客æ·ç«¯å·²ç»**ä¿¡ä»»**çæ该 TLS è¯ä¹Šçå®äœïŒåšæ¬äŸäžäžº Let's EncryptïŒäœæ们çšåäŒçå°ïŒïŒå æ€å®å¯ä»¥**éªè¯**该è¯ä¹Šæ¯åŠææã
+
+ç¶åïŒéè¿äœ¿çšè¯ä¹ŠïŒå®¢æ·ç«¯å TLS ç»æ¢ä»£ç **å³å®åŠäœå å¯** **TCP éä¿¡** çå
¶äœéšåã è¿å°±å®æäº **TLS æ¡æ** éšåã
+
+æ€åïŒå®¢æ·ç«¯åæå¡åšå°±æ¥æäº**å å¯ç TCP è¿æ¥**ïŒè¿å°±æ¯ TLS æäŸçåèœã ç¶åä»ä»¬å¯ä»¥äœ¿çšè¯¥è¿æ¥æ¥å¯åšå®é
ç **HTTP éä¿¡**ã
+
+è¿å°±æ¯ **HTTPS**ïŒå®åªæ¯ **å®å
š TLS è¿æ¥** å
çæ®é **HTTP**ïŒèäžæ¯çº¯ç²¹çïŒæªå å¯çïŒTCP è¿æ¥ã
+
+!!! tip
+ 请泚æïŒéä¿¡å å¯åçåš **TCP å±**ïŒèäžæ¯ HTTP å±ã
+
+### HTTPS 请æ±
+
+ç°åšå®¢æ·ç«¯åæå¡åšïŒç¹å«æ¯æµè§åšå TLS ç»æ¢ä»£çïŒå
·æ **å å¯ç TCP è¿æ¥**ïŒå®ä»¬å¯ä»¥åŒå§ **HTTP éä¿¡**ã
+
+æ¥äžæ¥ïŒå®¢æ·ç«¯åéäžäžª **HTTPS 请æ±**ã è¿å
¶å®åªæ¯äžäžªéè¿ TLS å å¯è¿æ¥ç HTTP 请æ±ã
+
+
+
+### 解å¯è¯·æ±
+
+TLS ç»æ¢ä»£çå°äœ¿çšåå奜çå å¯ç®æ³**解å¯è¯·æ±**ïŒå¹¶å°**ïŒè§£å¯çïŒHTTP 请æ±**äŒ èŸå°è¿è¡åºçšçšåºçè¿çšïŒäŸåŠè¿è¡ FastAPI åºçšç Uvicorn è¿çšïŒã
+
+
+
+### HTTP ååº
+
+åºçšçšåºå°å€ç请æ±å¹¶å TLS ç»æ¢ä»£çåé**ïŒæªå å¯ïŒHTTP ååº**ã
+
+
+
+### HTTPS ååº
+
+ç¶åïŒTLS ç»æ¢ä»£çå°äœ¿çšä¹åååçå å¯ç®æ³ïŒä»¥`someapp.example.com`çè¯ä¹ŠåŒå€ŽïŒå¯¹ååºè¿è¡å å¯ïŒå¹¶å°å
¶åéåæµè§åšã
+
+æ¥äžæ¥ïŒæµè§åšå°éªè¯ååºæ¯åŠææåæ¯åŠäœ¿çšäºæ£ç¡®çå å¯å¯é¥çãç¶åå®äŒ**解å¯ååº**并å€çå®ã
+
+
+
+客æ·ç«¯ïŒæµè§åšïŒå°ç¥éååºæ¥èªæ£ç¡®çæå¡åšïŒå 䞺å®äœ¿çšäºä»ä»¬ä¹åäœ¿çš **HTTPS è¯ä¹Š** åååºçå å¯ç®æ³ã
+
+### å€äžªåºçšçšåº
+
+åšåäžå°ïŒæå€å°ïŒæå¡åšäžïŒå¯èœååš**å€äžªåºçšçšåº**ïŒäŸåŠå
¶ä» API çšåºææ°æ®åºã
+
+åªæäžäžªè¿çšå¯ä»¥å€çç¹å®ç IP å端å£ïŒåšæ们ç瀺äŸäžäžº TLS ç»æ¢ä»£çïŒïŒäœå
¶ä»åºçšçšåº/è¿çšä¹å¯ä»¥åšæå¡åšäžè¿è¡ïŒåªèŠå®ä»¬äžå°è¯äœ¿çšçžåç **å
Œ
± IP å端å£çç»å**ã
+
+
+
+è¿æ ·ïŒTLS ç»æ¢ä»£çå°±å¯ä»¥äžºå€äžªåºçšçšåºå€ç**å€äžªåå**ç HTTPS åè¯ä¹ŠïŒç¶ååšæ¯ç§æ
åµäžå°è¯·æ±äŒ èŸå°æ£ç¡®çåºçšçšåºã
+
+### è¯ä¹ŠæŽæ°
+
+åšæªæ¥çæ䞪æ¶åïŒæ¯äžªè¯ä¹ŠéœäŒ**è¿æ**ïŒå€§çºŠåšè·åŸè¯ä¹Šå 3 䞪æïŒã
+
+ç¶åïŒäŒæåŠäžäžªçšåºïŒåšæäºæ
åµäžæ¯åŠäžäžªçšåºïŒåšæäºæ
åµäžå¯èœæ¯åäžäžª TLS ç»æ¢ä»£çïŒäž Let's Encrypt é信并æŽæ°è¯ä¹Šã
+
+
+
+**TLS è¯ä¹Š** **äžååçžå
³è**ïŒèäžæ¯äž IP å°åçžå
³èã
+
+å æ€ïŒèŠæŽæ°è¯ä¹ŠïŒæŽæ°çšåºéèŠåæåšæºæïŒLet's EncryptïŒ**è¯æ**å®ç¡®å®**âæ¥æâ并æ§å¶è¯¥åå**ã
+
+æå€ç§æ¹æ³å¯ä»¥åå°è¿äžç¹ã äžäºæµè¡çæ¹åŒæ¯ïŒ
+
+* **ä¿®æ¹äžäºDNSè®°åœ**ã
+ * 䞺æ€ïŒç»è®¢çšåºéèŠæ¯æ DNS æäŸåç APIïŒå æ€ïŒèŠçäœ äœ¿çšç DNS æäŸåæ¯åŠæäŸè¿äžåèœã
+* **åšäžååå
³èçå
Œ
± IP å°åäžäœäžºæå¡åšè¿è¡**ïŒè³å°åšè¯ä¹Šè·åè¿çšäžïŒã
+ * æ£åŠæ们äžé¢æ诎ïŒåªæäžäžªè¿çšå¯ä»¥çå¬ç¹å®ç IP å端å£ã
+ * è¿å°±æ¯åœåäžäžª TLS ç»æ¢ä»£çè¿èŽèŽ£è¯ä¹Šç»è®¢è¿çšæ¶å®éåžžæçšçåå ä¹äžã
+ * åŠåïŒäœ å¯èœéèŠææ¶åæ¢ TLS ç»æ¢ä»£çïŒå¯åšç»è®¢çšåºä»¥è·åè¯ä¹ŠïŒç¶åäœ¿çš TLS ç»æ¢ä»£çé
眮å®ä»¬ïŒç¶åéæ°å¯åš TLS ç»æ¢ä»£çã è¿å¹¶äžçæ³ïŒå äžºäœ çåºçšçšåºåš TLS ç»æ¢ä»£çå
³éæéŽå°äžå¯çšã
+
+éè¿æ¥æäžäžª**åç¬çç³»ç»æ¥äœ¿çš TLS ç»æ¢ä»£çæ¥å€ç HTTPS**, èäžæ¯çŽæ¥å° TLS è¯ä¹Šäžåºçšçšåºæå¡åšäžèµ·äœ¿çš ïŒäŸåŠ UvicornïŒ,äœ å¯ä»¥åš
+æŽæ°è¯ä¹Šçè¿çšäžåæ¶ä¿ææäŸæå¡ã
+
+## åé¡Ÿ
+
+æ¥æ**HTTPS** éåžžéèŠïŒå¹¶äžåšå€§å€æ°æ
åµäžçžåœ**å
³é®**ã äœäžºåŒå人åïŒäœ åŽç» HTTPS æåç倧éšååªåå°±æ¯**ç解è¿äºæŠå¿µ**以åå®ä»¬çå·¥äœåçã
+
+äžæŠäœ äºè§£äº**é¢ååŒå人åç HTTPS** çåºç¡ç¥è¯ïŒäœ å°±å¯ä»¥èœ»æŸç»ååé
眮äžåçå·¥å
·ïŒä»¥åž®å©äœ 以ç®åçæ¹åŒç®¡çäžåã
+
+åšæ¥äžæ¥çäžäºç« èäžïŒæå°åäœ å±ç€ºå 䞪䞺 **FastAPI** åºçšçšåºè®Ÿçœ® **HTTPS** çå
·äœç€ºäŸã ð
From da9bd0ee4cf2b1eb63154d9ff45106a92e94b89b Mon Sep 17 00:00:00 2001
From: xzmeng
Date: Tue, 9 Jan 2024 23:39:41 +0800
Subject: [PATCH 063/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translat?=
=?UTF-8?q?ion=20for=20`docs/zh/docs/deployment/manually.md`=20(#10279)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Big Yellow Dog
---
docs/zh/docs/deployment/manually.md | 148 ++++++++++++++++++++++++++++
1 file changed, 148 insertions(+)
create mode 100644 docs/zh/docs/deployment/manually.md
diff --git a/docs/zh/docs/deployment/manually.md b/docs/zh/docs/deployment/manually.md
new file mode 100644
index 0000000000000..15588043fecbb
--- /dev/null
+++ b/docs/zh/docs/deployment/manually.md
@@ -0,0 +1,148 @@
+# æåšè¿è¡æå¡åš - Uvicorn
+
+åšè¿çšæå¡åšè®¡ç®æºäžè¿è¡ **FastAPI** åºçšçšåºæéçäž»èŠäžè¥¿æ¯ ASGI æå¡åšçšåºïŒäŸåŠ **Uvicorn**ã
+
+æ 3 䞪䞻èŠå¯éæ¹æ¡ïŒ
+
+* Uvicorn ïŒé«æ§èœ ASGI æå¡åšã
+* Hypercorn ïŒäž HTTP/2 å Trio çå
Œå®¹ç ASGI æå¡åšã
+* Daphne ïŒäžº Django Channels æ建ç ASGI æå¡åšã
+
+## æå¡åšäž»æºåæå¡åšçšåº
+
+å
³äºå称ïŒæäžäžªå°ç»èéèŠè®°äœã ð¡
+
+â**æå¡åš**âäžè¯éåžžçšäºæè¿çš/äºè®¡ç®æºïŒç©çæºæèææºïŒä»¥ååšè¯¥è®¡ç®æºäžè¿è¡ççšåºïŒäŸåŠ UvicornïŒã
+
+请记äœïŒåœæšäžè¬è¯»å°âæå¡åšâè¿äžªåè¯æ¶ïŒå®å¯èœæçæ¯è¿äž€è
ä¹äžã
+
+åœæå°è¿çšäž»æºæ¶ïŒéåžžå°å
¶ç§°äžº**æå¡åš**ïŒäœä¹ç§°äžº**æºåš**(machine)ã**VM**ïŒèææºïŒã**èç¹**ã è¿äºéœæ¯ææç§ç±»åçè¿çšè®¡ç®æºïŒéåžžè¿è¡ LinuxïŒæšå¯ä»¥åšå
¶äžè¿è¡çšåºã
+
+
+## å®è£
æå¡åšçšåº
+
+æšå¯ä»¥äœ¿çšä»¥äžåœä»€å®è£
ASGI å
Œå®¹æå¡åšïŒ
+
+=== "Uvicorn"
+
+ * Uvicorn ïŒäžäžªå¿«åŠéªçµ ASGI æå¡åšïŒåºäº uvloop å httptools æ建ã
+
+
+
+ ```console
+ $ pip install "uvicorn[standard]"
+
+ ---> 100%
+ ```
+
+
+
+ !!! tip
+ éè¿æ·»å `standard`ïŒUvicorn å°å®è£
并䜿çšäžäºæšèçé¢å€äŸèµé¡¹ã
+
+ å
¶äžå
æ¬`uvloop`ïŒå®æ¯`asyncio`çé«æ§èœæ¿ä»£åïŒå®æäŸäºå·šå€§ç并åæ§èœæåã
+
+=== "Hypercorn"
+
+ * Hypercorn ïŒäžäžªä¹äž HTTP/2 å
Œå®¹ç ASGI æå¡åšã
+
+
+
+ ```console
+ $ pip install hypercorn
+
+ ---> 100%
+ ```
+
+
+
+ ...æä»»äœå
¶ä» ASGI æå¡åšã
+
+
+## è¿è¡æå¡åšçšåº
+
+æšå¯ä»¥æç
§ä¹åæçšäžççžåæ¹åŒè¿è¡åºçšçšåºïŒäœäžäœ¿çš`--reload`é项ïŒäŸåŠïŒ
+
+=== "Uvicorn"
+
+
+
+ ```console
+ $ uvicorn main:app --host 0.0.0.0 --port 80
+
+ INFO : Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
+ ```
+
+
+
+
+=== "Hypercorn"
+
+
+
+ ```console
+ $ hypercorn main:app --bind 0.0.0.0:80
+
+ Running on 0.0.0.0:8080 over http (CTRL + C to quit)
+ ```
+
+
+
+!!! warning
+ åŠææšæ£åšäœ¿çš`--reload`é项ïŒè¯·è®°äœå é€å®ã
+
+ `--reload` é项æ¶èæŽå€èµæºïŒå¹¶äžæŽäžçš³å®ã
+
+ å®åš**åŒå**æéŽæåŸå€§åž®å©ïŒäœæš**äžåºè¯¥**åš**ç产ç¯å¢**äžäœ¿çšå®ã
+
+## Hypercorn with Trio
+
+Starlette å **FastAPI** åºäº AnyIO ïŒ æ以å®ä»¬æèœåæ¶äž Python çæ ååº asyncio åTrio å
Œå®¹ã
+
+尜管åŠæ€ïŒUvicorn ç®åä»
äž asyncio å
Œå®¹ïŒå¹¶äžéåžžäœ¿çš `uvloop` , å®æ¯`asyncio`çé«æ§èœæ¿ä»£åã
+
+äœåŠæäœ æ³çŽæ¥äœ¿çš**Trio**ïŒé£ä¹äœ å¯ä»¥äœ¿çš**Hypercorn**ïŒå 䞺å®æ¯æå®ã âš
+
+### å®è£
å
·æ Trio ç Hypercorn
+
+éŠå
ïŒæšéèŠå®è£
å
·æ Trio æ¯æç HypercornïŒ
+
+
+
+```console
+$ pip install "hypercorn[trio]"
+---> 100%
+```
+
+
+
+### Run with Trio
+
+ç¶åäœ å¯ä»¥äŒ éåŒ`trio`ç»åœä»€è¡é项`--worker-class`:
+
+
+
+```console
+$ hypercorn main:app --worker-class trio
+```
+
+
+
+è¿å°éè¿æšçåºçšçšåºå¯åš HypercornïŒå¹¶äœ¿çš Trio äœäžºå端ã
+
+ç°åšæšå¯ä»¥åšåºçšçšåºå
éšäœ¿çš Trioã æè
æŽå¥œçæ¯ïŒæšå¯ä»¥äœ¿çš AnyIOïŒäœ¿æšç代ç äž Trio å asyncio å
Œå®¹ã ð
+
+## éšçœ²æŠå¿µ
+
+è¿äºç€ºäŸè¿è¡æå¡åšçšåºïŒäŸåŠ UvicornïŒïŒå¯åš**å䞪è¿çš**ïŒåšææ IPïŒ`0.0.0.0`)äžçå¬é¢å®ä¹ç«¯å£ïŒäŸåŠ`80`)ã
+
+è¿æ¯åºæ¬æè·¯ã äœæšå¯èœéèŠå€çäžäºå
¶ä»äºæ
ïŒäŸåŠïŒ
+
+* å®å
šæ§ - HTTPS
+* å¯åšæ¶è¿è¡
+* éæ°å¯åš
+* ReplicationïŒè¿è¡çè¿çšæ°ïŒ
+* å
å
+* åŒå§åçæ¥éª€
+
+åšæ¥äžæ¥çç« èäžïŒæå°åæšè¯Šç»ä»ç»æ¯äžªæŠå¿µãåŠäœæèå®ä»¬ïŒä»¥åäžäºå
·äœç€ºäŸä»¥åå€çå®ä»¬ççç¥ã ð
From 623ee4460b92617919b974ff97b0927cd289de32 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:41:08 +0000
Subject: [PATCH 064/217] =?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 e200823d05e1a..0f475a67d1a6b 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Update Turkish translation for `docs/tr/docs/index.md`. PR [#10444](https://github.com/tiangolo/fastapi/pull/10444) by [@hasansezertasan](https://github.com/hasansezertasan).
* ð Add Chinese translation for `docs/zh/docs/learn/index.md`. PR [#10479](https://github.com/tiangolo/fastapi/pull/10479) by [@KAZAMA-DREAM](https://github.com/KAZAMA-DREAM).
* ð Add Russian translation for `docs/ru/docs/learn/index.md`. PR [#10539](https://github.com/tiangolo/fastapi/pull/10539) by [@AlertRED](https://github.com/AlertRED).
* ð Update SQLAlchemy instruction in Chinese translation `docs/zh/docs/tutorial/sql-databases.md`. PR [#9712](https://github.com/tiangolo/fastapi/pull/9712) by [@Royc30ne](https://github.com/Royc30ne).
From d29709fee8565ae5403795c2ce2d5c1e7b5f1c2a Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:43:37 +0000
Subject: [PATCH 065/217] =?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 0f475a67d1a6b..43e09a59a5824 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add German translation for `docs/de/docs/tutorial/first-steps.md`. PR [#9530](https://github.com/tiangolo/fastapi/pull/9530) by [@fhabers21](https://github.com/fhabers21).
* ð Update Turkish translation for `docs/tr/docs/index.md`. PR [#10444](https://github.com/tiangolo/fastapi/pull/10444) by [@hasansezertasan](https://github.com/hasansezertasan).
* ð Add Chinese translation for `docs/zh/docs/learn/index.md`. PR [#10479](https://github.com/tiangolo/fastapi/pull/10479) by [@KAZAMA-DREAM](https://github.com/KAZAMA-DREAM).
* ð Add Russian translation for `docs/ru/docs/learn/index.md`. PR [#10539](https://github.com/tiangolo/fastapi/pull/10539) by [@AlertRED](https://github.com/AlertRED).
From 4023510e4c7a3c668e6b7c97934679a3378b8ebd Mon Sep 17 00:00:00 2001
From: xzmeng
Date: Tue, 9 Jan 2024 23:44:17 +0800
Subject: [PATCH 066/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translat?=
=?UTF-8?q?ion=20for=20`docs/zh/docs/deployment/cloud.md`=20(#10291)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lion <121552599+socket-socket@users.noreply.github.com>
---
docs/zh/docs/deployment/cloud.md | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
create mode 100644 docs/zh/docs/deployment/cloud.md
diff --git a/docs/zh/docs/deployment/cloud.md b/docs/zh/docs/deployment/cloud.md
new file mode 100644
index 0000000000000..398f613728db6
--- /dev/null
+++ b/docs/zh/docs/deployment/cloud.md
@@ -0,0 +1,17 @@
+# åšäºäžéšçœ² FastAPI
+
+æšå ä¹å¯ä»¥äœ¿çš**ä»»äœäºæå¡å**æ¥éšçœ² FastAPI åºçšçšåºã
+
+åšå€§å€æ°æ
åµäžïŒäž»èŠçäºæå¡åéœæéšçœ² FastAPI çæåã
+
+## äºæå¡å - èµå©å
+
+äžäºäºæå¡å âš [**èµå© FastAPI**](../help-fastapi.md#sponsor-the-author){.internal-link target=_blank} âšïŒè¿ç¡®ä¿äºFastAPI åå
¶**çæç³»ç»**æç»å¥åº·å°**åå±**ã
+
+è¿è¡šæäºä»ä»¬å¯¹ FastAPI åå
¶**瀟åº**ïŒæšïŒççæ£æ¿è¯ºïŒå 䞺ä»ä»¬äžä»
æ³äžºæšæäŸ**è¯å¥œçæå¡**ïŒèäžè¿æ³ç¡®ä¿æšæ¥æäžäžª**è¯å¥œäžå¥åº·çæ¡æ¶**ïŒFastAPIã ð
+
+æšå¯èœæ³å°è¯ä»ä»¬çæå¡å¹¶é
读ä»ä»¬çæåïŒ
+
+* Platform.sh
+* Porter
+* Deta
From 179c8a07633f65481f161e891b99d9611d930d94 Mon Sep 17 00:00:00 2001
From: xzmeng
Date: Tue, 9 Jan 2024 23:46:41 +0800
Subject: [PATCH 067/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translat?=
=?UTF-8?q?ion=20for=20`docs/zh/docs/deployment/server-workers.md`=20(#102?=
=?UTF-8?q?92)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Big Yellow Dog
---
docs/zh/docs/deployment/server-workers.md | 184 ++++++++++++++++++++++
1 file changed, 184 insertions(+)
create mode 100644 docs/zh/docs/deployment/server-workers.md
diff --git a/docs/zh/docs/deployment/server-workers.md b/docs/zh/docs/deployment/server-workers.md
new file mode 100644
index 0000000000000..ee3de9b5da406
--- /dev/null
+++ b/docs/zh/docs/deployment/server-workers.md
@@ -0,0 +1,184 @@
+# Server Workers - Gunicorn with Uvicorn
+
+让æ们åé¡Ÿäžäžä¹åçéšçœ²æŠå¿µïŒ
+
+* å®å
šæ§ - HTTPS
+* å¯åšæ¶è¿è¡
+* éæ°å¯åš
+* **å€å¶ïŒè¿è¡çè¿çšæ°ïŒ**
+* å
å
+* å¯åšåçå
åæ¥éª€
+
+å°ç®å䞺æ¢ïŒéè¿ææ¡£äžçæææçšïŒæšå¯èœå·²ç»åš**å䞪è¿çš**äžè¿è¡äºå Uvicorn è¿æ ·ç**æå¡åšçšåº**ã
+
+éšçœ²åºçšçšåºæ¶ïŒæšå¯èœåžæè¿è¡äžäº**è¿çšå€å¶**ïŒä»¥å©çš**å€æ ž**并èœå€å€çæŽå€è¯·æ±ã
+
+æ£åŠæšåšäžäžç« æå
³[éšçœ²æŠå¿µ](./concepts.md){.internal-link target=_blank}äžçå°çïŒæšå¯ä»¥äœ¿çšå€ç§çç¥ã
+
+åšè¿éæå°åæšå±ç€ºåŠäœå° **Gunicorn** äž **Uvicorn worker è¿çš** äžèµ·äœ¿çšã
+
+!!! info
+ åŠææšæ£åšäœ¿çšå®¹åšïŒäŸåŠ Docker æ KubernetesïŒæå°åšäžäžç« äžåè¯æšæŽå€çžå
³ä¿¡æ¯ïŒ[容åšäžç FastAPI - Docker](./docker.md){.internal-link target=_blank}ã
+
+ ç¹å«æ¯ïŒåœåš **Kubernetes** äžè¿è¡æ¶ïŒæšå¯èœ**äžæ³**äœ¿çš GunicornïŒèæ¯è¿è¡ **æ¯äžªå®¹åšäžäžª Uvicorn è¿çš**ïŒäœæå°åšæ¬ç« åé¢åè¯æšè¿äžç¹ã
+
+
+
+## Gunicorn with Uvicorn Workers
+
+**Gunicorn**äž»èŠæ¯äžäžªäœ¿çš**WSGIæ å**çåºçšæå¡åšã è¿æå³ç Gunicorn å¯ä»¥äžº Flask å Django çåºçšçšåºæäŸæå¡ã Gunicorn æ¬èº«äž **FastAPI** äžå
Œå®¹ïŒå 䞺 FastAPI 䜿çšææ°ç **ASGI æ å **ã
+
+äœ Gunicorn æ¯æå
åœ **è¿çšç®¡çåš** 并å
讞çšæ·åè¯å®èŠäœ¿çšåªäžªç¹å®ç **workerç±»**ã ç¶å Gunicorn å°äœ¿çšè¯¥ç±»å¯åšäžäžªæå€äžª **workerè¿çš**ã
+
+**Uvicorn** æäžäžª Gunicorn å
Œå®¹çworkerç±»ã
+
+䜿çšè¿ç§ç»åïŒGunicorn å°å
åœ **è¿çšç®¡çåš**ïŒçå¬ **端å£** å **IP**ã å®äŒå°éä¿¡**äŒ èŸ**å°è¿è¡**Uvicornç±»**çworkerè¿çšã
+
+ç¶åäžGunicornå
Œå®¹ç**Uvicorn worker**ç±»å°èŽèŽ£å°Gunicornåéçæ°æ®èœ¬æ¢äžºASGIæ å以äŸFastAPI䜿çšã
+
+## å®è£
Gunicorn å Uvicorn
+
+
+
+```console
+$ pip install "uvicorn[standard]" gunicorn
+
+---> 100%
+```
+
+
+
+è¿å°å®è£
垊æ`standard`æ©å±å
ïŒä»¥è·åŸé«æ§èœïŒç Uvicorn å Gunicornã
+
+## Run Gunicorn with Uvicorn Workers
+
+æ¥äžæ¥äœ å¯ä»¥éè¿ä»¥äžåœä»€è¿è¡Gunicorn:
+
+
+
+```console
+$ gunicorn main:app --workers 4 --worker-class uvicorn.workers.UvicornWorker --bind 0.0.0.0:80
+
+[19499] [INFO] Starting gunicorn 20.1.0
+[19499] [INFO] Listening at: http://0.0.0.0:80 (19499)
+[19499] [INFO] Using worker: uvicorn.workers.UvicornWorker
+[19511] [INFO] Booting worker with pid: 19511
+[19513] [INFO] Booting worker with pid: 19513
+[19514] [INFO] Booting worker with pid: 19514
+[19515] [INFO] Booting worker with pid: 19515
+[19511] [INFO] Started server process [19511]
+[19511] [INFO] Waiting for application startup.
+[19511] [INFO] Application startup complete.
+[19513] [INFO] Started server process [19513]
+[19513] [INFO] Waiting for application startup.
+[19513] [INFO] Application startup complete.
+[19514] [INFO] Started server process [19514]
+[19514] [INFO] Waiting for application startup.
+[19514] [INFO] Application startup complete.
+[19515] [INFO] Started server process [19515]
+[19515] [INFO] Waiting for application startup.
+[19515] [INFO] Application startup complete.
+```
+
+
+
+
+让æ们ççæ¯äžªé项çå«ä¹ïŒ
+
+* `main:app`ïŒè¿äž Uvicorn 䜿çšçè¯æ³çžåïŒ`main` 衚瀺å䞺"`main`"ç Python æš¡åïŒå æ€æ¯æ件 `main.py`ã `app` æ¯ **FastAPI** åºçšçšåºçåéå称ã
+ * äœ å¯ä»¥æ³è±¡ `main:app` çžåœäºäžäžª Python `import` è¯å¥ïŒäŸåŠïŒ
+
+ ```Python
+ from main import app
+ ```
+
+ * å æ€ïŒ`main:app` äžçåå·çžåœäº `from main import app` äžç Python `import` éšåã
+
+* `--workers`ïŒèŠäœ¿çšçworkerè¿çšæ°éïŒæ¯äžªè¿çšå°è¿è¡äžäžª Uvicorn workerè¿çšïŒåšæ¬äŸäžäžº 4 䞪workerè¿çšã
+
+* `--worker-class`ïŒåšworkerè¿çšäžäœ¿çšçäž Gunicorn å
Œå®¹çå·¥äœç±»ã
+ * è¿éæä»¬äŒ éäº Gunicorn å¯ä»¥å¯Œå
¥å䜿çšçç±»ïŒ
+
+ ```Python
+ import uvicorn.workers.UvicornWorker
+ ```
+
+* `--bind`ïŒè¿åè¯ Gunicorn èŠçå¬ç IP å端å£ïŒäœ¿çšåå· (`:`) åé IP å端å£ã
+ * åŠææšçŽæ¥è¿è¡ UvicornïŒåå¯ä»¥äœ¿çš`--host 0.0.0.0`å`--port 80`ïŒèäžæ¯`--bind 0.0.0.0:80`ïŒGunicorn é项ïŒã
+
+
+åšèŸåºäžïŒæšå¯ä»¥çå°å®æŸç€ºäºæ¯äžªè¿çšç **PID**ïŒè¿çš IDïŒïŒå®åªæ¯äžäžªæ°åïŒã
+
+äœ å¯ä»¥çå°ïŒ
+
+* Gunicorn **è¿çšç®¡çåš** 以 PID `19499` åŒå€ŽïŒåšæšçæ
åµäžïŒå®å°æ¯äžäžªäžåçæ°åïŒã
+* ç¶åå®åŒå§`Listening at: http://0.0.0.0:80`ã
+* ç¶åå®æ£æµå°å®å¿
é¡»äœ¿çš `uvicorn.workers.UvicornWorker` å€çworkerç±»ã
+* ç¶åå®å¯åš**4䞪worker**ïŒæ¯äžªéœæèªå·±çPIDïŒ`19511`ã`19513`ã`19514`å`19515`ã
+
+Gunicorn è¿å°èŽèŽ£ç®¡ç**æ»è¿çš**å**éæ°å¯åš**æ°è¿çšïŒåŠæéèŠä¿æworkeræ°éïŒã å æ€ïŒè¿åšäžå®çšåºŠäžæå©äºäžé¢åè¡šäž**éå¯**çæŠå¿µã
+
+尜管åŠæ€ïŒæšå¯èœè¿åžææäžäºå€éšçäžè¥¿ïŒä»¥ç¡®ä¿åšå¿
èŠæ¶**éæ°å¯åš Gunicorn**ïŒå¹¶äž**åšå¯åšæ¶è¿è¡å®**çã
+
+## Uvicorn with Workers
+
+Uvicorn ä¹æäžäžªé项å¯ä»¥å¯åšåè¿è¡å€äžª **workerè¿çš**ã
+
+ç¶èïŒå°ç®å䞺æ¢ïŒUvicorn å€çworkerè¿çšçèœåæ¯ Gunicorn æŽæéã å æ€ïŒåŠææšæ³æ¥æè¿äžªçº§å«ïŒPython 级å«ïŒçè¿çšç®¡çåšïŒé£ä¹æ奜å°è¯äœ¿çš Gunicorn äœäžºè¿çšç®¡çåšã
+
+æ 论åŠäœïŒæšéœå¯ä»¥åè¿æ ·è¿è¡å®ïŒ
+
+
+
+```console
+$ uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
+INFO : Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
+INFO : Started parent process [27365 ]
+INFO : Started server process [27368 ]
+INFO : Waiting for application startup.
+INFO : Application startup complete.
+INFO : Started server process [27369 ]
+INFO : Waiting for application startup.
+INFO : Application startup complete.
+INFO : Started server process [27370 ]
+INFO : Waiting for application startup.
+INFO : Application startup complete.
+INFO : Started server process [27367 ]
+INFO : Waiting for application startup.
+INFO : Application startup complete.
+```
+
+
+
+è¿éå¯äžçæ°éé¡¹æ¯ `--workers` åè¯ Uvicorn å¯åš 4 䞪工äœè¿çšã
+
+æšè¿å¯ä»¥çå°å®æŸç€ºäºæ¯äžªè¿çšç **PID**ïŒç¶è¿çšïŒè¿æ¯ **è¿çšç®¡çåš**ïŒç PID 䞺`27365`ïŒæ¯äžªå·¥äœè¿çšç PID 䞺ïŒ`27368`ã`27369`ïŒ `27370`å`27367`ã
+
+## éšçœ²æŠå¿µ
+
+åšè¿éïŒæšäºè§£äºåŠäœäœ¿çš **Gunicorn**ïŒæ UvicornïŒç®¡ç **Uvicorn å·¥äœè¿çš**æ¥**并è¡**åºçšçšåºçæ§è¡ïŒå©çš CPU äžç **å€æ ž**ïŒå¹¶ èœå€æ»¡è¶³**æŽå€è¯·æ±**ã
+
+ä»äžé¢çéšçœ²æŠå¿µåè¡šæ¥çïŒäœ¿çšworkeräž»èŠæå©äº**å€å¶**éšåïŒå¹¶å¯¹**éæ°å¯åš**æäžç¹åž®å©ïŒäœæšä»ç¶éèŠç
§é¡Ÿå
¶ä»éšåïŒ
+
+* **å®å
š - HTTPS**
+* **å¯åšæ¶è¿è¡**
+* ***éæ°å¯åš***
+* å€å¶ïŒè¿è¡çè¿çšæ°ïŒ
+* **å
å**
+* **å¯åšä¹åçå
åæ¥éª€**
+
+## 容åšå Docker
+
+åšå
³äº [容åšäžç FastAPI - Docker](./docker.md){.internal-link target=_blank} çäžäžç« äžïŒæå°ä»ç»äžäºå¯çšäºå€çå
¶ä» **éšçœ²æŠå¿µ** ççç¥ã
+
+æè¿å°åæšå±ç€º **å®æ¹ Docker éå**ïŒå
¶äžå
æ¬ **Gunicorn å Uvicorn worker** 以åäžäºå¯¹ç®åæ
åµæçšçé»è®€é
眮ã
+
+åšé£éïŒæè¿å°åæšå±ç€ºåŠäœ **ä»å€ŽåŒå§æ建èªå·±çéå** 以è¿è¡å䞪 Uvicorn è¿çšïŒæ²¡æ GunicornïŒã è¿æ¯äžäžªç®åçè¿çšïŒå¹¶äžå¯èœæ¯æšåšäœ¿çšå **Kubernetes** è¿æ ·çååžåŒå®¹åšç®¡çç³»ç»æ¶æ³èŠåçäºæ
ã
+
+## åé¡Ÿ
+
+æšå¯ä»¥äœ¿çš**Gunicorn**ïŒæUvicornïŒäœäžºUvicornå·¥äœè¿çšçè¿çšç®¡çåšïŒä»¥å©çš**å€æ žCPU**ïŒ**并è¡è¿è¡å€äžªè¿çš**ã
+
+åŠææšèŠè®Ÿçœ®**èªå·±çéšçœ²ç³»ç»**ïŒåæ¶èªå·±å€çå
¶ä»éšçœ²æŠå¿µïŒåå¯ä»¥äœ¿çšè¿äºå·¥å
·åæ³æ³ã
+
+请æ¥çäžäžç« ïŒäºè§£åžŠæ容åšïŒäŸåŠ Docker å KubernetesïŒç **FastAPI**ã æšå°çå°è¿äºå·¥å
·ä¹æç®åçæ¹æ³æ¥è§£å³å
¶ä»**éšçœ²æŠå¿µ**ã âš
From fe620a6c127cf5134d520abe91914e205fcac605 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:46:50 +0000
Subject: [PATCH 068/217] =?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 43e09a59a5824..b292a818efc18 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Chinese translation for `docs/zh/docs/deployment/index.md`. PR [#10275](https://github.com/tiangolo/fastapi/pull/10275) by [@xzmeng](https://github.com/xzmeng).
* ð Add German translation for `docs/de/docs/tutorial/first-steps.md`. PR [#9530](https://github.com/tiangolo/fastapi/pull/9530) by [@fhabers21](https://github.com/fhabers21).
* ð Update Turkish translation for `docs/tr/docs/index.md`. PR [#10444](https://github.com/tiangolo/fastapi/pull/10444) by [@hasansezertasan](https://github.com/hasansezertasan).
* ð Add Chinese translation for `docs/zh/docs/learn/index.md`. PR [#10479](https://github.com/tiangolo/fastapi/pull/10479) by [@KAZAMA-DREAM](https://github.com/KAZAMA-DREAM).
From f27e818edb0fdd24680235b59298ba60b0c30fe0 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:47:49 +0000
Subject: [PATCH 069/217] =?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 b292a818efc18..b71ee8f13fcdd 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Chinese translation for `docs/zh/docs/deployment/https.md`. PR [#10277](https://github.com/tiangolo/fastapi/pull/10277) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/index.md`. PR [#10275](https://github.com/tiangolo/fastapi/pull/10275) by [@xzmeng](https://github.com/xzmeng).
* ð Add German translation for `docs/de/docs/tutorial/first-steps.md`. PR [#9530](https://github.com/tiangolo/fastapi/pull/9530) by [@fhabers21](https://github.com/fhabers21).
* ð Update Turkish translation for `docs/tr/docs/index.md`. PR [#10444](https://github.com/tiangolo/fastapi/pull/10444) by [@hasansezertasan](https://github.com/hasansezertasan).
From c5bbcb8c9c323f23e0d97ce3d0dfc00772362b15 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 15:49:16 +0000
Subject: [PATCH 070/217] =?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 b71ee8f13fcdd..e0b82fbcbf86d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Chinese translation for `docs/zh/docs/deployment/manually.md`. PR [#10279](https://github.com/tiangolo/fastapi/pull/10279) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/https.md`. PR [#10277](https://github.com/tiangolo/fastapi/pull/10277) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/index.md`. PR [#10275](https://github.com/tiangolo/fastapi/pull/10275) by [@xzmeng](https://github.com/xzmeng).
* ð Add German translation for `docs/de/docs/tutorial/first-steps.md`. PR [#9530](https://github.com/tiangolo/fastapi/pull/9530) by [@fhabers21](https://github.com/fhabers21).
From 933668b42e025f00b6d1de7b1e1ebf18f4f1f2ae Mon Sep 17 00:00:00 2001
From: Aleksandr Andrukhov
Date: Tue, 9 Jan 2024 18:51:54 +0300
Subject: [PATCH 071/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Russian=20translat?=
=?UTF-8?q?ion=20for=20`docs/ru/docs/tutorial/request-files.md`=20(#10332)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
Co-authored-by: oubush
---
docs/ru/docs/tutorial/request-files.md | 314 +++++++++++++++++++++++++
1 file changed, 314 insertions(+)
create mode 100644 docs/ru/docs/tutorial/request-files.md
diff --git a/docs/ru/docs/tutorial/request-files.md b/docs/ru/docs/tutorial/request-files.md
new file mode 100644
index 0000000000000..00f8c8377059f
--- /dev/null
+++ b/docs/ru/docs/tutorial/request-files.md
@@ -0,0 +1,314 @@
+# ÐагÑÑзка ÑайлПв
+
+ÐÑпПлÑзÑÑ ÐºÐ»Ð°ÑÑ `File`, ÐŒÑ ÐŒÐŸÐ¶ÐµÐŒ пПзвПлОÑÑ ÐºÐ»ÐžÐµÐœÑаЌ загÑÑжаÑÑ ÑайлÑ.
+
+!!! info "ÐПпПлМОÑелÑÐœÐ°Ñ ÐžÐœÑПÑЌаÑОÑ"
+ ЧÑÐŸÐ±Ñ Ð¿ÐŸÐ»ÑÑаÑÑ Ð·Ð°Ð³ÑÑжеММÑе ÑайлÑ, ÑМаÑала ÑÑÑаМПвОÑе `python-multipart` .
+
+ ÐапÑОЌеÑ: `pip install python-multipart`.
+
+ ÐÑП ÑвÑзаМП Ñ ÑеЌ, ÑÑП загÑÑжаеЌÑе ÑÐ°Ð¹Ð»Ñ Ð¿ÐµÑеЎаÑÑÑÑ ÐºÐ°Ðº ЎаММÑе ÑПÑÐŒÑ.
+
+## ÐЌпПÑÑ `File`
+
+ÐЌпПÑÑОÑÑйÑе `File` О `UploadFile` Оз ЌПЎÑÐ»Ñ `fastapi`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/request_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_files/tutorial001.py!}
+ ```
+
+## ÐпÑеЎелОÑе паÑаЌеÑÑÑ `File`
+
+СПзЎайÑе паÑаЌеÑÑÑ `File` Ñак же, как Ð²Ñ ÑÑП ЎелаеÑе ÐŽÐ»Ñ `Body` ОлО `Form`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9"
+ {!> ../../../docs_src/request_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/request_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="7"
+ {!> ../../../docs_src/request_files/tutorial001.py!}
+ ```
+
+!!! info "ÐПпПлМОÑелÑÐœÐ°Ñ ÐžÐœÑПÑЌаÑОÑ"
+ `File` - ÑÑП клаÑÑ, кПÑПÑÑй МаÑлеЎÑеÑÑÑ ÐœÐµÐ¿ÐŸÑÑеЎÑÑвеММП ÐŸÑ `Form`.
+
+ ÐП пПЌМОÑе, ÑÑП кПгЎа Ð²Ñ ÐžÐŒÐ¿ÐŸÑÑОÑÑеÑе `Query`, `Path`, `File` О ÐŽÑÑгОе Оз `fastapi`, Ма ÑаЌПЌ Ўеле ÑÑП ÑÑМкÑОО, кПÑПÑÑе вПзвÑаÑаÑÑ ÑпеÑОалÑÐœÑе клаÑÑÑ.
+
+!!! tip "ÐПЎÑказка"
+ ÐÐ»Ñ ÐŸÐ±ÑÑÐ²Ð»ÐµÐœÐžÑ Ñела Ñайла МеПбÑ
ПЎОЌП ОÑпПлÑзПваÑÑ `File`, пПÑкПлÑÐºÑ Ð² пÑПÑОвМПЌ ÑлÑÑае паÑаЌеÑÑÑ Ð±ÑÐŽÑÑ ÐžÐœÑеÑпÑеÑОÑПваÑÑÑÑ ÐºÐ°Ðº паÑаЌеÑÑÑ Ð·Ð°Ð¿ÑПÑа ОлО паÑаЌеÑÑÑ Ñела (JSON).
+
+Ð€Ð°Ð¹Ð»Ñ Ð±ÑÐŽÑÑ Ð·Ð°Ð³ÑÑÐ¶ÐµÐœÑ ÐºÐ°Ðº ЎаММÑе ÑПÑÐŒÑ.
+
+ÐÑлО Ð²Ñ ÐŸÐ±ÑÑвОÑе ÑОп паÑаЌеÑÑа Ñ *ÑÑМкÑОО ПпеÑаÑОО пÑÑО* как `bytes`, ÑП **FastAPI** пÑПÑОÑÐ°ÐµÑ Ñайл за ваÑ, О Ð²Ñ Ð¿ÐŸÐ»ÑÑОÑе егП ÑПЎеÑжОЌПе в вОЎе `bytes`.
+
+СлеЎÑÐµÑ ÐžÐŒÐµÑÑ Ð² вОЎÑ, ÑÑП вÑе ÑПЎеÑжОЌПе бÑÐŽÐµÑ Ñ
ÑаМОÑÑÑÑ Ð² паЌÑÑО. ÐÑП Ñ
ПÑПÑП пПЎÑ
ÐŸÐŽÐžÑ ÐŽÐ»Ñ ÐœÐµÐ±ÐŸÐ»ÑÑОÑ
ÑайлПв.
+
+ÐЎМакП Ð²ÐŸÐ·ÐŒÐŸÐ¶ÐœÑ ÑлÑÑаО, кПгЎа ОÑпПлÑзПваМОе `UploadFile` ÐŒÐŸÐ¶ÐµÑ ÐŸÐºÐ°Ð·Ð°ÑÑÑÑ Ð¿ÐŸÐ»ÐµÐ·ÐœÑÐŒ.
+
+## ÐагÑÑзка Ñайла Ñ Ð¿ÐŸÐŒÐŸÑÑÑ `UploadFile`
+
+ÐпÑеЎелОÑе паÑаЌеÑÑ Ñайла Ñ ÑОпПЌ `UploadFile`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="14"
+ {!> ../../../docs_src/request_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="13"
+ {!> ../../../docs_src/request_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="12"
+ {!> ../../../docs_src/request_files/tutorial001.py!}
+ ```
+
+ÐÑпПлÑзПваМОе `UploadFile` ÐžÐŒÐµÐµÑ ÑÑÐŽ пÑеОЌÑÑеÑÑв пеÑеЎ `bytes`:
+
+* ÐÑпПлÑзПваÑÑ `File()` в зМаÑеМОО паÑаЌеÑÑа пП ÑЌПлÑÐ°ÐœÐžÑ ÐœÐµ ПбÑзаÑелÑМП.
+* ÐÑО ÑÑПЌ ОÑпПлÑзÑеÑÑÑ "бÑÑеÑÐœÑй" Ñайл:
+ * Ѐайл, Ñ
ÑаМÑÑОйÑÑ Ð² паЌÑÑО ЎП ЌакÑОЌалÑМПгП пÑеЎела ÑазЌеÑа, пПÑле пÑÐµÐŸÐŽÐŸÐ»ÐµÐœÐžÑ ÐºÐŸÑПÑПгП ПМ бÑÐŽÐµÑ Ñ
ÑаМОÑÑÑÑ ÐœÐ° ЎОÑке.
+* ÐÑП ПзМаÑаеÑ, ÑÑП ПМ бÑÐŽÐµÑ Ñ
ПÑПÑП ÑабПÑаÑÑ Ñ Ð±ÐŸÐ»ÑÑОЌО ÑайлаЌО, ÑакОЌО как ОзПбÑажеМОÑ, вОЎеП, бПлÑÑОе бОМаÑÐœÑе ÑÐ°Ð¹Ð»Ñ Ðž Ñ.ÐŽ., Ме пПÑÑеблÑÑ Ð¿ÑО ÑÑПЌ вÑÑ Ð¿Ð°ÐŒÑÑÑ.
+* Ðз загÑÑжеММПгП Ñайла ЌПжМП пПлÑÑОÑÑ ÐŒÐµÑаЎаММÑе.
+* ÐÐœ ÑеалОзÑÐµÑ file-like `async` ОМÑеÑÑейÑ.
+* ÐÐœ пÑеЎПÑÑавлÑÐµÑ ÑеалÑÐœÑй ПбÑÐµÐºÑ Python `SpooledTemporaryFile` кПÑПÑÑй Ð²Ñ ÐŒÐŸÐ¶ÐµÑе пеÑеЎаÑÑ ÐœÐµÐ¿ÐŸÑÑеЎÑÑвеММП ÐŽÑÑгОЌ бОблОПÑекаЌ, кПÑПÑÑе ПжОЎаÑÑ Ñайл в каÑеÑÑве ПбÑекÑа.
+
+### `UploadFile`
+
+`UploadFile` ÐžÐŒÐµÐµÑ ÑлеЎÑÑÑОе аÑÑОбÑÑÑ:
+
+* `filename`: СÑÑПка `str` Ñ ÐžÑÑ
ПЎМÑÐŒ ОЌеМеЌ Ñайла, кПÑПÑÑй бÑл загÑÑжеМ (МапÑОЌеÑ, `myimage.jpg`).
+* `content_type`: СÑÑПка `str` Ñ ÑОпПЌ ÑПЎеÑжОЌПгП (MIME type / media type) (МапÑОЌеÑ, `image/jpeg`).
+* `file`: `SpooledTemporaryFile` (a file-like ПбÑекÑ). ÐÑП ÑакÑОÑеÑкОй Ñайл Python, кПÑПÑÑй ЌПжМП пеÑеЎаваÑÑ ÐœÐµÐ¿ÐŸÑÑеЎÑÑвеММП ÐŽÑÑгОЌ ÑÑМкÑОÑÐŒ ОлО бОблОПÑекаЌ, ПжОЎаÑÑОЌ Ñайл в каÑеÑÑве ПбÑекÑа.
+
+`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** запÑÑÐºÐ°ÐµÑ ÑайлПвÑе ЌеÑÐŸÐŽÑ Ð² пÑле пПÑПкПв О ÐŸÐ¶ÐžÐŽÐ°ÐµÑ ÐžÑ
.
+
+!!! note "ТеÑ
МОÑеÑкОе ЎеÑалО Starlette"
+ **FastAPI** МаÑлеЎÑÐµÑ `UploadFile` МепПÑÑеЎÑÑвеММП Оз **Starlette**, МП ЎПбавлÑÐµÑ ÐœÐµÐºÐŸÑПÑÑе ЎеÑалО ÐŽÐ»Ñ ÑПвЌеÑÑОЌПÑÑО Ñ **Pydantic** О ÐŽÑÑгОЌО ÑаÑÑÑЌО FastAPI.
+
+## ÐÑП ЎаММÑе ÑПÑÐŒÑ ("Form Data")
+
+СпПÑПб, кПÑПÑÑÐŒ HTML-ÑПÑÐŒÑ (``) ПÑпÑавлÑÑÑ ÐŽÐ°ÐœÐœÑе Ма ÑеÑвеÑ, ПбÑÑМП ОÑпПлÑзÑÐµÑ "ÑпеÑОалÑÐœÑÑ" кПЎОÑÐŸÐ²ÐºÑ ÐŽÐ»Ñ ÑÑОÑ
ЎаММÑÑ
, ПÑлОÑÐœÑÑ ÐŸÑ JSON.
+
+**FastAPI** пПзабПÑОÑÑÑ ÐŸ ÑПЌ, ÑÑÐŸÐ±Ñ ÑÑОÑаÑÑ ÑÑО ЎаММÑе Оз ÐœÑжМПгП ЌеÑÑа, а Ме Оз JSON.
+
+!!! note "ТеÑ
МОÑеÑкОе ЎеÑалО"
+ ÐаММÑе Оз ÑПÑÐŒ ПбÑÑМП кПЎОÑÑÑÑÑÑ Ñ ÐžÑпПлÑзПваМОеЌ "media type" `application/x-www-form-urlencoded` кПгЎа ПМ Ме вклÑÑÐ°ÐµÑ ÑайлÑ.
+
+ ÐП кПгЎа ÑПÑЌа вклÑÑÐ°ÐµÑ ÑайлÑ, ПМа кПЎОÑÑеÑÑÑ ÐºÐ°Ðº multipart/form-data. ÐÑлО Ð²Ñ ÐžÑпПлÑзÑеÑе `File`, **FastAPI** бÑÐŽÐµÑ Ð·ÐœÐ°ÑÑ, ÑÑП ÐµÐŒÑ ÐœÑжМП пПлÑÑОÑÑ ÑÐ°Ð¹Ð»Ñ ÐžÐ· ÐœÑжМПй ÑаÑÑО Ñела.
+
+ ÐÑлО Ð²Ñ Ñ
ПÑОÑе ÑзМаÑÑ Ð±ÐŸÐ»ÑÑе Пб ÑÑОÑ
кПЎОÑПвкаÑ
О пПлÑÑ
ÑПÑÐŒ, пеÑейЎОÑе пП ÑÑÑлке MDN web docs for POST
.
+
+!!! warning "ÐМОЌаМОе"
+ РПпеÑаÑОО *ÑÑМкÑОО ПпеÑаÑОО пÑÑО* ЌПжМП ПбÑÑвОÑÑ ÐœÐµÑкПлÑкП паÑаЌеÑÑПв `File` О `Form`, МП МелÑÐ·Ñ Ñакже ПбÑÑвлÑÑÑ Ð¿ÐŸÐ»Ñ `Body`, кПÑПÑÑе пÑеЎпПлагаеÑÑÑ Ð¿ÐŸÐ»ÑÑОÑÑ Ð² вОЎе JSON, пПÑкПлÑÐºÑ ÑелП запÑПÑа бÑÐŽÐµÑ Ð·Ð°ÐºÐŸÐŽÐžÑПваМП Ñ Ð¿ÐŸÐŒÐŸÑÑÑ `multipart/form-data`, а Ме `application/json`.
+
+ ÐÑП Ме ÑвлÑеÑÑÑ ÐŸÐ³ÑаМОÑеМОеЌ **FastAPI**, ÑÑП ÑаÑÑÑ Ð¿ÑПÑПкПла HTTP.
+
+## ÐеПбÑзаÑелÑÐœÐ°Ñ Ð·Ð°Ð³ÑÑзка ÑайлПв
+
+ÐÑ ÐŒÐŸÐ¶ÐµÑе ÑЎелаÑÑ Ð·Ð°Ð³ÑÑÐ·ÐºÑ Ñайла МеПбÑзаÑелÑМПй, ОÑпПлÑзÑÑ ÑÑаМЎаÑÑÐœÑе аММПÑаÑОО ÑОпПв О ÑÑÑаМПвОв зМаÑеМОе пП ÑЌПлÑÐ°ÐœÐžÑ `None`:
+
+=== "Python 3.10+"
+
+ ```Python hl_lines="9 17"
+ {!> ../../../docs_src/request_files/tutorial001_02_an_py310.py!}
+ ```
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9 17"
+ {!> ../../../docs_src/request_files/tutorial001_02_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="10 18"
+ {!> ../../../docs_src/request_files/tutorial001_02_an.py!}
+ ```
+
+=== "Python 3.10+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="7 15"
+ {!> ../../../docs_src/request_files/tutorial001_02_py310.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="9 17"
+ {!> ../../../docs_src/request_files/tutorial001_02.py!}
+ ```
+
+## `UploadFile` Ñ ÐŽÐŸÐ¿ÐŸÐ»ÐœÐžÑелÑÐœÑЌО ЌеÑаЎаММÑЌО
+
+ÐÑ Ñакже ЌПжеÑе ОÑпПлÑзПваÑÑ `File()` вЌеÑÑе Ñ `UploadFile`, МапÑОЌеÑ, ÐŽÐ»Ñ ÑÑÑаМПвкО ЎПпПлМОÑелÑÐœÑÑ
ЌеÑаЎаММÑÑ
:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="9 15"
+ {!> ../../../docs_src/request_files/tutorial001_03_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="8 14"
+ {!> ../../../docs_src/request_files/tutorial001_03_an.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="7 13"
+ {!> ../../../docs_src/request_files/tutorial001_03.py!}
+ ```
+
+## ÐагÑÑзка МеÑкПлÑкОÑ
ÑайлПв
+
+ÐПжМП ПЎМПвÑеЌеММП загÑÑжаÑÑ ÐœÐµÑкПлÑкП ÑайлПв.
+
+ÐМО бÑÐŽÑÑ ÑвÑÐ·Ð°ÐœÑ Ñ ÐŸÐŽÐœÐžÐŒ О ÑеЌ же "пПлеЌ ÑПÑÐŒÑ", ПÑпÑавлÑеЌÑÐŒ Ñ Ð¿ÐŸÐŒÐŸÑÑÑ ÐŽÐ°ÐœÐœÑÑ
ÑПÑÐŒÑ.
+
+ÐÐ»Ñ ÑÑПгП МеПбÑ
ПЎОЌП ПбÑÑвОÑÑ ÑпОÑПк `bytes` ОлО `UploadFile`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/request_files/tutorial002_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="11 16"
+ {!> ../../../docs_src/request_files/tutorial002_an.py!}
+ ```
+
+=== "Python 3.9+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="8 13"
+ {!> ../../../docs_src/request_files/tutorial002_py39.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="10 15"
+ {!> ../../../docs_src/request_files/tutorial002.py!}
+ ```
+
+ÐÑ Ð¿ÐŸÐ»ÑÑОÑе, как О бÑлП ПбÑÑвлеМП, ÑпОÑПк `list` Оз `bytes` ОлО `UploadFile`.
+
+!!! note "Technical Details"
+ ÐПжМП Ñакже ОÑпПлÑзПваÑÑ `from starlette.responses import HTMLResponse`.
+
+ **FastAPI** пÑеЎПÑÑавлÑÐµÑ ÑÐŸÑ Ð¶Ðµ `starlette.responses`, ÑÑП О `fastapi.responses`, пÑПÑÑП ÐŽÐ»Ñ ÑЎПбÑÑва ÑазÑабПÑÑОка. ÐЎМакП бПлÑÑОМÑÑвП ЎПÑÑÑпМÑÑ
ПÑвеÑПв пПÑÑÑÐ¿Ð°ÐµÑ ÐœÐµÐ¿ÐŸÑÑеЎÑÑвеММП Оз Starlette.
+
+### ÐагÑÑзка МеÑкПлÑкОÑ
ÑайлПв Ñ ÐŽÐŸÐ¿ÐŸÐ»ÐœÐžÑелÑÐœÑЌО ЌеÑаЎаММÑЌО
+
+Так же, как О ÑаМÑÑе, Ð²Ñ ÐŒÐŸÐ¶ÐµÑе ОÑпПлÑзПваÑÑ `File()` ÐŽÐ»Ñ Ð·Ð°ÐŽÐ°ÐœÐžÑ ÐŽÐŸÐ¿ÐŸÐ»ÐœÐžÑелÑÐœÑÑ
паÑаЌеÑÑПв, Ўаже ÐŽÐ»Ñ `UploadFile`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="11 18-20"
+ {!> ../../../docs_src/request_files/tutorial003_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="12 19-21"
+ {!> ../../../docs_src/request_files/tutorial003_an.py!}
+ ```
+
+=== "Python 3.9+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="9 16"
+ {!> ../../../docs_src/request_files/tutorial003_py39.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="11 18"
+ {!> ../../../docs_src/request_files/tutorial003.py!}
+ ```
+
+## РезÑЌе
+
+ÐÑпПлÑзÑйÑе `File`, `bytes` О `UploadFile` ÐŽÐ»Ñ ÑабПÑÑ Ñ ÑайлаЌО, кПÑПÑÑе бÑÐŽÑÑ Ð·Ð°Ð³ÑÑжаÑÑÑÑ Ðž пеÑеЎаваÑÑÑÑ Ð² вОЎе ЎаММÑÑ
ÑПÑÐŒÑ.
From a64b2fed91fdda259e2363b9bd7ba83d3a8fee98 Mon Sep 17 00:00:00 2001
From: Aleksandr Andrukhov
Date: Tue, 9 Jan 2024 18:52:07 +0300
Subject: [PATCH 072/217] =?UTF-8?q?=F0=9F=8C=90=20Fix=20typos=20in=20Russi?=
=?UTF-8?q?an=20translations=20for=20`docs/ru/docs/tutorial/background-tas?=
=?UTF-8?q?ks.md`,=20`docs/ru/docs/tutorial/body-nested-models.md`,=20`doc?=
=?UTF-8?q?s/ru/docs/tutorial/debugging.md`,=20`docs/ru/docs/tutorial/test?=
=?UTF-8?q?ing.md`=20(#10311)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/ru/docs/tutorial/background-tasks.md | 2 +-
docs/ru/docs/tutorial/body-nested-models.md | 2 +-
docs/ru/docs/tutorial/debugging.md | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/ru/docs/tutorial/background-tasks.md b/docs/ru/docs/tutorial/background-tasks.md
index 7a3cf6d839f91..73ba860bc3dd9 100644
--- a/docs/ru/docs/tutorial/background-tasks.md
+++ b/docs/ru/docs/tutorial/background-tasks.md
@@ -71,7 +71,7 @@
Ð ÑÑПЌ пÑОЌеÑе ÑППбÑÐµÐœÐžÑ Ð±ÑÐŽÑÑ Ð·Ð°Ð¿ÐžÑÐ°ÐœÑ Ð² `log.txt` *пПÑле* ÑПгП, как ПÑÐ²ÐµÑ ÑеÑвеÑа бÑл ПÑпÑавлеМ.
-ÐÑлО Ð±Ñ Ð² запÑПÑе бÑла ПÑеÑÐµÐŽÑ `q`, ПМа Ð±Ñ Ð¿ÐµÑвПй запОÑалаÑÑ Ð² `log.txt` ÑПМПвПй заЎаÑей (пПÑÐŸÐŒÑ ÑÑП вÑзÑваеÑÑÑ Ð² завОÑОЌПÑÑО `get_query`).
+ÐÑлО Ð±Ñ Ð² запÑÐŸÑ Ð±Ñл пеÑеЎаМ query-паÑаЌеÑÑ `q`, ПМ Ð±Ñ Ð¿ÐµÑвÑЌО запОÑалÑÑ Ð² `log.txt` ÑПМПвПй заЎаÑей (пПÑÐŸÐŒÑ ÑÑП вÑзÑваеÑÑÑ Ð² завОÑОЌПÑÑО `get_query`).
ÐПÑле ÐŽÑÑÐ³Ð°Ñ ÑÐŸÐœÐŸÐ²Ð°Ñ Ð·Ð°ÐŽÐ°Ñа, кПÑПÑÐ°Ñ Ð±Ñла ÑгеМеÑОÑПваМа в ÑÑМкÑОО, запОÑÐµÑ ÑППбÑеМОе Оз паÑаЌеÑÑа `email`.
diff --git a/docs/ru/docs/tutorial/body-nested-models.md b/docs/ru/docs/tutorial/body-nested-models.md
index a6d123d30dc16..bbf9b768597c1 100644
--- a/docs/ru/docs/tutorial/body-nested-models.md
+++ b/docs/ru/docs/tutorial/body-nested-models.md
@@ -85,7 +85,7 @@ my_list: List[str]
Рв Python еÑÑÑ ÑпеÑОалÑÐœÑй ÑОп ЎаММÑÑ
ÐŽÐ»Ñ ÐŒÐœÐŸÐ¶ÐµÑÑв ÑМОкалÑÐœÑÑ
ÑлеЌеМÑПв - `set`.
-ТПгЎа ÐŒÑ ÐŒÐŸÐ¶ÐµÑ ÐŸÐ±ÑÑвОÑÑ Ð¿ÐŸÐ»Ðµ `tags` как ЌМПжеÑÑвП ÑÑÑПк:
+ТПгЎа ÐŒÑ ÐŒÐŸÐ¶ÐµÐŒ ПбÑÑвОÑÑ Ð¿ÐŸÐ»Ðµ `tags` как ЌМПжеÑÑвП ÑÑÑПк:
=== "Python 3.10+"
diff --git a/docs/ru/docs/tutorial/debugging.md b/docs/ru/docs/tutorial/debugging.md
index 755d98cf20d28..38709e56df7c3 100644
--- a/docs/ru/docs/tutorial/debugging.md
+++ b/docs/ru/docs/tutorial/debugging.md
@@ -22,7 +22,7 @@ $ python myapp.py
-МП Ме вÑзÑвалÑÑ, кПгЎа ÐŽÑÑгПй Ñайл ОЌпПÑÑОÑÑÐµÑ ÑÑП, МапÑОЌеÑ::
+МП Ме вÑзÑвалÑÑ, кПгЎа ÐŽÑÑгПй Ñайл ОЌпПÑÑОÑÑÐµÑ ÑÑП, МапÑОЌеÑ:
```Python
from myapp import app
From 9f7902925a74419f7c3e439e31554c25fd9f3109 Mon Sep 17 00:00:00 2001
From: _Shuibei <33409883+ShuibeiC@users.noreply.github.com>
Date: Tue, 9 Jan 2024 23:53:39 +0800
Subject: [PATCH 073/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Chinese=20translat?=
=?UTF-8?q?ion=20for=20`docs/zh/docs/advanced/additional-responses.md`=20(?=
=?UTF-8?q?#10325)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: unknown
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
docs/zh/docs/advanced/additional-responses.md | 219 ++++++++++++++++++
1 file changed, 219 insertions(+)
create mode 100644 docs/zh/docs/advanced/additional-responses.md
diff --git a/docs/zh/docs/advanced/additional-responses.md b/docs/zh/docs/advanced/additional-responses.md
new file mode 100644
index 0000000000000..2a1e1ed891a79
--- /dev/null
+++ b/docs/zh/docs/advanced/additional-responses.md
@@ -0,0 +1,219 @@
+# OPENAPI äžçå
¶ä»ååº
+
+æšå¯ä»¥å£°æéå ååºïŒå
æ¬éå ç¶æ代ç ãåªäœç±»åãæè¿°çã
+
+è¿äºé¢å€çååºå°å
å«åšOpenAPIæš¡åŒäžïŒå æ€å®ä»¬ä¹å°åºç°åšAPIææ¡£äžã
+
+äœæ¯å¯¹äºé£äºé¢å€çååºïŒäœ å¿
须确ä¿äœ çŽæ¥è¿åäžäžªå `JSONResponse` äžæ ·ç `Response` ïŒå¹¶å
å«äœ çç¶æ代ç åå
容ã
+
+## `model`éå ååº
+æšå¯ä»¥åè·¯åŸæäœè£
饰åšäŒ éåæ° `responses` ã
+
+å®æ¥æ¶äžäžª `dict`ïŒé®æ¯æ¯äžªååºçç¶æ代ç ïŒåŠ`200`ïŒïŒåŒæ¯å
å«æ¯äžªååºä¿¡æ¯çå
¶ä» `dict`ã
+
+æ¯äžªååºåå
žéœå¯ä»¥æäžäžªå
³é®æš¡åïŒå
¶äžå
å«äžäžª `Pydantic` æš¡åïŒå°±å `response_model` äžæ ·ã
+
+**FastAPI**å°éçšè¯¥æš¡åïŒçæå
¶`JSON Schema`并å°å
¶å
å«åš`OpenAPI`äžçæ£ç¡®äœçœ®ã
+
+äŸåŠïŒèŠå£°æåŠäžäžªå
·æç¶æç `404` å`Pydantic`æš¡å `Message` çååºïŒå¯ä»¥åïŒ
+```Python hl_lines="18 22"
+{!../../../docs_src/additional_responses/tutorial001.py!}
+```
+
+
+!!! Note
+ 请记äœïŒæšå¿
é¡»çŽæ¥è¿å `JSONResponse` ã
+
+!!! Info
+ `model` å¯é¥äžæ¯OpenAPIçäžéšåã
+ **FastAPI**å°ä»é£éè·å`Pydantic`æš¡åïŒçæ` JSON Schema` ïŒå¹¶å°å
¶æŸåšæ£ç¡®çäœçœ®ã
+ - æ£ç¡®çäœçœ®æ¯ïŒ
+ - åšé® `content` äžïŒå
¶å
·æåŠäžäžª`JSON`å¯¹è±¡ïŒ `dict` ïŒäœäžºåŒïŒè¯¥`JSON`对象å
å«ïŒ
+ - åªäœç±»åçå¯é¥ïŒäŸåŠ `application/json` ïŒå®å
å«åŠäžäžª`JSON`对象äœäžºåŒïŒè¯¥å¯¹è±¡å
å«ïŒ
+ - äžäžªé®` schema` ïŒå®çåŒæ¯æ¥èªæš¡åç`JSON Schema`ïŒæ£ç¡®çäœçœ®åšè¿éã
+ - **FastAPI**åšè¿éæ·»å äºå¯¹OpenAPIäžåŠäžäžªå°æ¹çå
šå±JSONæš¡åŒçåŒçšïŒèäžæ¯çŽæ¥å
å«å®ãè¿æ ·ïŒå
¶ä»åºçšçšåºå客æ·ç«¯å¯ä»¥çŽæ¥äœ¿çšè¿äºJSONæš¡åŒïŒæäŸæŽå¥œç代ç çæå·¥å
·çã
+
+
+**åšOpenAPIäžäžºè¯¥è·¯åŸæäœçæçååºå°æ¯ïŒ**
+
+```json hl_lines="3-12"
+{
+ "responses": {
+ "404": {
+ "description": "Additional Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Message"
+ }
+ }
+ }
+ },
+ "200": {
+ "description": "Successful Response",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/Item"
+ }
+ }
+ }
+ },
+ "422": {
+ "description": "Validation Error",
+ "content": {
+ "application/json": {
+ "schema": {
+ "$ref": "#/components/schemas/HTTPValidationError"
+ }
+ }
+ }
+ }
+ }
+}
+
+```
+**æš¡åŒè¢«åŒçšå°OpenAPIæš¡åŒäžçåŠäžäžªäœçœ®ïŒ**
+```json hl_lines="4-16"
+{
+ "components": {
+ "schemas": {
+ "Message": {
+ "title": "Message",
+ "required": [
+ "message"
+ ],
+ "type": "object",
+ "properties": {
+ "message": {
+ "title": "Message",
+ "type": "string"
+ }
+ }
+ },
+ "Item": {
+ "title": "Item",
+ "required": [
+ "id",
+ "value"
+ ],
+ "type": "object",
+ "properties": {
+ "id": {
+ "title": "Id",
+ "type": "string"
+ },
+ "value": {
+ "title": "Value",
+ "type": "string"
+ }
+ }
+ },
+ "ValidationError": {
+ "title": "ValidationError",
+ "required": [
+ "loc",
+ "msg",
+ "type"
+ ],
+ "type": "object",
+ "properties": {
+ "loc": {
+ "title": "Location",
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ },
+ "msg": {
+ "title": "Message",
+ "type": "string"
+ },
+ "type": {
+ "title": "Error Type",
+ "type": "string"
+ }
+ }
+ },
+ "HTTPValidationError": {
+ "title": "HTTPValidationError",
+ "type": "object",
+ "properties": {
+ "detail": {
+ "title": "Detail",
+ "type": "array",
+ "items": {
+ "$ref": "#/components/schemas/ValidationError"
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+```
+## äž»ååºçå
¶ä»åªäœç±»å
+
+æšå¯ä»¥äœ¿çšçžåç `responses` åæ°äžºçžåçäž»ååºæ·»å äžåçåªäœç±»åã
+
+äŸåŠïŒæšå¯ä»¥æ·»å äžäžªé¢å€çåªäœç±»å` image/png` ïŒå£°ææšçè·¯åŸæäœå¯ä»¥è¿åJSON对象ïŒåªäœç±»å `application/json` ïŒæPNGåŸåïŒ
+
+```Python hl_lines="19-24 28"
+{!../../../docs_src/additional_responses/tutorial002.py!}
+```
+
+!!! Note
+ - 请泚æïŒæšå¿
é¡»çŽæ¥äœ¿çš `FileResponse` è¿ååŸåã
+
+!!! Info
+ - é€éåš `responses` åæ°äžæç¡®æå®äžåçåªäœç±»åïŒåŠå**FastAPI**å°åå®ååºäžäž»ååºç±»å
·æçžåçåªäœç±»åïŒé»è®€äžº` application/json` ïŒã
+ - äœæ¯åŠææšæå®äºäžäžªèªå®ä¹ååºç±»ïŒå¹¶å° `None `äœäžºå
¶åªäœç±»åïŒ**FastAPI**å°äœ¿çš `application/json` äœäžºå
·æå
³èæš¡åçä»»äœå
¶ä»ååºã
+
+## ç»åä¿¡æ¯
+æšè¿å¯ä»¥èåæ¥æ¶æ¥èªå€äžªäœçœ®çååºä¿¡æ¯ïŒå
æ¬ `response_model `ã `status_code` å `responses `åæ°ã
+
+æšå¯ä»¥äœ¿çšé»è®€çç¶æç `200` ïŒæè
æšéèŠçèªå®ä¹ç¶æç ïŒå£°æäžäžª `response_model `ïŒç¶åçŽæ¥åšOpenAPIæš¡åŒäžåš `responses` äžå£°æçžåååºçå
¶ä»ä¿¡æ¯ã
+
+**FastAPI**å°ä¿çæ¥èª `responses` çéå ä¿¡æ¯ïŒå¹¶å°å
¶äžæš¡åäžçJSON Schemaç»åèµ·æ¥ã
+
+äŸåŠïŒæšå¯ä»¥äœ¿çšç¶æç `404` 声æååºïŒè¯¥ååºäœ¿çš`Pydantic`æš¡å并å
·æèªå®ä¹ç` description` ã
+
+以åäžäžªç¶æç 䞺 `200` çååºïŒå®äœ¿çšæšç `response_model` ïŒäœå
å«èªå®ä¹ç `example` ïŒ
+
+```Python hl_lines="20-31"
+{!../../../docs_src/additional_responses/tutorial003.py!}
+```
+
+ææè¿äºéœå°è¢«å并并å
å«åšæšçOpenAPIäžïŒå¹¶åšAPIææ¡£äžæŸç€ºïŒ
+
+## èåé¢å®ä¹ååºåèªå®ä¹ååº
+
+æšå¯èœåžææäžäºåºçšäºè®žå€è·¯åŸæäœçé¢å®ä¹ååºïŒäœæ¯äœ æ³å°äžåçè·¯åŸåèªå®ä¹ççžåºç»ååšäžåã
+对äºè¿äºæ
åµïŒäœ å¯ä»¥äœ¿çšPythonçææ¯ïŒå° `dict` äž `**dict_to_unpack` 解å
ïŒ
+```Python
+old_dict = {
+ "old key": "old value",
+ "second old key": "second old value",
+}
+new_dict = {**old_dict, "new key": "new value"}
+```
+
+è¿éïŒ new_dict å°å
å«æ¥èª old_dict çææé®åŒå¯¹å äžæ°çé®åŒå¯¹ïŒ
+```python
+{
+ "old key": "old value",
+ "second old key": "second old value",
+ "new key": "new value",
+}
+```
+æšå¯ä»¥äœ¿çšè¯¥ææ¯åšè·¯åŸæäœäžéçšäžäºé¢å®ä¹çååºïŒå¹¶å°å®ä»¬äžå
¶ä»èªå®ä¹ååºçžç»åã
+**äŸåŠïŒ**
+```Python hl_lines="13-17 26"
+{!../../../docs_src/additional_responses/tutorial004.py!}
+```
+## æå
³OpenAPIååºçæŽå€ä¿¡æ¯
+
+èŠäºè§£æšå¯ä»¥åšååºäžå
å«åªäºå
容ïŒæšå¯ä»¥æ¥çOpenAPIè§èäžç以äžéšåïŒ
+ + [OpenAPIååºå¯¹è±¡](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#responsesObject)ïŒå®å
æ¬ Response Object ã
+ + [OpenAPIååºå¯¹è±¡](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.1.0.md#responseObject)ïŒæšå¯ä»¥çŽæ¥åš `responses` åæ°äžçæ¯äžªååºäžå
å«ä»»äœå
容ãå
æ¬ `description` ã `headers` ã `content` ïŒå
¶äžæ¯å£°æäžåçåªäœç±»ååJSON SchemasïŒå `links` ã
From 11a5993c8cf037611b87b8064c7c7d5e3adc9fb5 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 16:01:13 +0000
Subject: [PATCH 074/217] =?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 e0b82fbcbf86d..31c637fccc087 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Chinese translation for `docs/zh/docs/deployment/cloud.md`. PR [#10291](https://github.com/tiangolo/fastapi/pull/10291) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/manually.md`. PR [#10279](https://github.com/tiangolo/fastapi/pull/10279) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/https.md`. PR [#10277](https://github.com/tiangolo/fastapi/pull/10277) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/index.md`. PR [#10275](https://github.com/tiangolo/fastapi/pull/10275) by [@xzmeng](https://github.com/xzmeng).
From 8f70f8c43b4ce046958fd846e82f5610ed4bf91a Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 16:03:03 +0000
Subject: [PATCH 075/217] =?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 31c637fccc087..c6e539ea40bb2 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Chinese translation for `docs/zh/docs/deployment/server-workers.md`. PR [#10292](https://github.com/tiangolo/fastapi/pull/10292) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/cloud.md`. PR [#10291](https://github.com/tiangolo/fastapi/pull/10291) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/manually.md`. PR [#10279](https://github.com/tiangolo/fastapi/pull/10279) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/https.md`. PR [#10277](https://github.com/tiangolo/fastapi/pull/10277) by [@xzmeng](https://github.com/xzmeng).
From d305a67a8101cab32dec71469cb6fd5923097802 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 16:07:49 +0000
Subject: [PATCH 076/217] =?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 c6e539ea40bb2..69894b2a91d23 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Russian translation for `docs/ru/docs/tutorial/request-files.md`. PR [#10332](https://github.com/tiangolo/fastapi/pull/10332) by [@AlertRED](https://github.com/AlertRED).
* ð Add Chinese translation for `docs/zh/docs/deployment/server-workers.md`. PR [#10292](https://github.com/tiangolo/fastapi/pull/10292) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/cloud.md`. PR [#10291](https://github.com/tiangolo/fastapi/pull/10291) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/manually.md`. PR [#10279](https://github.com/tiangolo/fastapi/pull/10279) by [@xzmeng](https://github.com/xzmeng).
From 9ddc71e317938176098722f9f80e335cfc0d0ba1 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 16:08:31 +0000
Subject: [PATCH 077/217] =?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 69894b2a91d23..ea1652195806d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Fix typos in Russian translations for `docs/ru/docs/tutorial/background-tasks.md`, `docs/ru/docs/tutorial/body-nested-models.md`, `docs/ru/docs/tutorial/debugging.md`, `docs/ru/docs/tutorial/testing.md`. PR [#10311](https://github.com/tiangolo/fastapi/pull/10311) by [@AlertRED](https://github.com/AlertRED).
* ð Add Russian translation for `docs/ru/docs/tutorial/request-files.md`. PR [#10332](https://github.com/tiangolo/fastapi/pull/10332) by [@AlertRED](https://github.com/AlertRED).
* ð Add Chinese translation for `docs/zh/docs/deployment/server-workers.md`. PR [#10292](https://github.com/tiangolo/fastapi/pull/10292) by [@xzmeng](https://github.com/xzmeng).
* ð Add Chinese translation for `docs/zh/docs/deployment/cloud.md`. PR [#10291](https://github.com/tiangolo/fastapi/pull/10291) by [@xzmeng](https://github.com/xzmeng).
From cee422f073ddcc37bea3d8f9c0a4bf2d902fe4e5 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 16:09:04 +0000
Subject: [PATCH 078/217] =?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 ea1652195806d..83cae1ddaeca9 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -17,6 +17,7 @@ hide:
### Translations
+* ð Add Chinese translation for `docs/zh/docs/advanced/additional-responses.md`. PR [#10325](https://github.com/tiangolo/fastapi/pull/10325) by [@ShuibeiC](https://github.com/ShuibeiC).
* ð Fix typos in Russian translations for `docs/ru/docs/tutorial/background-tasks.md`, `docs/ru/docs/tutorial/body-nested-models.md`, `docs/ru/docs/tutorial/debugging.md`, `docs/ru/docs/tutorial/testing.md`. PR [#10311](https://github.com/tiangolo/fastapi/pull/10311) by [@AlertRED](https://github.com/AlertRED).
* ð Add Russian translation for `docs/ru/docs/tutorial/request-files.md`. PR [#10332](https://github.com/tiangolo/fastapi/pull/10332) by [@AlertRED](https://github.com/AlertRED).
* ð Add Chinese translation for `docs/zh/docs/deployment/server-workers.md`. PR [#10292](https://github.com/tiangolo/fastapi/pull/10292) by [@xzmeng](https://github.com/xzmeng).
From 60e1259ca4c69feb8698f65ffd9744ae92db0721 Mon Sep 17 00:00:00 2001
From: Sepehr Shirkhanlu
Date: Tue, 9 Jan 2024 19:40:37 +0330
Subject: [PATCH 079/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo=20in=20?=
=?UTF-8?q?`fastapi/routing.py`=20(#10520)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fix: https://github.com/tiangolo/fastapi/discussions/10493
---
fastapi/routing.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fastapi/routing.py b/fastapi/routing.py
index 589ecca2aaf73..acebabfca0566 100644
--- a/fastapi/routing.py
+++ b/fastapi/routing.py
@@ -4328,7 +4328,7 @@ class Item(BaseModel):
app = FastAPI()
router = APIRouter()
- @router.put("/items/{item_id}")
+ @router.trace("/items/{item_id}")
def trace_item(item_id: str):
return None
From 7d8241acb95bb5094363d9e8abc243d3119ffaf0 Mon Sep 17 00:00:00 2001
From: Amir Khorasani
Date: Tue, 9 Jan 2024 19:44:01 +0330
Subject: [PATCH 080/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Persian=20translat?=
=?UTF-8?q?ion=20for=20`docs/fa/docs/features.md`=20(#5887)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián RamÃrez
Co-authored-by: Amin Alaee
---
docs/fa/docs/features.md | 206 +++++++++++++++++++++++++++++++++++++++
1 file changed, 206 insertions(+)
create mode 100644 docs/fa/docs/features.md
diff --git a/docs/fa/docs/features.md b/docs/fa/docs/features.md
new file mode 100644
index 0000000000000..3040ce3dd9065
--- /dev/null
+++ b/docs/fa/docs/features.md
@@ -0,0 +1,206 @@
+# ÙÛÚÚ¯Û Ùا
+
+## ÙÛÚÚ¯Û ÙØ§Û FastAPI
+
+**FastAPI** Ù
Ùارد زÛر را ØšÙ ØŽÙ
ا ارا؊٠Ù
ÛدÙد:
+
+### ؚرٟاÛ٠استاÙدارد ÙØ§Û ØšØ§Ø²
+
+* OpenAPI ØšØ±Ø§Û Ø³Ø§Ø®Øª API, ؎اÙ
Ù Ù
؎خص Ø³Ø§Ø²Û path operation Ùا, ٟاراÙ
ترÙا , body request Ùا, اÙ
ÙÛت ٠غÛرÙ.
+* Ù
ستÙØ¯Ø³Ø§Ø²Û Ø®Ùدکار data model ؚا JSON Schema (ÙÙ
اÙØ·Ùر Ú©Ù OpenAPI Ø®Ùد ÙÛز Ù
ؚتÙÛ ØšØ± JSON Schema است).
+* طراØÛ ØŽØ¯Ù ØšØ± اساس استاÙدارد ÙاÛÛ Ú©Ù ÙŸØ³ از ÛÚ© Ù
طاÙع٠دÙÛ٠ؚدست Ø¢Ù
د٠اÙد ØšØ¬Ø§Û Ø·Ø±ØÛ Ùاٟخت٠٠ؚدÙÙ Ùکر.
+* ÙÙ
ÚÙÛÙ ØšÙ ØŽÙ
ا اجاز٠Ù
ÛدÙد تا از تÙÙÛد Ø®Ùدکار client code در ؚسÛØ§Ø±Û Ø§Ø² زؚا٠Ùا استÙاد٠کÙÛد.
+
+### Ù
ستÙدات Ø®Ùدکار
+
+Ù
ستÙدات API تعاÙ
ÙÛ Ù Ø§Ûجاد راؚط Ú©Ø§Ø±ØšØ±Û ÙØš. از Ø¢ÙجاÛÛ Ú©Ù Ø§ÛÙ ÙرÛÙ
Ùرک ؚرٟاÛÙ OpenAPI Ù
ÛØšØ§ØŽØ¯Ø Ø¢ÙŸØŽÙ ÙØ§Û Ù
ØªØ¹Ø¯Ø¯Û ÙجÙد دارد Ú©Ù Û² Ù
Ùرد ؚصÙرت ÙŸÛØŽ Ùرض Ú¯ÙجاÙد٠؎د٠اÙد.
+
+* Swagger UI Ø ØšØ§ کاÙØŽ تعاÙ
ÙÛ Ø API Ø®Ùد را Ù
ستÙÛÙ
ا از طرÛÙ Ù
رÙرگر صدازد٠٠تست Ú©ÙÛد.
+
+![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
+
+* Ù
ستÙدات API جاÛگزÛ٠ؚا ReDoc .
+
+![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
+
+### ÙÙØ· ٟاÛتÙÙ Ù
درÙ
+
+ÙÙ
٠اÛÙÙا ؚرٟاÛÙ type declaration ÙØ§Û **ٟاÛتÙÙ Û³.Û¶** استاÙدارد (ØšÙ ÙØ·Ù Pydantic) Ù
Ûؚا؎Ùد. سÛÙتکس جدÛØ¯Û Ø¯Ø±Ú©Ø§Ø± ÙÛست. تÙÙا ٟاÛتÙÙ Ù
در٠استاÙدارد.
+
+اگر ØšÙ ÛÚ© ÛادآÙØ±Û Û² دÙÛÙÙ Ø§Û Ø¯Ø± Ù
Ùرد ÙØÙ٠استÙاد٠از تاÛÙŸ ÙØ§Û ÙŸØ§ÛتÙ٠دارÛد (ØØªÛ Ø§Ú¯Ø± از FastAPI استÙاد٠ÙÙ
ÛÚ©ÙÛد) اÛ٠آÙ
Ùز؎ Ú©Ùتا٠را ØšØ±Ø±Ø³Û Ú©ÙÛد: [Python Types](python-types.md){.internal-link target=\_blank}.
+
+ØŽÙ
ا ٟاÛتÙ٠استاÙدارد را ؚا استÙاد٠از تاÛÙŸ Ùا Ù
ÛÙÙÛسÛد:
+
+```Python
+from datetime import date
+
+from pydantic import BaseModel
+
+# Declare a variable as a str
+# and get editor support inside the function
+def main(user_id: str):
+ return user_id
+
+
+# A Pydantic model
+class User(BaseModel):
+ id: int
+ name: str
+ joined: date
+```
+
+ک٠سٟس Ù
ÛتÙا٠ؚ٠اÛ٠؎ک٠از آ٠استÙاد٠کرد:
+
+```Python
+my_user: User = User(id=3, name="John Doe", joined="2018-07-19")
+
+second_user_data = {
+ "id": 4,
+ "name": "Mary",
+ "joined": "2018-11-30",
+}
+
+my_second_user: User = User(**second_user_data)
+```
+
+!!! info
+ `**second_user_data` ÛعÙÛ:
+
+ Ú©ÙÛد Ùا Ù Ù
ÙادÛر دÛÚ©ØŽÙØ±Û `second_user_data` را Ù
ستÙÛÙ
ا ؚ٠عÙÙا٠ارگÙÙ
ا٠ÙØ§Û key-value ØšÙØ±Ø³ØªØ Ú©Ù Ù
عاد٠است ؚا : `User(id=4, name="Mary", joined="2018-11-30")`
+
+### ٟ؎تÛؚاÙÛ ÙÛراÛ؎گر
+
+تÙ
اÙ
ÙرÛÙ
Ùرک ØšÙ Ú¯ÙÙÙ Ø§Û Ø·Ø±Ø§ØÛ ØŽØ¯Ù Ú©Ù Ø§Ø³ØªÙاد٠از آ٠آسا٠٠؎ÙÙØ¯Û ØšØ§ØŽØ¯Ø ØªÙ
اÙ
تصÙ
ÛÙ
ات ØØªÛ Ùؚ٠از ؎رÙع تÙسع٠ؚر رÙÛ ÚÙدÛÙ ÙÛراÛ؎گر آزÙ
اÛØŽ ؎د٠اÙØ¯Ø ØªØ§ از ØšÙترÛ٠تجرؚ٠تÙسع٠اطÙ
ÛÙا٠Øاص٠؎Ùد.
+
+در آخرÛÙ Ù؞رسÙØ¬Û ØªÙسع٠دÙÙدگا٠ٟاÛتÙ٠کاÙ
Ùا Ù
؎خص ØšÙد Ú©Ù ØšÛ؎ترÛÙ ÙÛÚÚ¯Û Ù
Ùرد استÙاد٠از "تکÙ
ÛÙ Ø®Ùدکار " است .
+
+تÙ
اÙ
ÙرÛÙ
Ùرک **FastAPI** ؚرٟاÛÙ Ø§Û ØšØ±Ø§Û ØšØ±Ø§Ùرد٠کرد٠اÛÙ ÙÛاز ÙÛز اÛجاد گ؎ت٠است. تکÙ
ÛÙ Ø®Ùدکار در ÙÙ
٠جا کار Ù
ÛÚ©Ùد.
+
+ØŽÙ
ا ØšÙ Ùدرت ÙÛاز ؚ٠ؚازگ؎ت ØšÙ Ù
ستÙدات را Ø®ÙاÙÛد دا؎ت.
+
+ؚؚÛÙÛد Ú©Ù ÚÚ¯ÙÙÙ ÙÛراÛ؎گر ØŽÙ
ا Ù
Ù
ک٠است ØšÙ ØŽÙ
ا Ú©Ù
Ú© Ú©Ùد:
+
+* در Visual Studio Code :
+
+![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
+
+* در PyCharm :
+
+![editor support](https://fastapi.tiangolo.com/img/pycharm-completion.png)
+
+ØŽÙ
ا ÙŸÛØŽÙÙاد ÙØ§Û ØªÚ©Ù
ÛÙ Ø®ÙØ¯Ú©Ø§Ø±Û Ø±Ø§ Ø®ÙاÙÛد گرÙت Ú©Ù ØØªÛ Ù
Ù
ک٠است ÙØšÙا آ٠را غÛرÙ
Ù
ک٠تصÙر Ù
ÛکردÛد. ؚ٠عÙÙا٠Ù
ثا٠کÙÛد `price` در داخ٠ؚدÙÙ JSON (Ú©Ù Ù
ÛتÙاÙست تÙدرت٠ÙÛز ؚا؎د) ک٠از ÛÚ© درخÙاست Ø¢Ù
د٠است.
+
+دÛگر Ø®ØšØ±Û Ø§Ø² تاÛÙŸ Ú©ÙÛد ا؎تؚاÙÛØ ØšØ±Ú¯ØŽØªÙ ØšÙ Ù
ستÙدات Ûا ٟاÛÛ٠ؚاÙا رÙØªÙ ØšØ±Ø§Û ÙÙÙ
Ûد٠اÛÙÚ©Ù ØŽÙ
ا از `username` Ûا `user_name` استÙاد٠کرد٠اÛد ÙÛست.
+
+### Ù
ختصر
+
+FastAPI **ÙŸÛØŽ Ùرض** ÙØ§Û Ù
عÙÙÙÛ ØšØ±Ø§Û ÙÙ
Ù ÚÛز Ø¯Ø§Ø±Ø¯Ø ØšØ§ ÙاؚÙÛت تÙØžÛÙ
ات اختÛØ§Ø±Û Ø¯Ø± ÙÙ
٠جا. تÙ
اÙ
ٟاراÙ
ترÙا را Ù
ÛتÙاÙÛد ØšØ±Ø§Û Ø§ÙجاÙ
اÙÚÙ ÙÛاز دارÛد Ù ØšØ±Ø§Û ØªØ¹Ø±ÛÙ API Ù
Ùرد ÙÛاز Ø®Ùد ØšÙ Ø®ÙØšÛ ØªÙØžÛÙ
Ú©ÙÛد.
+
+اÙ
ا ØšÙ Ø·Ùر ÙŸÛØŽ ÙØ±Ø¶Ø ÙÙ
Ù ÚÛز **کار Ù
ÛÚ©Ùد**.
+
+### اعتؚارسÙجÛ
+
+* اعتؚارسÙØ¬Û ØšØ±Ø§Û ØšÛ؎تر (Ûا ÙÙ
ÙØ) **data type** ÙØ§Û ÙŸØ§ÛتÙÙØ ØŽØ§Ù
Ù:
+
+ * JSON objects (`dict`)
+ * آراÛÙ ÙØ§Û (ââââ`list`) JSON ؚا ÙاؚÙÛت Ù
؎خص Ø³Ø§Ø²Û ØªØ§ÛÙŸ اÛتÙ
ÙØ§Û Ø¯Ø±ÙÙ ÙÛست.
+ * ÙÛÙد ÙØ§Û Ø±ØŽØªÙ (`str`)Ø ØšÙ ÙÙ
را٠Ù
؎خص Ø³Ø§Ø²Û ØداÙÙ Ù Øداکثر Ø·Ù٠ر؎تÙ.
+ * اعداد (ââ`int`,`float`) ؚا ØداÙÙ Ù Øداکثر Ù
Ùدار ٠غÛرÙ.
+
+* اعتؚارسÙØ¬Û ØšØ±Ø§Û ØªØ§ÛÙŸ ÙØ§Û Ø¹Ø¬ÛØš ØªØ±Ø Ù
Ø«Ù:
+ * URL.
+ * Email.
+ * UUID.
+ * ٠غÛرÙ.
+
+تÙ
اÙ
اعتؚارسÙØ¬Û Ùا تÙسط کتاؚخاÙ٠اثؚات ؎د٠٠ÙدرتÙ
Ùد **Pydantic** اÙجاÙ
Ù
ÛØŽÙد.
+
+### اÙ
ÙÛت ٠اØراز ÙÙÛت
+
+اÙ
ÙÛت ٠اØرازÙÙÛت ؚدÙÙ ÙÛÚÚ¯ÙÙ٠ارتؚاط Ù Ù
صاÙØÙ Ø§Û ØšØ§ ٟاÛگا٠ÙØ§Û Ø¯Ø§Ø¯Ù Ûا Ù
د٠ÙØ§Û Ø¯Ø§Ø¯Ù Ø§Ûجاد ؎د٠اÙد.
+
+تÙ
اÙ
Ø·Ø±Ø ÙØ§Û Ø§Ù
ÙÛØªÛ Ø¯Ø± OpenAPI تعرÛ٠؎د٠اÙØ¯Ø Ø§Ø² جÙ
ÙÙ:
+
+* .
+* **OAuth2** (ÙÙ
ÚÙÛ٠ؚا **JWT tokens**). Ø¢Ù
Ùز؎ را در [OAuth2 with JWT](tutorial/security/oauth2-jwt.md){.internal-link target=\_blank} Ù
؎اÙد٠کÙÛد.
+* Ú©ÙÛد ÙØ§Û API:
+ * Headers
+ * Query parameters
+ * Cookies Ø Ù ØºÛرÙ.
+
+ؚ٠عÙاÙ٠تÙ
اÙ
ÙÛÚÚ¯Û ÙØ§Û Ø§Ù
ÙÛØªÛ Ø§Ø² **Statlette** (؎اÙ
Ù **session cookies **)
+
+ÙÙ
٠اÛÙÙا ؚ٠عÙÙا٠اؚزارÙا Ù Ø§Ø¬Ø²Ø§Û Ùاؚ٠استÙØ§Ø¯Ù Ø§Û Ø³Ø§Ø®ØªÙ ØŽØ¯Ù Ø§Ùد ک٠ؚ٠راØØªÛ ØšØ§ سÛستÙ
ÙØ§Û ØŽÙ
Ø§Ø Ù
خاز٠دادÙØ ÙŸØ§Ûگا٠ÙØ§Û Ø¯Ø§Ø¯Ù Ø±Ø§ØšØ·Ù Ø§Û Ù NoSQL ٠غÛر٠ادغاÙ
Ù
ÛØŽÙÙد.
+
+### Dependency Injection
+
+FastAPI ؎اÙ
Ù ÛÚ© سÛستÙ
Dependency Injection ؚسÛار آسا٠اÙ
ا ؚسÛار ÙدرتÙ
Ùد است.
+
+* ØØªÛ ÙØ§ØšØ³ØªÚ¯Û Ùا ÙÛز Ù
ÛتÙاÙÙد ÙØ§ØšØ³ØªÚ¯Û ÙاÛÛ Ø¯Ø§ØŽØªÙ ØšØ§ØŽÙد Ù ÛÚ© سÙسÙÙ Ù
راتؚ Ûا **"گراÙÛ" از ÙØ§ØšØ³ØªÚ¯Û Ùا** اÛجاد Ú©ÙÙد.
+
+* ÙÙ
Ù ÚÛز تÙسط ÙرÛÙ
Ùرک **ØšÙ Ø·Ùر Ø®Ùدکار ادار٠Ù
ÛØŽÙد**
+
+* ÙÙ
Ù ÙØ§ØšØ³ØªÚ¯Û Ùا Ù
ÛتÙاÙÙد ؚ٠داد٠ÙØ§Û request Ùا ÙÛاز دا؎ت٠ؚا؎Ùد Ù Ù
ستÙدات Ø®Ùدکار Ù Ù
ØدÙدÛت ÙØ§Û path operation را **اÙزاÛØŽ** دÙÙد.
+
+* ؚا ÙاؚÙÛت **اعتؚارسÙØ¬Û Ø®Ùدکار** ØØªÛ ØšØ±Ø§Û path operation parameter ÙØ§Û ØªØ¹Ø±Û٠؎د٠در ÙØ§ØšØ³ØªÚ¯Û Ùا.
+
+* ٟ؎تÛؚاÙÛ Ø§Ø² سÛستÙ
ÙØ§Û ÙŸÛÚÛد٠اØرازÙÙÛت Ú©Ø§Ø±ØšØ±Ø **اتصاÙات ٟاÛگا٠دادÙ** ٠غÛرÙ.
+
+* ؚدÙÙ ÙÛÚ Ø§Ø±ØªØšØ§Ø·Û ØšØ§ دÛتاؚÛس ÙØ§Ø ÙراÙت اÙد ٠غÛرÙ. اÙ
ا ادغاÙ
آسا٠٠راØت ؚا ÙÙ
٠آÙÙا.
+
+### ÙŸÙاگÛÙ ÙØ§Û ÙاÙ
ØدÙد
+
+Ûا ؚ٠عؚارت دÛÚ¯Ø±Ø ÙÛÚ ÙÛØ§Ø²Û ØšÙ Ø¢ÙÙا ÙÛØ³ØªØ Ú©Ø¯ Ù
ÙردÙÛاز Ø®Ùد را Ùارد ٠استÙاد٠کÙÛد.
+
+Ùر ÛکٟارÚÙ Ø³Ø§Ø²Û ØšÙ Ú¯ÙÙÙ Ø§Û Ø·Ø±Ø§ØÛ ØŽØ¯Ù Ø§Ø³Øª ک٠استÙاد٠از آ٠ؚسÛار ساد٠ؚا؎د (ؚا ÙØ§ØšØ³ØªÚ¯Û Ùا) Ú©Ù Ù
ÛتÙاÙÛد ؚا استÙاد٠از ÙÙ
ا٠ساختار ٠رÙØŽÛ Ú©Ù ØšØ±Ø§Û _path operation_ ÙØ§Û Ø®Ùد استÙاد٠کرد٠اÛد تÙÙا در Û² خط کد "ÙŸÙاگÛÙ" ؚرÙاÙ
Ù Ø®Ùدتا٠را اÛجاد Ú©ÙÛد.
+
+### تست ؎دÙ
+
+* 100% ÙŸÙØŽØŽ تست .
+
+* 100% کد ؚر اساس type annotate Ùا .
+
+* استÙاد٠؎د٠در اٟÙÛÚ©ÛØŽÙ ÙØ§Û ØªÙÙÛد
+
+## ÙÛÚÚ¯Û ÙØ§Û Starlette
+
+**FastAPI** کاÙ
Ùا (٠ؚراساس) ؚا Starlette سازگار است. ØšÙاؚراÛÙØ Ùرکد اضاÙÛ Starlette ک٠دارÛØ¯Ø ÙÛز کار Ø®ÙاÙد کرد.
+
+ââ`FastAPI` در ÙاÙع ÛÚ© زÛرکÙاس از `Starlette` است. ØšÙاؚراÛ٠اگر از ÙØšÙ Starlette را Ù
ÛØŽÙاسÛد Ûا ؚا آ٠کار کرد٠اÛØ¯Ø ØšÛ؎تر ÙاؚÙÛت Ùا ØšÙ ÙÙ
Û٠رÙØŽ کار Ø®ÙاÙد کرد.
+
+ؚا **FastAPI** ØŽÙ
ا تÙ
اÙ
ÙÛÚÚ¯Û ÙØ§Û **Starlette** را Ø®ÙاÙÛد دا؎ت (زÛرا FastAPI ÛÚ© Ùسخ٠٠ÙÙ
ÙÙ٠ؚ٠تÙ
اÙ
Ù
عÙا از Starlette است):
+
+* عÙ
Ùکرد ØšÙ Ø·ÙØ±Ø¬Ø¯Û ÚØŽÙ
Ú¯Ûر. اÛÙ ÛÚ©Û Ø§Ø² سرÛعترÛÙ ÙرÛÙ
Ùرک ÙØ§Û Ù
ÙجÙد در ٟاÛتÙ٠است Ú©Ù ÙÙ
تراز ؚا **ÙÙد Ø¬Û Ø§Ø³** Ù **Ú¯Ù** است.
+* ٟ؎تÛؚاÙÛ Ø§Ø² **WebSocket**.
+* تسک ÙØ§Û Ø¯Ø±Ø¬Ø±Ûا٠در ٟس زÙ
ÛÙÙ .
+* رÙÛداد ÙØ§Û Ø±Ø§Ù Ø§ÙØ¯Ø§Ø²Û Ù Ù
تÙÙ٠؎دÙ.
+* تست Ú©ÙاÛÙت ساخت٠؎د٠ؚ٠رÙÛ HTTPX.
+* **CORS**, GZip, ÙاÛÙ ÙØ§Û Ø§Ø³ØªØ§ØªÛÚ©, ٟاسخ ÙØ§Û Ø¬Ø±ÛاÙÛ .
+* ٟ؎تÛؚاÙÛ Ø§Ø² **Ù؎ست Ùا Ù Ú©ÙÚ©Û Ùا**.
+* 100% ÙŸÙØŽØŽ ؚا تست.
+* 100% کد ؚراساس type annotate Ùا.
+
+## ÙÛÚÚ¯Û ÙØ§Û Pydantic
+
+**FastAPI** کاÙ
Ùا (٠ؚراساس) ؚا Pydantic سازگار است. ØšÙاؚراÛÙ Ùرکد Pydantic اضاÙÛ Ú©Ù Ø¯Ø§ØŽØªÙ ØšØ§ØŽÛØ¯Ø ÙÛز کار Ø®ÙاÙد کرد.
+
+از جÙ
Ù٠کتاؚخاÙÙ ÙØ§Û Ø®Ø§Ø±Ø¬Û ÙÛز Ù
ؚتÙÛ ØšØ± Pydantic Ù
ÛتÙا٠ؚ٠ORM Ù ODM Ùا ØšØ±Ø§Û Ø¯ÛتاؚÛس Ùا ا؎ار٠کرد.
+
+اÛÙ ÙÙ
ÚÙÛ٠ؚ٠اÛÙ Ù
عÙاست ک٠در Ø®ÛÙÛ Ø§Ø² Ù
Ùارد Ù
ÛتÙاÙÛد ÙÙ
Ø§Ù Ø§ØšØ¬Ú©ØªÛ Ú©Ù Ø§Ø² request Ù
ÛÚ¯ÛرÛد را **Ù
ستÙÛÙ
ا ؚ٠دÛتاؚÛس** ØšÙرستÛد زÛرا ÙÙ
Ù ÚÛز ØšÙ Ø·Ùر Ø®Ùدکار تأÛÛد Ù
ÛØŽÙد.
+
+ÙÙ
Û٠اÙ
ر ؚرعکس ÙÛز صد٠Ù
ÛâÚ©ÙØ¯Ø Ø¯Ø± ؚسÛØ§Ø±Û Ø§Ø² Ù
Ùارد ØŽÙ
ا Ù
ÛâتÙاÙÛد Ø§ØšØ¬Ú©ØªÛ Ø±Ø§ ک٠از ٟاÛگا٠داد٠درÛاÙت Ù
ÛâÚ©ÙÛد را **Ù
ستÙÛÙ
ا٠ؚ٠کارؚر** ارسا٠کÙÛد.
+
+ؚا FastAPI ØŽÙ
ا تÙ
اÙ
ÙÛÚÚ¯Û ÙØ§Û Pydantic را دراختÛار دارÛد (زÛرا FastAPI ØšØ±Ø§Û ØªÙ
اÙ
ؚخ؎ Ù
دÛرÛت دÛتا ؚر اساس Pydantic عÙ
Ù Ù
ÛÚ©Ùد):
+
+* **Ø®ØšØ±Û Ø§Ø² Ú¯Ûج ؎د٠ÙÛست**:
+ * ÙÛÚ Ø²ØšØ§Ù Ø®Ø±Ø¯Û ØšØ±Ø§Û ÛادگÛØ±Û ØªØ¹Ø±Û٠طرØÙار٠ÙØ§Û Ø¬Ø¯Ûد ÙجÙد Ùدارد.
+ * اگر تاÛÙŸ ÙØ§Û ÙŸØ§ÛتÙ٠را Ù
ÛØŽÙاسÛØ¯Ø ÙØÙ٠استÙاد٠از Pydantic را ÙÛز Ù
ÛداÙÛد.
+* ØšÙ Ø®ÙØšÛ ØšØ§ **IDE /linter /Ù
غز** ØŽÙ
ا عÙ
Ù Ù
ÛÚ©Ùد:
+ * ؚ٠اÛ٠دÙÛ٠ک٠ساختار داد٠Pydantic ÙÙØ· ÙÙ
ÙÙÙ ÙاÛÛ Ø§Ø² Ú©Ùاس ÙاÛÛ ÙستÙد Ú©Ù ØŽÙ
ا تعرÛÙ Ù
ÛÚ©ÙÛØ¯Ø ØªÚ©Ù
ÛÙ Ø®ÙØ¯Ú©Ø§Ø±Ø mypyØ linting Ù Ù
؎اÙد٠؎Ù
ا ؚاÛد ØšÙ Ø¯Ø±Ø³ØªÛ ØšØ§ داد٠ÙØ§Û Ù
عتؚر ØŽÙ
ا کار Ú©ÙÙد.
+* اعتؚار سÙØ¬Û **ساختارÙØ§Û ÙŸÛÚÛدÙ**:
+ * استÙاد٠از Ù
د٠ÙØ§Û Ø³ÙسÙÙ Ù
Ø±Ø§ØªØšÛ Pydantic, `List` Ù `Dict` کتاؚخاÙÙ `typing` ٟاÛتÙ٠٠غÛرÙ.
+ * ٠اعتؚارسÙج Ùا اجاز٠Ù
ÛدÙÙد ک٠طرØÙار٠ÙØ§Û Ø¯Ø§Ø¯Ù ÙŸÛÚÛد٠ؚ٠طÙر ÙØ§Ø¶Ø Ù Ø¢Ø³Ø§Ù ØªØ¹Ø±ÛÙØ ØšØ±Ø±Ø³Û Ù ØšØ± ٟاÛÙ JSON Ù
ستÙد ØŽÙÙد.
+ * ØŽÙ
ا Ù
ÛتÙاÙÛد اؚجکت ÙØ§Û Ø¹Ù
ÛÙا تÙدرت٠JSON را Ú©Ù ÙÙ
Ú¯Û ØªØ§ÛÛد ؎د٠٠annotated ؎د٠اÙد را دا؎ت٠ؚا؎Ûد.
+* **Ùاؚ٠تÙسعÙ**:
+ * Pydantic اجاز٠Ù
ÛدÙد تا data type ÙØ§Û Ø³ÙØ§Ø±ØŽÛ ØªØ¹Ø±ÛÙ ØŽÙÙد Ûا Ù
ÛتÙاÙÛد اعتؚارسÙØ¬Û Ø±Ø§ ؚا رÙØŽ ÙاÛÛ ØšÙ Ø±ÙÛ Ù
د٠Ùا ؚا validator decorator گستر؎ دÙÛد.
+* 100% ÙŸÙØŽØŽ ؚا تست.
From aa53a48fe364a7c9de92479437ae275448b6e456 Mon Sep 17 00:00:00 2001
From: Kay Jan
Date: Wed, 10 Jan 2024 00:21:54 +0800
Subject: [PATCH 081/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo=20in=20?=
=?UTF-8?q?`openapi-callbacks.md`=20(#10673)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/advanced/openapi-callbacks.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/en/docs/advanced/openapi-callbacks.md b/docs/en/docs/advanced/openapi-callbacks.md
index 37339eae575cf..03429b187fe55 100644
--- a/docs/en/docs/advanced/openapi-callbacks.md
+++ b/docs/en/docs/advanced/openapi-callbacks.md
@@ -38,7 +38,7 @@ This part is pretty normal, most of the code is probably already familiar to you
!!! tip
The `callback_url` query parameter uses a Pydantic URL type.
-The only new thing is the `callbacks=messages_callback_router.routes` as an argument to the *path operation decorator*. We'll see what that is next.
+The only new thing is the `callbacks=invoices_callback_router.routes` as an argument to the *path operation decorator*. We'll see what that is next.
## Documenting the callback
From 6efd537204f4b59e7ef7ba013c9506a97e09f01b Mon Sep 17 00:00:00 2001
From: Sumin Kim <42088290+Eeap@users.noreply.github.com>
Date: Wed, 10 Jan 2024 01:23:09 +0900
Subject: [PATCH 082/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20=20Update=20Python?=
=?UTF-8?q?=20version=20in=20`docs/ko/docs/index.md`=20(#10680)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/ko/docs/index.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/ko/docs/index.md b/docs/ko/docs/index.md
index 7ce938106d8bb..c09b538cf4726 100644
--- a/docs/ko/docs/index.md
+++ b/docs/ko/docs/index.md
@@ -323,7 +323,7 @@ def update_item(item_id: int, item: Item):
ìë¡ìŽ 묞ë², í¹ì ëŒìŽëžë¬ëŠ¬ì ë©ìëë íŽëì€ ë±ì ë°°ìž íìê° ììµëë€.
-ê·žì íì€ **Python 3.6+**ì
ëë€.
+ê·žì íì€ **Python 3.8+** ì
ëë€.
ì륌 ë€ìŽ, `int`ì ëíŽì :
From ed3e79be77021edecb56041a558e80e8754db849 Mon Sep 17 00:00:00 2001
From: Clarence
Date: Tue, 9 Jan 2024 17:30:58 +0100
Subject: [PATCH 083/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typos=20in?=
=?UTF-8?q?=20`/docs/reference/exceptions.md`=20and=20`/en/docs/reference/?=
=?UTF-8?q?status.md`=20(#10809)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/reference/exceptions.md | 2 +-
docs/en/docs/reference/status.md | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/en/docs/reference/exceptions.md b/docs/en/docs/reference/exceptions.md
index adc9b91ce5659..7c480834928f9 100644
--- a/docs/en/docs/reference/exceptions.md
+++ b/docs/en/docs/reference/exceptions.md
@@ -3,7 +3,7 @@
These are the exceptions that you can raise to show errors to the client.
When you raise an exception, as would happen with normal Python, the rest of the
-excecution is aborted. This way you can raise these exceptions from anywhere in the
+execution is aborted. This way you can raise these exceptions from anywhere in the
code to abort a request and show the error to the client.
You can use:
diff --git a/docs/en/docs/reference/status.md b/docs/en/docs/reference/status.md
index 54fba9387e664..a238007923be8 100644
--- a/docs/en/docs/reference/status.md
+++ b/docs/en/docs/reference/status.md
@@ -8,7 +8,7 @@ from fastapi import status
`status` is provided directly by Starlette.
-It containes a group of named constants (variables) with integer status codes.
+It contains a group of named constants (variables) with integer status codes.
For example:
From 04dbcf416c881f4320b8263e840f188e7d494ca9 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 16:31:04 +0000
Subject: [PATCH 084/217] =?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 83cae1ddaeca9..345f85ed6fbd9 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* âïž Fix typo in `fastapi/routing.py` . PR [#10520](https://github.com/tiangolo/fastapi/pull/10520) by [@sepsh](https://github.com/sepsh).
* ð Replace HTTP code returned in case of existing user error in docs for testing. PR [#4482](https://github.com/tiangolo/fastapi/pull/4482) by [@TristanMarion](https://github.com/TristanMarion).
* ð Add blog for FastAPI & Supabase. PR [#6018](https://github.com/tiangolo/fastapi/pull/6018) by [@theinfosecguy](https://github.com/theinfosecguy).
* ð Update example source files for SQL databases with SQLAlchemy. PR [#9508](https://github.com/tiangolo/fastapi/pull/9508) by [@s-mustafa](https://github.com/s-mustafa).
From c2dc0252b01e767fcafd80d9d6c1d03e4fd48f59 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 16:38:21 +0000
Subject: [PATCH 085/217] =?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 345f85ed6fbd9..7115fa3f6049c 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -18,6 +18,7 @@ hide:
### Translations
+* ð Add Persian translation for `docs/fa/docs/features.md`. PR [#5887](https://github.com/tiangolo/fastapi/pull/5887) by [@amirilf](https://github.com/amirilf).
* ð Add Chinese translation for `docs/zh/docs/advanced/additional-responses.md`. PR [#10325](https://github.com/tiangolo/fastapi/pull/10325) by [@ShuibeiC](https://github.com/ShuibeiC).
* ð Fix typos in Russian translations for `docs/ru/docs/tutorial/background-tasks.md`, `docs/ru/docs/tutorial/body-nested-models.md`, `docs/ru/docs/tutorial/debugging.md`, `docs/ru/docs/tutorial/testing.md`. PR [#10311](https://github.com/tiangolo/fastapi/pull/10311) by [@AlertRED](https://github.com/AlertRED).
* ð Add Russian translation for `docs/ru/docs/tutorial/request-files.md`. PR [#10332](https://github.com/tiangolo/fastapi/pull/10332) by [@AlertRED](https://github.com/AlertRED).
From 6c15776406ac238a7089b7644dca21affe4cf8d0 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 16:50:06 +0000
Subject: [PATCH 086/217] =?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 7115fa3f6049c..deb2b285dacd7 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* âïž Fix typo in `openapi-callbacks.md`. PR [#10673](https://github.com/tiangolo/fastapi/pull/10673) by [@kayjan](https://github.com/kayjan).
* âïž Fix typo in `fastapi/routing.py` . PR [#10520](https://github.com/tiangolo/fastapi/pull/10520) by [@sepsh](https://github.com/sepsh).
* ð Replace HTTP code returned in case of existing user error in docs for testing. PR [#4482](https://github.com/tiangolo/fastapi/pull/4482) by [@TristanMarion](https://github.com/TristanMarion).
* ð Add blog for FastAPI & Supabase. PR [#6018](https://github.com/tiangolo/fastapi/pull/6018) by [@theinfosecguy](https://github.com/theinfosecguy).
From 5e5cabefe18e33c6087043af640d98e089884b9e Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 16:51:05 +0000
Subject: [PATCH 087/217] =?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 deb2b285dacd7..d6bacfe957061 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -19,6 +19,7 @@ hide:
### Translations
+* âïž Update Python version in `docs/ko/docs/index.md`. PR [#10680](https://github.com/tiangolo/fastapi/pull/10680) by [@Eeap](https://github.com/Eeap).
* ð Add Persian translation for `docs/fa/docs/features.md`. PR [#5887](https://github.com/tiangolo/fastapi/pull/5887) by [@amirilf](https://github.com/amirilf).
* ð Add Chinese translation for `docs/zh/docs/advanced/additional-responses.md`. PR [#10325](https://github.com/tiangolo/fastapi/pull/10325) by [@ShuibeiC](https://github.com/ShuibeiC).
* ð Fix typos in Russian translations for `docs/ru/docs/tutorial/background-tasks.md`, `docs/ru/docs/tutorial/body-nested-models.md`, `docs/ru/docs/tutorial/debugging.md`, `docs/ru/docs/tutorial/testing.md`. PR [#10311](https://github.com/tiangolo/fastapi/pull/10311) by [@AlertRED](https://github.com/AlertRED).
From 43489beb98555374949b451054e1cd02bca267eb Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 17:00:36 +0000
Subject: [PATCH 088/217] =?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 d6bacfe957061..7b1b861b277fc 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* âïž Fix typos in `/docs/reference/exceptions.md` and `/en/docs/reference/status.md`. PR [#10809](https://github.com/tiangolo/fastapi/pull/10809) by [@clarencepenz](https://github.com/clarencepenz).
* âïž Fix typo in `openapi-callbacks.md`. PR [#10673](https://github.com/tiangolo/fastapi/pull/10673) by [@kayjan](https://github.com/kayjan).
* âïž Fix typo in `fastapi/routing.py` . PR [#10520](https://github.com/tiangolo/fastapi/pull/10520) by [@sepsh](https://github.com/sepsh).
* ð Replace HTTP code returned in case of existing user error in docs for testing. PR [#4482](https://github.com/tiangolo/fastapi/pull/4482) by [@TristanMarion](https://github.com/TristanMarion).
From e98689434449c4ec667df42b798bcf4b2359b399 Mon Sep 17 00:00:00 2001
From: Rostyslav
Date: Tue, 9 Jan 2024 19:04:42 +0200
Subject: [PATCH 089/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Ukrainian=20transl?=
=?UTF-8?q?ation=20for=20`docs/uk/docs/index.md`=20(#10362)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
---
docs/uk/docs/index.md | 465 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 465 insertions(+)
create mode 100644 docs/uk/docs/index.md
diff --git a/docs/uk/docs/index.md b/docs/uk/docs/index.md
new file mode 100644
index 0000000000000..fad693f79deb2
--- /dev/null
+++ b/docs/uk/docs/index.md
@@ -0,0 +1,465 @@
+
+
+
+
+ ÐПÑПвОй ЎП пÑПЎакÑОМÑ, вОÑПкПпÑПЎÑкÑОвМОй, пÑПÑÑОй Ñ Ð²ÐžÐ²ÑÐµÐœÐœÑ Ñа ÑвОЎкОй ÐŽÐ»Ñ ÐœÐ°Ð¿ÐžÑÐ°ÐœÐœÑ ÐºÐŸÐŽÑ ÑÑейЌвПÑк
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+---
+
+**ÐПкÑЌеМÑаÑÑÑ**: https://fastapi.tiangolo.com
+
+**ÐÑПгÑаЌМОй кПЎ**: https://github.com/tiangolo/fastapi
+
+---
+
+FastAPI - Ñе ÑÑÑаÑМОй, ÑвОЎкОй (вОÑПкПпÑПЎÑкÑОвМОй), вебÑÑейЌвПÑк ÐŽÐ»Ñ ÑÑвПÑÐµÐœÐœÑ API за ÐŽÐŸÐ¿ÐŸÐŒÐŸÐ³ÐŸÑ Python 3.8+,в ПÑÐœÐŸÐ²Ñ ÑкПгП лежОÑÑ ÑÑаМЎаÑÑМа аМПÑаÑÑÑ ÑОпÑв Python.
+
+ÐлÑÑÐŸÐ²Ñ ÐŸÑПблОвПÑÑÑ:
+
+* **КвОЎкОй**: ÐÑже вОÑПка пÑПЎÑкÑОвМÑÑÑÑ, Ма ÑÑÐ²ÐœÑ Ð· **NodeJS** Ñа **Go** (завЎÑкО Starlette Ñа Pydantic). [ÐЎОМ Ñз МайÑвОЎÑОÑ
ÑÑейЌвПÑкÑв](#performance).
+
+* **КвОЎке МапОÑÐ°ÐœÐœÑ ÐºÐŸÐŽÑ**: ÐÑОÑвОЎÑÑÑ ÑПзÑÐŸÐ±ÐºÑ ÑÑМкÑÑÐŸÐœÐ°Ð»Ñ Ð¿ÑОблОзМП Ма 200%-300%. *
+* **ÐеМÑе пПЌОлПк**: ÐЌеМÑОÑÑ ÐºÑлÑкÑÑÑÑ Ð¿ÐŸÐŒÐžÐ»ÐŸÐº ÑпÑОÑОМеМОÑ
лÑÐŽÐžÐœÐŸÑ (ÑПзÑПбМОкПЌ) Ма 40%. *
+* **ÐÐœÑÑÑÑОвМОй**: ЧÑЎПва пÑÐŽÑÑОЌка ÑеЎакÑПÑаЌО кПЎÑ. ÐÐŸÐ¿ÐŸÐ²ÐœÐµÐœÐœÑ Ð²ÑÑЎО. ÐЌеМÑÑе ÑÐ°Ñ ÐœÐ° МалагПЎжеММÑ.
+* **ÐÑПÑÑОй**: СпÑПекÑПваМОй, ÐŽÐ»Ñ Ð»ÐµÐ³ÐºÐŸÐ³ÐŸ вОкПÑОÑÑÐ°ÐœÐœÑ Ñа МавÑаММÑ. ÐМаЎПбОÑÑÑÑ ÐŒÐµÐœÑе ÑаÑÑ ÐœÐ° ÑОÑÐ°ÐœÐœÑ ÐŽÐŸÐºÑЌеМÑаÑÑÑ.
+* **ÐПÑПÑкОй**: ÐвеЎе ЎП ÐŒÑÐœÑÐŒÑÐŒÑ ÐŽÑблÑÐ²Ð°ÐœÐœÑ ÐºÐŸÐŽÑ. ÐПжеМ ПгПлПÑеМОй паÑаЌеÑÑ ÐŒÐŸÐ¶Ðµ вОкПМÑваÑО кÑлÑка ÑÑМкÑÑй.
+* **ÐаЎÑйМОй**: ÐО ЌаÑОЌеÑе ÑÑабÑлÑМОй кПЎ гПÑПвОй ЎП пÑПЎакÑÐžÐœÑ Ð· авÑПЌаÑОÑÐœÐŸÑ ÑÐœÑеÑакÑÐžÐ²ÐœÐŸÑ ÐŽÐŸÐºÑЌеМÑаÑÑÑÑ.
+* **СÑаМЎаÑÑОзПваМОй**: ÐÑМПваМОй Ñа пПвМÑÑÑÑ ÑÑÐŒÑÑМОй з вÑЎкÑОÑОЌО ÑÑаМЎаÑÑаЌО ÐŽÐ»Ñ API: OpenAPI (пПпеÑеЎМÑП вÑЎПЌОй Ñк Swagger) Ñа JSON Schema .
+
+* ПÑÑМка Ма ПÑÐœÐŸÐ²Ñ ÑеÑÑÑв вМÑÑÑÑÑÐœÑÐŸÑ ÐºÐŸÐŒÐ°ÐœÐŽÐž ÑПзÑПбМОкÑв, ÑÑвПÑÐµÐœÐœÑ Ð¿ÑПЎÑкÑПвОÑ
заÑÑПÑÑМкÑв.
+
+## СпПМÑПÑО
+
+
+
+{% if sponsors %}
+{% for sponsor in sponsors.gold -%}
+
+{% endfor -%}
+{%- for sponsor in sponsors.silver -%}
+
+{% endfor %}
+{% endif %}
+
+
+
+Other sponsors
+
+## ÐÑажеММÑ
+
+"_[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products._"
+
+Kabir Khan -
Microsoft (ref)
+
+---
+
+"_We adopted the **FastAPI** library to spawn a **REST** server that can be queried to obtain **predictions**. [for Ludwig]_"
+
+Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala -
Uber (ref)
+
+---
+
+"_**Netflix** is pleased to announce the open-source release of our **crisis management** orchestration framework: **Dispatch**! [built with **FastAPI**]_"
+
+Kevin Glisson, Marc Vilanova, Forest Monsen -
Netflix (ref)
+
+---
+
+"_Iâm over the moon excited about **FastAPI**. Itâs so fun!_"
+
+
+
+---
+
+"_Honestly, what you've built looks super solid and polished. In many ways, it's what I wanted **Hug** to be - it's really inspiring to see someone build that._"
+
+
+
+---
+
+"_If you're looking to learn one **modern framework** for building REST APIs, check out **FastAPI** [...] It's fast, easy to use and easy to learn [...]_"
+
+"_We've switched over to **FastAPI** for our **APIs** [...] I think you'll like it [...]_"
+
+
+
+---
+
+## **Typer**, FastAPI CLI
+
+
+
+СÑвПÑÑÑÑО CLI заÑÑПÑÑМПк ÐŽÐ»Ñ Ð²ÐžÐºÐŸÑОÑÑÐ°ÐœÐœÑ Ð² ÑеÑÐŒÑМалÑ, заЌÑÑÑÑ Ð²ÐµÐ±-API звеÑÐœÑÑÑ ÑÐ²Ð°Ð³Ñ ÐœÐ° **Typer** .
+
+**Typer** Ñ ÐŒÐŸÐ»ÐŸÐŽÑОЌ бÑаÑПЌ FastAPI. Ð Ñе **FastAPI ÐŽÐ»Ñ CLI**. âšïž ð
+
+## ÐОЌПгО
+
+Python 3.8+
+
+FastAPI ÑÑПÑÑÑ ÐœÐ° плеÑаÑ
гÑгаМÑÑв:
+
+* Starlette ÐŽÐ»Ñ web ÑаÑÑОМО.
+* Pydantic ÐŽÐ»Ñ ÑаÑÑОМО ЎаМОÑ
.
+
+## ÐÑÑавМПвлеММÑ
+
+
+
+```console
+$ pip install fastapi
+
+---> 100%
+```
+
+
+
+ÐаЌ ÑакПж зМаЎПбОÑÑÑÑ ÑеÑÐ²ÐµÑ ASGI ÐŽÐ»Ñ Ð¿ÑПЎакÑОМÑ, МапÑОклаЎ Uvicorn абП Hypercorn .
+
+
+
+```console
+$ pip install uvicorn[standard]
+
+---> 100%
+```
+
+
+
+## ÐÑОклаЎ
+
+### СÑвПÑÑÑÑ
+
+* СÑвПÑÑÑÑ Ñайл `main.py` з:
+
+```Python
+from typing import Union
+
+from fastapi import FastAPI
+
+app = FastAPI()
+
+
+@app.get("/")
+def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+def read_item(item_id: int, q: Union[str, None] = None):
+ return {"item_id": item_id, "q": q}
+```
+
+
+ÐбП вОкПÑОÑÑайÑе async def
...
+
+ЯкÑП Ð²Ð°Ñ ÐºÐŸÐŽ вОкПÑОÑÑПвÑÑ `async` / `await`, ÑкПÑОÑÑайÑеÑÑ `async def`:
+
+```Python hl_lines="9 14"
+from typing import Union
+
+from fastapi import FastAPI
+
+app = FastAPI()
+
+
+@app.get("/")
+async def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+async def read_item(item_id: int, q: Union[str, None] = None):
+ return {"item_id": item_id, "q": q}
+```
+
+**ÐÑОЌÑÑка**:
+
+СÑОкМÑвÑОÑÑ Ð· пÑПблеЌаЌО, Ме зайвОЌ бÑЎе ПзМайПЌОÑОÑÑ Ð· ÑПзЎÑлПЌ _"In a hurry?"_ пÑП `async` Ñа `await` Ñ ÐŽÐŸÐºÑЌеМÑаÑÑÑ .
+
+
+
+### ÐапÑÑÑÑÑÑ
+
+ÐапÑÑÑÑÑÑ server з:
+
+
+
+```console
+$ uvicorn main:app --reload
+
+INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+INFO: Started reloader process [28720]
+INFO: Started server process [28722]
+INFO: Waiting for application startup.
+INFO: Application startup complete.
+```
+
+
+
+
+ÐÑП кПЌаМЎО uvicorn main:app --reload
...
+
+ÐПЌаМЎа `uvicorn main:app` пПÑОлаÑÑÑÑÑ ÐœÐ°:
+
+* `main`: Ñайл `main.py` ("ÐПЎÑлÑ" Python).
+* `app`: ПбâÑÐºÑ ÑÑвПÑеМОй ÑÑеÑÐµÐŽÐžÐœÑ `main.py` ÑÑЎкПЌ `app = FastAPI()`.
+* `--reload`: пеÑезапÑÑÐºÐ°Ñ ÑеÑÐ²ÐµÑ Ð¿ÑÑÐ»Ñ Ð·ÐŒÑМО кПЎÑ. ÐОкПÑОÑÑПвÑйÑе вОклÑÑМП ÐŽÐ»Ñ ÑПзÑПбкО.
+
+
+
+### ÐеÑевÑÑÑе
+
+ÐÑЎкÑОйÑе бÑаÑÐ·ÐµÑ Ñа ввеЎÑÑÑ Ð°ÐŽÑеÑÑ http://127.0.0.1:8000/items/5?q=somequery .
+
+ÐО пПбаÑОÑе Ñ Ð²ÑЎпПвÑÐŽÑ Ð¿ÐŸÐŽÑбМОй JSON:
+
+```JSON
+{"item_id": 5, "q": "somequery"}
+```
+
+ÐО вже ÑÑвПÑОлО API, ÑкОй:
+
+* ÐÑÑОЌÑÑ HTTP запОÑО за _ÑлÑÑ
аЌО_ `/` Ñа `/items/{item_id}`.
+* ÐбОЎва _ÑлÑÑ
О_ пÑОйЌаÑÑÑ `GET` ПпеÑаÑÑÑ (ÑакПж вÑÐŽÐŸÐŒÑ Ñк HTTP _ЌеÑПЎО_).
+* _КлÑÑ
_ `/items/{item_id}` ÐŒÑÑÑОÑÑ _паÑаЌеÑÑ ÑлÑÑ
Ñ_ `item_id` ÑкОй ÐŒÐ°Ñ Ð±ÑÑО ÑÐžÐ¿Ñ `int`.
+* _КлÑÑ
_ `/items/{item_id}` ÐŒÑÑÑОÑÑ ÐœÐµÐŸÐ±ÐŸÐ²ÊŒÑзкПвОй `str` _паÑаЌеÑÑ Ð·Ð°Ð¿ÐžÑÑ_ `q`.
+
+### ÐÐœÑеÑакÑÐžÐ²ÐœÑ ÐŽÐŸÐºÑЌеМÑаÑÑÑ API
+
+ÐеÑейЎеЌП ÑÑЎО http://127.0.0.1:8000/docs .
+
+ÐО пПбаÑОÑе авÑПЌаÑОÑÐœÑ ÑÐœÑеÑакÑÐžÐ²ÐœÑ API ЎПкÑЌеМÑаÑÑÑ (ÑÑвПÑÐµÐœÑ Ð·Ð°Ð²ÐŽÑкО Swagger UI ):
+
+![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
+
+### ÐлÑÑеÑМаÑÐžÐ²ÐœÑ ÐŽÐŸÐºÑЌеМÑаÑÑÑ API
+
+Ð¢ÐµÐ¿ÐµÑ Ð¿ÐµÑейЎеЌП ÑÑЎО http://127.0.0.1:8000/redoc .
+
+ÐО пПбаÑОÑе алÑÑеÑМаÑÐžÐ²ÐœÑ Ð°Ð²ÑПЌаÑОÑÐœÑ ÐŽÐŸÐºÑЌеМÑаÑÑÑ (ÑÑвПÑÐµÐœÑ Ð·Ð°Ð²ÐŽÑкО ReDoc ):
+
+![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
+
+## ÐÑОклаЎ ПМПвлеММÑ
+
+Ð¢ÐµÐ¿ÐµÑ ÐŒÐŸÐŽÐžÑÑкÑйÑе Ñайл `main.py`, ÑПб ПÑÑОЌаÑО вЌÑÑÑ Ð·Ð°Ð¿ÐžÑÑ `PUT`.
+
+ÐгПлПÑÑйÑе вЌÑÑÑ Ð·Ð°Ð¿ÐžÑÑ Ð·Ð° ÐŽÐŸÐ¿ÐŸÐŒÐŸÐ³ÐŸÑ ÑÑаМЎаÑÑМОÑ
ÑОпÑв Python завЎÑкО Pydantic.
+
+```Python hl_lines="4 9-12 25-27"
+from typing import Union
+
+from fastapi import FastAPI
+from pydantic import BaseModel
+
+app = FastAPI()
+
+
+class Item(BaseModel):
+ name: str
+ price: float
+ is_offer: Union[bool, None] = None
+
+
+@app.get("/")
+def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+def read_item(item_id: int, q: Union[str, None] = None):
+ return {"item_id": item_id, "q": q}
+
+
+@app.put("/items/{item_id}")
+def update_item(item_id: int, item: Item):
+ return {"item_name": item.name, "item_id": item_id}
+```
+
+СеÑÐ²ÐµÑ Ð¿ÐŸÐ²ÐžÐœÐµÐœ авÑПЌаÑОÑМП пеÑезаваМÑажÑваÑОÑÑ (ÑÐŸÐŒÑ ÑП ÐО ЎПЎалО `--reload` ЎП `uvicorn` кПЌаМЎО вОÑе).
+
+### ÐÐœÐŸÐ²Ð»ÐµÐœÐœÑ ÑÐœÑеÑакÑÐžÐ²ÐœÐŸÑ API ЎПкÑЌеМÑаÑÑÑ
+
+Ð¢ÐµÐ¿ÐµÑ Ð¿ÐµÑейЎеЌП ÑÑЎО http://127.0.0.1:8000/docs .
+
+* ÐÐœÑеÑакÑОвМа ЎПкÑЌеМÑаÑÑÑ API бÑЎе авÑПЌаÑОÑМП ПМПвлеМа, вклÑÑаÑÑО МПвОй вЌÑÑÑ:
+
+![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
+
+* ÐаÑОÑÐœÑÑÑ ÐºÐœÐŸÐ¿ÐºÑ "Try it out", Ñе ЎПзвПлОÑÑ Ð²Ð°ÐŒ запПвМОÑО паÑаЌеÑÑО Ñа безпПÑеÑеЎМÑП взаÑЌПЎÑÑÑО з API:
+
+![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png)
+
+* ÐПÑÑÐŒ МаÑОÑÐœÑÑÑ ÐºÐœÐŸÐ¿ÐºÑ "Execute", ÑÐœÑеÑÑÐµÐ¹Ñ ÐºÐŸÑОÑÑÑваÑа зв'ÑжеÑÑÑÑ Ð· ваÑОЌ API, МаЎÑÑле паÑаЌеÑÑО, Ñ Ð²ÑЎпПвÑÐŽÑ ÐŸÑÑÐžÐŒÐ°Ñ ÑезÑлÑÑаÑО Ñа пПкаже ÑÑ
Ма екÑаМÑ:
+
+![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png)
+
+### ÐÐœÐŸÐ²Ð»ÐµÐœÐœÑ Ð°Ð»ÑÑеÑМаÑÐžÐ²ÐœÐŸÑ API ЎПкÑЌеМÑаÑÑÑ
+
+ÐаÑаз пеÑейЎеЌП http://127.0.0.1:8000/redoc .
+
+* ÐлÑÑеÑМаÑОвМа ЎПкÑЌеМÑаÑÑÑ ÑакПж пПказÑваÑОЌе МПвОй паÑаЌеÑÑ Ñ Ð²ÐŒÑÑÑ Ð·Ð°Ð¿ÐžÑÑ:
+
+![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
+
+### ÐÑÐŽÑÑЌкО
+
+ТакОЌ ÑОМПЌ, ÐО **ПЎОМ Ñаз** ПгПлПÑÑÑÑе ÑОпО паÑаЌеÑÑÑв, ÑÑла ÑПÑП, Ñк паÑаЌеÑÑО ÑÑМкÑÑÑ.
+
+ÐО ÑПбОÑе Ñе за ÐŽÐŸÐ¿ÐŸÐŒÐŸÐ³ÐŸÑ ÑÑаМЎаÑÑМОÑ
ÑÑÑаÑМОÑ
ÑОпÑв Python.
+
+ÐаЌ Ме пПÑÑÑбМП вОвÑаÑО МПвОй ÑОМÑакÑОÑ, ЌеÑПЎО ÑО клаÑО кПМкÑеÑÐœÐŸÑ Ð±ÑблÑПÑекО ÑПÑП.
+
+ÐОкПÑОÑÑПвÑÑÑО ÑÑаМЎаÑÑМОй **Python 3.8+**.
+
+ÐапÑОклаЎ, ÐŽÐ»Ñ `int`:
+
+```Python
+item_id: int
+```
+
+абП ÐŽÐ»Ñ Ð±ÑлÑÑ ÑÐºÐ»Ð°ÐŽÐœÐŸÑ ÐŒÐŸÐŽÐµÐ»Ñ `Item`:
+
+```Python
+item: Item
+```
+
+...Ñ Ð· ÑОЌ ÑЎОМОЌ ПгПлПÑеММÑÐŒ ÐО ПÑÑОЌÑÑÑе:
+
+* ÐÑÐŽÑÑÐžÐŒÐºÑ ÑеЎакÑПÑа, вклÑÑаÑÑО:
+ * ÐаÑÑаМÑО запПвМеММÑ.
+ * ÐеÑевÑÑÐºÑ ÑОпÑв.
+* ÐеÑевÑÑÐºÑ ÐŽÐ°ÐœÐžÑ
:
+ * ÐвÑПЌаÑОÑÐœÑ Ñа зÑПзÑÐŒÑÐ»Ñ Ð¿ÐŸÐŒÐžÐ»ÐºÐž, Ñ ÑÐ°Ð·Ñ ÐœÐµÐºÐŸÑекÑМОÑ
ЎаМОÑ
.
+ * ÐеÑевÑÑка МавÑÑÑ ÐŽÐ»Ñ JSON з вОÑПкОЌ ÑÑвМеЌ вклаЎеМПÑÑÑ.
+* ÐеÑеÑвПÑÐµÐœÐœÑ Ð²Ñ
ÑЎМОÑ
ЎаМОÑ
: з ЌеÑÐµÐ¶Ñ ÐŽÐŸ ЎаМОÑ
Ñ ÑОпÑв Python. ЧОÑÐ°ÐœÐœÑ Ð·:
+ * JSON.
+ * ÐаÑаЌеÑÑÑв ÑлÑÑ
Ñ.
+ * ÐаÑаЌеÑÑÑв запОÑÑ.
+ * Cookies.
+ * Headers.
+ * Forms.
+ * ЀайлÑв.
+* ÐеÑеÑвПÑÐµÐœÐœÑ Ð²ÐžÑ
ÑЎМОÑ
ЎаМОÑ
: з ÑОпÑв Ñ ÐŽÐ°ÐœÐžÑ
Python ЎП ЌеÑежевОÑ
ЎаМОÑ
(Ñк JSON):
+ * ÐПМвеÑÑаÑÑÑ Python ÑОпÑв (`str`, `int`, `float`, `bool`, `list`, ÑПÑП).
+ * `datetime` Пб'ÑкÑО.
+ * `UUID` Пб'ÑкÑО.
+ * ÐÐŸÐŽÐµÐ»Ñ Ð±Ð°Ð·Ðž ЎаМОÑ
.
+ * ...Ñа багаÑП ÑÐœÑПгП.
+* ÐвÑПЌаÑОÑÐœÑ ÑÐœÑеÑакÑÐžÐ²ÐœÑ ÐŽÐŸÐºÑЌеМÑаÑÑÑ API, вклÑÑаÑÑО 2 алÑÑеÑМаÑÐžÐ²ÐœÑ ÑÐœÑеÑÑейÑО кПÑОÑÑÑваÑа:
+ * Swagger UI.
+ * ReDoc.
+
+---
+
+ÐПвеÑÑаÑÑОÑÑ ÐŽÐŸ пПпеÑеЎМÑПгП пÑÐžÐºÐ»Ð°ÐŽÑ ÐºÐŸÐŽÑ, **FastAPI**:
+
+* ÐÑÐŽÑвеÑЎОÑÑ ÐœÐ°ÑвМÑÑÑÑ `item_id` Ñ ÑлÑÑ
Ñ ÐŽÐ»Ñ Ð·Ð°Ð¿ÐžÑÑв `GET` Ñа `PUT`.
+* ÐÑÐŽÑвеÑЎОÑÑ, ÑП `item_id` ÐŒÐ°Ñ ÑОп `int` ÐŽÐ»Ñ Ð·Ð°Ð¿ÐžÑÑв `GET` and `PUT`.
+ * ЯкÑП Ñе Ме Ñак, клÑÑÐœÑ Ð¿ÐŸÐ±Ð°ÑОÑÑ ÐºÐŸÑОÑÐœÑ, зÑПзÑÐŒÑÐ»Ñ Ð¿ÐŸÐŒÐžÐ»ÐºÑ.
+* ÐеÑевÑÑОÑÑ, ÑО Ñ ÐœÐµÐŸÐ±ÐŸÐ²'ÑзкПвОй паÑаЌеÑÑ Ð·Ð°Ð¿ÐžÑÑ Ð· ÐœÐ°Ð·Ð²ÐŸÑ `q` (а ÑаЌе `http://127.0.0.1:8000/items/foo?q=somequery`) ÐŽÐ»Ñ Ð·Ð°Ð¿ÐžÑÑв `GET`.
+ * ÐÑкÑлÑкО паÑаЌеÑÑ `q` ПгПлПÑеМП Ñк `= None`, вÑÐœ МеПбПв'ÑзкПвОй.
+ * Ðа вÑÐŽÑÑÑМПÑÑÑ `None` вÑÐœ бÑв бО ПбПв'ÑзкПвОЌ (Ñк Ñ Ð²ÐŒÑÑÑ Ñ Ð²ÐžÐ¿Ð°ÐŽÐºÑ Ð· `PUT`).
+* ÐÐ»Ñ Ð·Ð°Ð¿ÐžÑÑв `PUT` Ñз `/items/{item_id}`, ÑОÑÐ°Ñ Ð²ÐŒÑÑÑ Ñк JSON:
+ * ÐеÑевÑÑОÑÑ, ÑО ÐŒÐ°Ñ ÐŸÐ±ÐŸÐ²'ÑзкПвОй аÑÑОбÑÑ `name` ÑОп `str`.
+ * ÐеÑевÑÑОÑÑ, ÑО ÐŒÐ°Ñ ÐŸÐ±ÐŸÐ²'ÑзкПвОй аÑÑОбÑÑ `price` ÑОп `float`.
+ * ÐеÑевÑÑОÑÑ, ÑО ÑÑÐœÑÑ ÐœÐµÐŸÐ±ÐŸÐ²'ÑзкПвОй аÑÑОбÑÑ `is_offer` Ñа ÑО ÐŒÐ°Ñ Ð²ÑÐœ ÑОп `bool`.
+ * УÑе Ñе ÑакПж пÑаÑÑваÑОЌе ÐŽÐ»Ñ Ð³Ð»ÐžÐ±ÐŸÐºÐŸ вклаЎеМОÑ
Пб'ÑкÑÑв JSON.
+* ÐвÑПЌаÑОÑМП кПМвеÑÑÑÑ Ñз Ñа в JSON.
+* ÐПкÑЌеМÑÑÑ Ð²Ñе за ÐŽÐŸÐ¿ÐŸÐŒÐŸÐ³ÐŸÑ OpenAPI, ÑкОй ЌПже бÑÑО вОкПÑОÑÑаМП в:
+ * ÐÐœÑеÑакÑОвМОÑ
ÑОÑÑеЌаÑ
ЎПкÑЌеМÑаÑÑÑ.
+ * СОÑÑеЌаÑ
авÑПЌаÑОÑÐœÐŸÑ Ð³ÐµÐœÐµÑаÑÑÑ ÐºÐ»ÑÑÐœÑÑÑкПгП ÐºÐŸÐŽÑ ÐŽÐ»Ñ Ð±Ð°Ð³Ð°ÑÑПÑ
ЌПв.
+* ÐÐ°ÐŽÐ°Ñ Ð±ÐµÐ·Ð¿ÐŸÑеÑеЎМÑП 2 вебÑÐœÑеÑÑейÑО ÑÐœÑеÑакÑÐžÐ²ÐœÐŸÑ ÐŽÐŸÐºÑЌеМÑаÑÑÑ.
+
+---
+
+ÐО лОÑе ÑÑÑÑкО ЎПÑПÑкМÑлОÑÑ ÐŽÐŸ кПЎÑ, але ÐО вже ЌаÑÑе ÑÑÐ²Ð»ÐµÐœÐœÑ Ð¿ÑП Ñе, Ñк вÑе пÑаÑÑÑ.
+
+СпÑПбÑйÑе зЌÑМОÑО ÑÑЎПк:
+
+```Python
+ return {"item_name": item.name, "item_id": item_id}
+```
+
+...Ñз:
+
+```Python
+ ... "item_name": item.name ...
+```
+
+...Ма:
+
+```Python
+ ... "item_price": item.price ...
+```
+
+...Ñ Ð¿ÐŸÐ±Ð°ÑОÑе, Ñк Ð²Ð°Ñ ÑеЎакÑÐŸÑ Ð°Ð²ÑПЌаÑОÑМП запПвМÑваÑОЌе аÑÑОбÑÑО Ñа зМаÑОЌе ÑÑ
ÐœÑ ÑОпО:
+
+![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
+
+ÐÐ»Ñ Ð±ÑлÑÑ Ð¿ÐŸÐ²ÐœÐŸÐ³ÐŸ ÐŸÐ·ÐœÐ°Ð¹ÐŸÐŒÐ»ÐµÐœÐœÑ Ð· ЎПЎаÑкПвОЌО ÑÑМкÑÑÑЌО, пеÑеглÑÐœÑÑе ТÑÑПÑÑал - ÐПÑÑбМОк ÐПÑОÑÑÑваÑа .
+
+**Spoiler alert**: ÑÑÑПÑÑал - пПÑÑбМОк кПÑОÑÑÑваÑа ÐŒÑÑÑОÑÑ:
+
+* ÐгПлПÑÐµÐœÐœÑ **паÑаЌеÑÑÑв** з ÑÐœÑОÑ
ÐŒÑÑÑÑ Ñк: **headers**, **cookies**, **form fields** Ñа **files**.
+* Як вÑÑаМПвОÑО **пеÑевÑÑÐºÑ ÐŸÐ±ÐŒÐµÐ¶ÐµÐœÑ** Ñк `maximum_length` абП `regex`.
+* ÐÑже пПÑÑжМа Ñ Ð¿ÑПÑÑа Ñ Ð²ÐžÐºÐŸÑОÑÑÐ°ÐœÐœÑ ÑОÑÑеЌа **ÐÐœ'ÑкÑÑÑ ÐалежМПÑÑей **.
+* Ðезпека Ñа авÑеМÑОÑÑкаÑÑÑ, вклÑÑаÑÑО пÑÐŽÑÑÐžÐŒÐºÑ **OAuth2** з **JWT tokens** Ñа **HTTP Basic** авÑеМÑОÑÑкаÑÑÑ.
+* ÐПÑкПМалÑÑÑ (але ПЎМакПвП пÑПÑÑÑ) ÑеÑ
ÐœÑкО ÐŽÐ»Ñ ÐŸÐ³ÐŸÐ»ÐŸÑÐµÐœÐœÑ **глОбПкП вклаЎеМОÑ
ЌПЎелей JSON** (завЎÑкО Pydantic).
+* ÐагаÑП ЎПЎаÑкПвОÑ
ÑÑМкÑÑй (завЎÑкО Starlette) Ñк-ПÑ:
+ * **WebSockets**
+ * МаЎзвОÑайМП пÑПÑÑÑ ÑеÑÑО Ма ПÑÐœÐŸÐ²Ñ HTTPX Ñа `pytest`
+ * **CORS**
+ * **Cookie Sessions**
+ * ...Ñа бÑлÑÑе.
+
+## ÐÑПЎÑкÑОвМÑÑÑÑ
+
+ÐÐµÐ·Ð°Ð»ÐµÐ¶ÐœÑ ÑеÑÑО TechEmpower пПказÑÑÑÑ ÑП заÑÑПÑÑМкО **FastAPI**, ÑÐºÑ Ð¿ÑаÑÑÑÑÑ Ð¿ÑÐŽ кеÑÑваММÑÐŒ Uvicorn Ñ ÐŸÐŽÐœÐžÐŒÐž з МайÑвОЎÑОÑ
ÑеÑеЎ ЎПÑÑÑпМОÑ
ÑÑейЌвПÑкÑв в Python , пПÑÑÑпаÑÑОÑÑ Ð»ÐžÑе Starlette Ñа Uvicorn (ÑÐºÑ Ð²ÐœÑÑÑÑÑÐœÑП вОкПÑОÑÑПвÑÑÑÑÑÑ Ð² FastAPI). (*)
+
+ЩПб ÐŽÑзМаÑОÑÑ Ð±ÑлÑÑе пÑП Ñе, пеÑеглÑÐœÑÑе ÑПзЎÑл Benchmarks .
+
+## ÐеПбПв'ÑÐ·ÐºÐŸÐ²Ñ Ð·Ð°Ð»ÐµÐ¶ÐœÐŸÑÑÑ
+
+Pydantic вОкПÑОÑÑПвÑÑ:
+
+* email_validator
- ÐŽÐ»Ñ Ð²Ð°Ð»ÑЎаÑÑÑ ÐµÐ»ÐµÐºÑÑÐŸÐœÐœÐŸÑ Ð¿ÐŸÑÑО.
+* pydantic-settings
- ÐŽÐ»Ñ ÑпÑавлÑÐœÐœÑ ÐœÐ°Ð»Ð°ÑÑÑваММÑЌО.
+* pydantic-extra-types
- ÐŽÐ»Ñ ÐŽÐŸÐŽÐ°ÑкПвОÑ
ÑОпÑв, ÑП ЌПжÑÑÑ Ð±ÑÑО вОкПÑОÑÑÐ°ÐœÑ Ð· Pydantic.
+
+
+Starlette вОкПÑОÑÑПвÑÑ:
+
+* httpx
- ÐеПбÑ
ÑЎМП, ÑкÑП ÐО Ñ
ПÑеÑе вОкПÑОÑÑПвÑваÑО `TestClient`.
+* jinja2
- ÐеПбÑ
ÑЎМП, ÑкÑП ÐО Ñ
ПÑеÑе вОкПÑОÑÑПвÑваÑО ÑаблПМО Ñк кПМÑÑгÑÑаÑÑÑ Ð·Ð° заЌПвÑÑваММÑÐŒ.
+* python-multipart
- ÐеПбÑ
ÑЎМП, ÑкÑП ÐО Ñ
ПÑеÑе пÑÐŽÑÑОЌÑваÑО "ÑПзбÑÑ" ÑПÑЌО за ÐŽÐŸÐ¿ÐŸÐŒÐŸÐ³ÐŸÑ `request.form()`.
+* itsdangerous
- ÐеПбÑ
ÑЎМП ÐŽÐ»Ñ Ð¿ÑÐŽÑÑОЌкО `SessionMiddleware`.
+* pyyaml
- ÐеПбÑ
ÑЎМП ÐŽÐ»Ñ Ð¿ÑÐŽÑÑОЌкО Starlette `SchemaGenerator` (йЌПвÑÑМП, ваЌ Ñе Ме пПÑÑÑбМП з FastAPI).
+* ujson
- ÐеПбÑ
ÑЎМП, ÑкÑП ÐО Ñ
ПÑеÑе вОкПÑОÑÑПвÑваÑО `UJSONResponse`.
+
+FastAPI / Starlette вОкПÑОÑÑПвÑÑÑÑ:
+
+* uvicorn
- ÐŽÐ»Ñ ÑеÑвеÑа, ÑкОй заваМÑажÑÑ Ñа ПбÑлÑгПвÑÑ Ð²Ð°ÑÑ Ð¿ÑПгÑаЌÑ.
+* orjson
- ÐеПбÑ
ÑЎМП, ÑкÑП ÐО Ñ
ПÑеÑе вОкПÑОÑÑПвÑваÑО `ORJSONResponse`.
+
+ÐО ЌПжеÑе вÑÑаМПвОÑО вÑе Ñе за ÐŽÐŸÐ¿ÐŸÐŒÐŸÐ³ÐŸÑ `pip install fastapi[all]`.
+
+## ÐÑÑеМзÑÑ
+
+Њей пÑПÑÐºÑ Ð»ÑÑеМзПваМП згÑЎМП з ÑЌПваЌО лÑÑеМзÑÑ MIT.
From 33e57e6f022a24f4aec966a6735754c1c18d9245 Mon Sep 17 00:00:00 2001
From: Aleksandr Andrukhov
Date: Tue, 9 Jan 2024 20:06:10 +0300
Subject: [PATCH 090/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Russian=20translat?=
=?UTF-8?q?ion=20for=20`docs/ru/docs/tutorial/request-forms-and-files.md`?=
=?UTF-8?q?=20(#10347)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
---
.../docs/tutorial/request-forms-and-files.md | 69 +++++++++++++++++++
1 file changed, 69 insertions(+)
create mode 100644 docs/ru/docs/tutorial/request-forms-and-files.md
diff --git a/docs/ru/docs/tutorial/request-forms-and-files.md b/docs/ru/docs/tutorial/request-forms-and-files.md
new file mode 100644
index 0000000000000..3f587c38a3ae7
--- /dev/null
+++ b/docs/ru/docs/tutorial/request-forms-and-files.md
@@ -0,0 +1,69 @@
+# Ð€Ð°Ð¹Ð»Ñ Ðž ÑПÑÐŒÑ Ð² запÑПÑе
+
+ÐÑ ÐŒÐŸÐ¶ÐµÑе ПпÑеЎелÑÑÑ ÑÐ°Ð¹Ð»Ñ Ðž Ð¿ÐŸÐ»Ñ ÑПÑÐŒÑ ÐŸÐŽÐœÐŸÐ²ÑеЌеММП, ОÑпПлÑзÑÑ `File` О `Form`.
+
+!!! info "ÐПпПлМОÑелÑÐœÐ°Ñ ÐžÐœÑПÑЌаÑОÑ"
+ ЧÑÐŸÐ±Ñ Ð¿ÐŸÐ»ÑÑаÑÑ Ð·Ð°Ð³ÑÑжеММÑе ÑÐ°Ð¹Ð»Ñ Ðž/ОлО ЎаММÑе ÑПÑÐŒ, ÑМаÑала ÑÑÑаМПвОÑе `python-multipart` .
+
+ ÐапÑОЌеÑ: `pip install python-multipart`.
+
+## ÐЌпПÑÑОÑÑйÑе `File` О `Form`
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="3"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="1"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001.py!}
+ ```
+
+## ÐпÑеЎелОÑе паÑаЌеÑÑÑ `File` О `Form`
+
+СПзЎайÑе паÑаЌеÑÑÑ Ñайла О ÑПÑÐŒÑ ÑакОЌ же ПбÑазПЌ, как ÐŽÐ»Ñ `Body` ОлО `Query`:
+
+=== "Python 3.9+"
+
+ ```Python hl_lines="10-12"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001_an_py39.py!}
+ ```
+
+=== "Python 3.6+"
+
+ ```Python hl_lines="9-11"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001_an.py!}
+ ```
+
+=== "Python 3.6+ без Annotated"
+
+ !!! tip "ÐПЎÑказка"
+ ÐÑеЎпПÑÑОÑелÑМее ОÑпПлÑзПваÑÑ Ð²ÐµÑÑÐžÑ Ñ Ð°ÐœÐœÐŸÑаÑОей, еÑлО ÑÑП вПзЌПжМП.
+
+ ```Python hl_lines="8"
+ {!> ../../../docs_src/request_forms_and_files/tutorial001.py!}
+ ```
+
+Ð€Ð°Ð¹Ð»Ñ Ðž Ð¿ÐŸÐ»Ñ ÑПÑÐŒÑ Ð±ÑÐŽÑÑ Ð·Ð°Ð³ÑÑÐ¶ÐµÐœÑ Ð² вОЎе ЎаММÑÑ
ÑПÑÐŒÑ, О Ð²Ñ Ð¿ÐŸÐ»ÑÑОÑе ÑÐ°Ð¹Ð»Ñ Ðž Ð¿ÐŸÐ»Ñ ÑПÑÐŒÑ.
+
+ÐÑ ÐŒÐŸÐ¶ÐµÑе ПбÑÑвОÑÑ ÐœÐµÐºÐŸÑПÑÑе ÑÐ°Ð¹Ð»Ñ ÐºÐ°Ðº `bytes`, а МекПÑПÑÑе - как `UploadFile`.
+
+!!! warning "ÐМОЌаМОе"
+ ÐÑ ÐŒÐŸÐ¶ÐµÑе ПбÑÑвОÑÑ ÐœÐµÑкПлÑкП паÑаЌеÑÑПв `File` О `Form` в ПпеÑаÑОО *path*, МП Ð²Ñ ÐœÐµ ЌПжеÑе Ñакже ПбÑÑвОÑÑ Ð¿ÐŸÐ»Ñ `Body`, кПÑПÑÑе Ð²Ñ ÐŸÐ¶ÐžÐŽÐ°ÐµÑе пПлÑÑОÑÑ Ð² вОЎе JSON, Ñак как запÑÐŸÑ Ð±ÑÐŽÐµÑ ÐžÐŒÐµÑÑ ÑелП, закПЎОÑПваММПе Ñ Ð¿ÐŸÐŒÐŸÑÑÑ `multipart/form-data` вЌеÑÑП `application/json`.
+
+ ÐÑП Ме ПгÑаМОÑеМОе **Fast API**, ÑÑП ÑаÑÑÑ Ð¿ÑПÑПкПла HTTP.
+
+## РезÑЌе
+
+ÐÑпПлÑзÑйÑе `File` О `Form` вЌеÑÑе, кПгЎа МеПбÑ
ПЎОЌП пПлÑÑОÑÑ ÐŽÐ°ÐœÐœÑе О ÑÐ°Ð¹Ð»Ñ Ð² ПЎМПЌ запÑПÑе.
From d2c7ffb447f4007e35c3bc102ef2ce13695ea5d8 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 17:31:25 +0000
Subject: [PATCH 091/217] =?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 7b1b861b277fc..eb6435235ea79 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -20,6 +20,7 @@ hide:
### Translations
+* ð Add Ukrainian translation for `docs/uk/docs/index.md`. PR [#10362](https://github.com/tiangolo/fastapi/pull/10362) by [@rostik1410](https://github.com/rostik1410).
* âïž Update Python version in `docs/ko/docs/index.md`. PR [#10680](https://github.com/tiangolo/fastapi/pull/10680) by [@Eeap](https://github.com/Eeap).
* ð Add Persian translation for `docs/fa/docs/features.md`. PR [#5887](https://github.com/tiangolo/fastapi/pull/5887) by [@amirilf](https://github.com/amirilf).
* ð Add Chinese translation for `docs/zh/docs/advanced/additional-responses.md`. PR [#10325](https://github.com/tiangolo/fastapi/pull/10325) by [@ShuibeiC](https://github.com/ShuibeiC).
From d62b3ea69c70c77b570dafe175b6a4062ea545b2 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 17:32:21 +0000
Subject: [PATCH 092/217] =?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 eb6435235ea79..bea478c2b2a8d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -20,6 +20,7 @@ hide:
### Translations
+* ð Add Russian translation for `docs/ru/docs/tutorial/request-forms-and-files.md`. PR [#10347](https://github.com/tiangolo/fastapi/pull/10347) by [@AlertRED](https://github.com/AlertRED).
* ð Add Ukrainian translation for `docs/uk/docs/index.md`. PR [#10362](https://github.com/tiangolo/fastapi/pull/10362) by [@rostik1410](https://github.com/rostik1410).
* âïž Update Python version in `docs/ko/docs/index.md`. PR [#10680](https://github.com/tiangolo/fastapi/pull/10680) by [@Eeap](https://github.com/Eeap).
* ð Add Persian translation for `docs/fa/docs/features.md`. PR [#5887](https://github.com/tiangolo/fastapi/pull/5887) by [@amirilf](https://github.com/amirilf).
From 6f43539d87406ea0afc52de3c54f352487024f6c Mon Sep 17 00:00:00 2001
From: Andrew Chang-DeWitt
<11323923+andrew-chang-dewitt@users.noreply.github.com>
Date: Tue, 9 Jan 2024 11:45:52 -0600
Subject: [PATCH 093/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20warning=20about=20?=
=?UTF-8?q?lifecycle=20events=20with=20`AsyncClient`=20(#4167)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Marcelo Trylesinski
---
docs/en/docs/advanced/async-tests.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/docs/en/docs/advanced/async-tests.md b/docs/en/docs/advanced/async-tests.md
index 9b39d70fca6a8..c79822d63e19b 100644
--- a/docs/en/docs/advanced/async-tests.md
+++ b/docs/en/docs/advanced/async-tests.md
@@ -84,6 +84,9 @@ response = client.get('/')
!!! tip
Note that we're using async/await with the new `AsyncClient` - the request is asynchronous.
+!!! warning
+ If your application relies on lifespan events, the `AsyncClient` won't trigger these events. To ensure they are triggered, use `LifespanManager` from https://github.com/florimondmanca/asgi-lifespan#usage .
+
## Other Asynchronous Function Calls
As the testing function is now asynchronous, you can now also call (and `await`) other `async` functions apart from sending requests to your FastAPI application in your tests, exactly as you would call them anywhere else in your code.
From 7dd944deda6433924712274b81743edc63f92bbb Mon Sep 17 00:00:00 2001
From: John Philip
Date: Tue, 9 Jan 2024 20:49:58 +0300
Subject: [PATCH 094/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20article:=20"Buildi?=
=?UTF-8?q?ng=20a=20RESTful=20API=20with=20FastAPI:=20Secure=20Signup=20an?=
=?UTF-8?q?d=20Login=20Functionality=20Included"=20(#9733)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/en/data/external_links.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index 35c9b6718ed76..d53afd7f9fac6 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -1,5 +1,9 @@
Articles:
English:
+ - author: John Philip
+ author_link: https://medium.com/@amjohnphilip
+ link: https://python.plainenglish.io/building-a-restful-api-with-fastapi-secure-signup-and-login-functionality-included-45cdbcb36106
+ title: "Building a RESTful API with FastAPI: Secure Signup and Login Functionality Included"
- author: Keshav Malik
author_link: https://theinfosecguy.xyz/
link: https://blog.theinfosecguy.xyz/building-a-crud-api-with-fastapi-and-supabase-a-step-by-step-guide
From 809b21c849a4d84898fb59ea832bb77386ae3aec Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 18:12:12 +0000
Subject: [PATCH 095/217] =?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 bea478c2b2a8d..839d84e81084d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add warning about lifecycle events with `AsyncClient`. PR [#4167](https://github.com/tiangolo/fastapi/pull/4167) by [@andrew-chang-dewitt](https://github.com/andrew-chang-dewitt).
* âïž Fix typos in `/docs/reference/exceptions.md` and `/en/docs/reference/status.md`. PR [#10809](https://github.com/tiangolo/fastapi/pull/10809) by [@clarencepenz](https://github.com/clarencepenz).
* âïž Fix typo in `openapi-callbacks.md`. PR [#10673](https://github.com/tiangolo/fastapi/pull/10673) by [@kayjan](https://github.com/kayjan).
* âïž Fix typo in `fastapi/routing.py` . PR [#10520](https://github.com/tiangolo/fastapi/pull/10520) by [@sepsh](https://github.com/sepsh).
From e628e1928e18643196e8ae9a02f2f5ce0817c914 Mon Sep 17 00:00:00 2001
From: Takuma Yamamoto
Date: Wed, 10 Jan 2024 03:13:02 +0900
Subject: [PATCH 096/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Update=20Python=20?=
=?UTF-8?q?version=20in=20`index.md`=20in=20several=20languages=20(#10711)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/ja/docs/index.md | 4 ++--
docs/ko/docs/index.md | 2 +-
docs/pl/docs/index.md | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/ja/docs/index.md b/docs/ja/docs/index.md
index f340fdb87ebc5..22c31e7ca926e 100644
--- a/docs/ja/docs/index.md
+++ b/docs/ja/docs/index.md
@@ -24,7 +24,7 @@
---
-FastAPI ã¯ãPythonã®æšæºã§ããåãã³ãã«åºã¥ããŠPython 3.6 以éã§API ãæ§ç¯ããããã®ãã¢ãã³ã§ãé«é(é«ããã©ãŒãã³ã¹)ãªãWeb ãã¬ãŒã ã¯ãŒã¯ã§ãã
+FastAPI ã¯ãPythonã®æšæºã§ããåãã³ãã«åºã¥ããŠPython 3.8 以éã§API ãæ§ç¯ããããã®ãã¢ãã³ã§ãé«é(é«ããã©ãŒãã³ã¹)ãªãWeb ãã¬ãŒã ã¯ãŒã¯ã§ãã
äž»ãªç¹åŸŽ:
@@ -317,7 +317,7 @@ def update_item(item_id: int, item: Item):
æ°ããæ§æãç¹å®ã®ã©ã€ãã©ãªã®ã¡ãœãããã¯ã©ã¹ãªã©ãèŠããå¿
èŠã¯ãããŸããã
-åãªãæšæºçãª**3.6 以éã® Python**ã§ãã
+åãªãæšæºçãª**3.8 以éã® Python**ã§ãã
äŸãã°ã`int`ã®å Žå:
diff --git a/docs/ko/docs/index.md b/docs/ko/docs/index.md
index c09b538cf4726..594b092f7316f 100644
--- a/docs/ko/docs/index.md
+++ b/docs/ko/docs/index.md
@@ -24,7 +24,7 @@
---
-FastAPIë íëì ìŽê³ , ë¹ ë¥Žë©°(ê³ ì±ë¥), íìŽì¬ íì€ íì
íížì êž°ìŽí Python3.6+ì API륌 ë¹ëíêž° ìí ì¹ íë ììí¬ì
ëë€.
+FastAPIë íëì ìŽê³ , ë¹ ë¥Žë©°(ê³ ì±ë¥), íìŽì¬ íì€ íì
íížì êž°ìŽí Python3.8+ì API륌 ë¹ëíêž° ìí ì¹ íë ììí¬ì
ëë€.
죌ì í¹ì§ìŒë¡:
diff --git a/docs/pl/docs/index.md b/docs/pl/docs/index.md
index 43a20383ca1fd..49f5c2b011734 100644
--- a/docs/pl/docs/index.md
+++ b/docs/pl/docs/index.md
@@ -24,7 +24,7 @@
---
-FastAPI to nowoczesny, wydajny framework webowy do budowania API z uÅŒyciem Pythona 3.6+ bazujÄ
cy na standardowym typowaniu Pythona.
+FastAPI to nowoczesny, wydajny framework webowy do budowania API z uÅŒyciem Pythona 3.8+ bazujÄ
cy na standardowym typowaniu Pythona.
Kluczowe cechy:
From cbd53f3bc8900b10b10d89dba895d8d7f15db7a5 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 18:15:02 +0000
Subject: [PATCH 097/217] =?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 839d84e81084d..cf686b02a5be5 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add article: "Building a RESTful API with FastAPI: Secure Signup and Login Functionality Included". PR [#9733](https://github.com/tiangolo/fastapi/pull/9733) by [@dxphilo](https://github.com/dxphilo).
* ð Add warning about lifecycle events with `AsyncClient`. PR [#4167](https://github.com/tiangolo/fastapi/pull/4167) by [@andrew-chang-dewitt](https://github.com/andrew-chang-dewitt).
* âïž Fix typos in `/docs/reference/exceptions.md` and `/en/docs/reference/status.md`. PR [#10809](https://github.com/tiangolo/fastapi/pull/10809) by [@clarencepenz](https://github.com/clarencepenz).
* âïž Fix typo in `openapi-callbacks.md`. PR [#10673](https://github.com/tiangolo/fastapi/pull/10673) by [@kayjan](https://github.com/kayjan).
From f226040d28621175477ee6b1273044f775ceac93 Mon Sep 17 00:00:00 2001
From: Dmitry Volodin
Date: Tue, 9 Jan 2024 22:19:59 +0400
Subject: [PATCH 098/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typos=20in?=
=?UTF-8?q?=20`docs/en/docs/tutorial/dependencies/dependencies-with-yield.?=
=?UTF-8?q?md`=20(#10834)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/en/docs/tutorial/dependencies/dependencies-with-yield.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
index 4ead4682cba9a..de87ba3156e54 100644
--- a/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
+++ b/docs/en/docs/tutorial/dependencies/dependencies-with-yield.md
@@ -160,7 +160,7 @@ The same way, you could raise an `HTTPException` or similar in the exit code, af
{!> ../../../docs_src/dependencies/tutorial008b.py!}
```
-An alternative you could use to catch exceptions (and possibly also raise another `HTTPException`) is ot create a [Custom Exception Handler](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
+An alternative you could use to catch exceptions (and possibly also raise another `HTTPException`) is to create a [Custom Exception Handler](../handling-errors.md#install-custom-exception-handlers){.internal-link target=_blank}.
## Execution of dependencies with `yield`
@@ -249,7 +249,7 @@ with open("./somefile.txt") as f:
print(contents)
```
-Underneath, the `open("./somefile.txt")` creates an object that is a called a "Context Manager".
+Underneath, the `open("./somefile.txt")` creates an object that is called a "Context Manager".
When the `with` block finishes, it makes sure to close the file, even if there were exceptions.
From 0108b002f38f5179b29cc579e4bf8e5c3c282a00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Tue, 9 Jan 2024 22:20:37 +0400
Subject: [PATCH 099/217] =?UTF-8?q?=F0=9F=91=A5=20Update=20FastAPI=20Peopl?=
=?UTF-8?q?e=20(#10871)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: github-actions
---
docs/en/data/github_sponsors.yml | 159 +++++++++++++++----------
docs/en/data/people.yml | 192 +++++++++++++++----------------
2 files changed, 190 insertions(+), 161 deletions(-)
diff --git a/docs/en/data/github_sponsors.yml b/docs/en/data/github_sponsors.yml
index 43b4b8c6b3280..713f229cf4de2 100644
--- a/docs/en/data/github_sponsors.yml
+++ b/docs/en/data/github_sponsors.yml
@@ -1,19 +1,25 @@
sponsors:
-- - login: codacy
+- - login: scalar
+ avatarUrl: https://avatars.githubusercontent.com/u/301879?v=4
+ url: https://github.com/scalar
+ - login: codacy
avatarUrl: https://avatars.githubusercontent.com/u/1834093?v=4
url: https://github.com/codacy
- login: bump-sh
avatarUrl: https://avatars.githubusercontent.com/u/33217836?v=4
url: https://github.com/bump-sh
+ - login: Alek99
+ avatarUrl: https://avatars.githubusercontent.com/u/38776361?u=bd6c163fe787c2de1a26c881598e54b67e2482dd&v=4
+ url: https://github.com/Alek99
- login: cryptapi
avatarUrl: https://avatars.githubusercontent.com/u/44925437?u=61369138589bc7fee6c417f3fbd50fbd38286cc4&v=4
url: https://github.com/cryptapi
- login: porter-dev
avatarUrl: https://avatars.githubusercontent.com/u/62078005?v=4
url: https://github.com/porter-dev
- - login: fern-api
- avatarUrl: https://avatars.githubusercontent.com/u/102944815?v=4
- url: https://github.com/fern-api
+ - login: andrew-propelauth
+ avatarUrl: https://avatars.githubusercontent.com/u/89474256?u=1188c27cb744bbec36447a2cfd4453126b2ddb5c&v=4
+ url: https://github.com/andrew-propelauth
- - login: nihpo
avatarUrl: https://avatars.githubusercontent.com/u/1841030?u=0264956d7580f7e46687a762a7baa629f84cf97c&v=4
url: https://github.com/nihpo
@@ -21,7 +27,7 @@ sponsors:
avatarUrl: https://avatars.githubusercontent.com/u/65656077?v=4
url: https://github.com/ObliviousAI
- - login: mikeckennedy
- avatarUrl: https://avatars.githubusercontent.com/u/2035561?u=1bb18268bcd4d9249e1f783a063c27df9a84c05b&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/2035561?u=ce6165b799ea3164cb6f5ff54ea08042057442af&v=4
url: https://github.com/mikeckennedy
- login: ndimares
avatarUrl: https://avatars.githubusercontent.com/u/6267663?u=cfb27efde7a7212be8142abb6c058a1aeadb41b1&v=4
@@ -59,10 +65,7 @@ sponsors:
- login: jina-ai
avatarUrl: https://avatars.githubusercontent.com/u/60539444?v=4
url: https://github.com/jina-ai
-- - login: HiredScore
- avatarUrl: https://avatars.githubusercontent.com/u/3908850?v=4
- url: https://github.com/HiredScore
- - login: Trivie
+- - login: Trivie
avatarUrl: https://avatars.githubusercontent.com/u/8161763?v=4
url: https://github.com/Trivie
- - login: birkjernstrom
@@ -80,27 +83,39 @@ sponsors:
- login: mainframeindustries
avatarUrl: https://avatars.githubusercontent.com/u/55092103?v=4
url: https://github.com/mainframeindustries
- - login: deployplex
+ - login: doseiai
avatarUrl: https://avatars.githubusercontent.com/u/57115726?v=4
- url: https://github.com/deployplex
+ url: https://github.com/doseiai
+ - login: CanoaPBC
+ avatarUrl: https://avatars.githubusercontent.com/u/64223768?v=4
+ url: https://github.com/CanoaPBC
- - login: povilasb
avatarUrl: https://avatars.githubusercontent.com/u/1213442?u=b11f58ed6ceea6e8297c9b310030478ebdac894d&v=4
url: https://github.com/povilasb
- login: primer-io
avatarUrl: https://avatars.githubusercontent.com/u/62146168?v=4
url: https://github.com/primer-io
+- - login: upciti
+ avatarUrl: https://avatars.githubusercontent.com/u/43346262?v=4
+ url: https://github.com/upciti
- - login: Kludex
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
- login: samuelcolvin
avatarUrl: https://avatars.githubusercontent.com/u/4039449?u=42eb3b833047c8c4b4f647a031eaef148c16d93f&v=4
url: https://github.com/samuelcolvin
+ - login: koconder
+ avatarUrl: https://avatars.githubusercontent.com/u/25068?u=582657b23622aaa3dfe68bd028a780f272f456fa&v=4
+ url: https://github.com/koconder
- login: jefftriplett
avatarUrl: https://avatars.githubusercontent.com/u/50527?u=af1ddfd50f6afd6d99f333ba2ac8d0a5b245ea74&v=4
url: https://github.com/jefftriplett
- login: jstanden
avatarUrl: https://avatars.githubusercontent.com/u/63288?u=c3658d57d2862c607a0e19c2101c3c51876e36ad&v=4
url: https://github.com/jstanden
+ - login: andreaso
+ avatarUrl: https://avatars.githubusercontent.com/u/285964?u=837265cc7562c0685f25b2d81cd9de0434fe107c&v=4
+ url: https://github.com/andreaso
- login: pamelafox
avatarUrl: https://avatars.githubusercontent.com/u/297042?v=4
url: https://github.com/pamelafox
@@ -116,9 +131,9 @@ sponsors:
- login: falkben
avatarUrl: https://avatars.githubusercontent.com/u/653031?u=ad9838e089058c9e5a0bab94c0eec7cc181e0cd0&v=4
url: https://github.com/falkben
- - login: jqueguiner
- avatarUrl: https://avatars.githubusercontent.com/u/690878?u=bd65cc1f228ce6455e56dfaca3ef47c33bc7c3b0&v=4
- url: https://github.com/jqueguiner
+ - login: mintuhouse
+ avatarUrl: https://avatars.githubusercontent.com/u/769950?u=ecfbd79a97d33177e0d093ddb088283cf7fe8444&v=4
+ url: https://github.com/mintuhouse
- login: tcsmith
avatarUrl: https://avatars.githubusercontent.com/u/989034?u=7d8d741552b3279e8f4d3878679823a705a46f8f&v=4
url: https://github.com/tcsmith
@@ -128,6 +143,9 @@ sponsors:
- login: knallgelb
avatarUrl: https://avatars.githubusercontent.com/u/2358812?u=c48cb6362b309d74cbf144bd6ad3aed3eb443e82&v=4
url: https://github.com/knallgelb
+ - login: johannquerne
+ avatarUrl: https://avatars.githubusercontent.com/u/2736484?u=9b3381546a25679913a2b08110e4373c98840821&v=4
+ url: https://github.com/johannquerne
- login: Shark009
avatarUrl: https://avatars.githubusercontent.com/u/3163309?u=0c6f4091b0eda05c44c390466199826e6dc6e431&v=4
url: https://github.com/Shark009
@@ -147,7 +165,7 @@ sponsors:
avatarUrl: https://avatars.githubusercontent.com/u/3654837?v=4
url: https://github.com/anomaly
- login: jgreys
- avatarUrl: https://avatars.githubusercontent.com/u/4136890?u=c66ae617d614f6c886f1f1c1799d22100b3c848d&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/4136890?u=096820d1ef89877d57d0f68e669ead8b0fde84df&v=4
url: https://github.com/jgreys
- login: jaredtrog
avatarUrl: https://avatars.githubusercontent.com/u/4381365?v=4
@@ -212,42 +230,48 @@ sponsors:
- login: Filimoa
avatarUrl: https://avatars.githubusercontent.com/u/21352040?u=0be845711495bbd7b756e13fcaeb8efc1ebd78ba&v=4
url: https://github.com/Filimoa
+ - login: ehaca
+ avatarUrl: https://avatars.githubusercontent.com/u/25950317?u=cec1a3e0643b785288ae8260cc295a85ab344995&v=4
+ url: https://github.com/ehaca
+ - login: timlrx
+ avatarUrl: https://avatars.githubusercontent.com/u/28362229?u=9a745ca31372ee324af682715ae88ce8522f9094&v=4
+ url: https://github.com/timlrx
- login: BrettskiPy
avatarUrl: https://avatars.githubusercontent.com/u/30988215?u=d8a94a67e140d5ee5427724b292cc52d8827087a&v=4
url: https://github.com/BrettskiPy
- - login: mauroalejandrojm
- avatarUrl: https://avatars.githubusercontent.com/u/31569442?u=cdada990a1527926a36e95f62c30a8b48bbc49a1&v=4
- url: https://github.com/mauroalejandrojm
- login: Leay15
avatarUrl: https://avatars.githubusercontent.com/u/32212558?u=c4aa9c1737e515959382a5515381757b1fd86c53&v=4
url: https://github.com/Leay15
- - login: dvlpjrs
- avatarUrl: https://avatars.githubusercontent.com/u/32254642?u=fbd6ad0324d4f1eb6231cf775be1c7bd4404e961&v=4
- url: https://github.com/dvlpjrs
- login: ygorpontelo
avatarUrl: https://avatars.githubusercontent.com/u/32963605?u=35f7103f9c4c4c2589ae5737ee882e9375ef072e&v=4
url: https://github.com/ygorpontelo
- login: ProteinQure
avatarUrl: https://avatars.githubusercontent.com/u/33707203?v=4
url: https://github.com/ProteinQure
+ - login: RafaelWO
+ avatarUrl: https://avatars.githubusercontent.com/u/38643099?u=56c676f024667ee416dc8b1cdf0c2611b9dc994f&v=4
+ url: https://github.com/RafaelWO
- login: arleybri18
avatarUrl: https://avatars.githubusercontent.com/u/39681546?u=5c028f81324b0e8c73b3c15bc4e7b0218d2ba0c3&v=4
url: https://github.com/arleybri18
- login: thenickben
avatarUrl: https://avatars.githubusercontent.com/u/40610922?u=1e907d904041b7c91213951a3cb344cd37c14aaf&v=4
url: https://github.com/thenickben
- - login: adtalos
- avatarUrl: https://avatars.githubusercontent.com/u/40748353?v=4
- url: https://github.com/adtalos
- - login: ybressler
- avatarUrl: https://avatars.githubusercontent.com/u/40807730?u=41e2c00f1eebe3c402635f0325e41b4e6511462c&v=4
- url: https://github.com/ybressler
- login: ddilidili
avatarUrl: https://avatars.githubusercontent.com/u/42176885?u=c0a849dde06987434653197b5f638d3deb55fc6c&v=4
url: https://github.com/ddilidili
+ - login: ramonalmeidam
+ avatarUrl: https://avatars.githubusercontent.com/u/45269580?u=3358750b3a5854d7c3ed77aaca7dd20a0f529d32&v=4
+ url: https://github.com/ramonalmeidam
- login: dudikbender
avatarUrl: https://avatars.githubusercontent.com/u/53487583?u=3a57542938ebfd57579a0111db2b297e606d9681&v=4
url: https://github.com/dudikbender
+ - login: Amirshox
+ avatarUrl: https://avatars.githubusercontent.com/u/56707784?u=2a2f8cc243d6f5b29cd63fd2772f7a97aadc6c6b&v=4
+ url: https://github.com/Amirshox
+ - login: prodhype
+ avatarUrl: https://avatars.githubusercontent.com/u/60444672?u=3f278cff25ea37ead487d7861d4a984795de819e&v=4
+ url: https://github.com/prodhype
- login: yakkonaut
avatarUrl: https://avatars.githubusercontent.com/u/60633704?u=90a71fd631aa998ba4a96480788f017c9904e07b&v=4
url: https://github.com/yakkonaut
@@ -257,15 +281,18 @@ sponsors:
- login: anthonycepeda
avatarUrl: https://avatars.githubusercontent.com/u/72019805?u=4252c6b6dc5024af502a823a3ac5e7a03a69963f&v=4
url: https://github.com/anthonycepeda
+ - login: patricioperezv
+ avatarUrl: https://avatars.githubusercontent.com/u/73832292?u=5f471f156e19ee7920e62ae0f4a47b95580e61cf&v=4
+ url: https://github.com/patricioperezv
+ - login: kaoru0310
+ avatarUrl: https://avatars.githubusercontent.com/u/80977929?u=1b61d10142b490e56af932ddf08a390fae8ee94f&v=4
+ url: https://github.com/kaoru0310
- login: DelfinaCare
avatarUrl: https://avatars.githubusercontent.com/u/83734439?v=4
url: https://github.com/DelfinaCare
- login: osawa-koki
avatarUrl: https://avatars.githubusercontent.com/u/94336223?u=59c6fe6945bcbbaff87b2a794238671b060620d2&v=4
url: https://github.com/osawa-koki
- - login: pyt3h
- avatarUrl: https://avatars.githubusercontent.com/u/99658549?v=4
- url: https://github.com/pyt3h
- login: apitally
avatarUrl: https://avatars.githubusercontent.com/u/138365043?v=4
url: https://github.com/apitally
@@ -281,9 +308,6 @@ sponsors:
- login: bryanculbertson
avatarUrl: https://avatars.githubusercontent.com/u/144028?u=defda4f90e93429221cc667500944abde60ebe4a&v=4
url: https://github.com/bryanculbertson
- - login: yourkin
- avatarUrl: https://avatars.githubusercontent.com/u/178984?u=b43a7e5f8818f7d9083d3b110118d9c27d48a794&v=4
- url: https://github.com/yourkin
- login: slafs
avatarUrl: https://avatars.githubusercontent.com/u/210173?v=4
url: https://github.com/slafs
@@ -305,12 +329,12 @@ sponsors:
- login: browniebroke
avatarUrl: https://avatars.githubusercontent.com/u/861044?u=5abfca5588f3e906b31583d7ee62f6de4b68aa24&v=4
url: https://github.com/browniebroke
- - login: janfilips
- avatarUrl: https://avatars.githubusercontent.com/u/870699?u=80702ec63f14e675cd4cdcc6ce3821d2ed207fd7&v=4
- url: https://github.com/janfilips
- login: dodo5522
avatarUrl: https://avatars.githubusercontent.com/u/1362607?u=9bf1e0e520cccc547c046610c468ce6115bbcf9f&v=4
url: https://github.com/dodo5522
+ - login: miguelgr
+ avatarUrl: https://avatars.githubusercontent.com/u/1484589?u=54556072b8136efa12ae3b6902032ea2a39ace4b&v=4
+ url: https://github.com/miguelgr
- login: WillHogan
avatarUrl: https://avatars.githubusercontent.com/u/1661551?u=7036c064cf29781470573865264ec8e60b6b809f&v=4
url: https://github.com/WillHogan
@@ -326,15 +350,12 @@ sponsors:
- login: anthonycorletti
avatarUrl: https://avatars.githubusercontent.com/u/3477132?v=4
url: https://github.com/anthonycorletti
- - login: erhan
- avatarUrl: https://avatars.githubusercontent.com/u/3872888?u=cd9a20fcd33c5598d9d7797a78dedfc9148592f6&v=4
- url: https://github.com/erhan
- login: Alisa-lisa
avatarUrl: https://avatars.githubusercontent.com/u/4137964?u=e7e393504f554f4ff15863a1e01a5746863ef9ce&v=4
url: https://github.com/Alisa-lisa
- - login: piotrgredowski
- avatarUrl: https://avatars.githubusercontent.com/u/4294480?v=4
- url: https://github.com/piotrgredowski
+ - login: gowikel
+ avatarUrl: https://avatars.githubusercontent.com/u/4339072?u=0e325ffcc539c38f89d9aa876bd87f9ec06ce0ee&v=4
+ url: https://github.com/gowikel
- login: danielunderwood
avatarUrl: https://avatars.githubusercontent.com/u/4472301?v=4
url: https://github.com/danielunderwood
@@ -350,6 +371,9 @@ sponsors:
- login: Baghdady92
avatarUrl: https://avatars.githubusercontent.com/u/5708590?v=4
url: https://github.com/Baghdady92
+ - login: jakeecolution
+ avatarUrl: https://avatars.githubusercontent.com/u/5884696?u=4a7c7883fb064b593b50cb6697b54687e6f7aafe&v=4
+ url: https://github.com/jakeecolution
- login: KentShikama
avatarUrl: https://avatars.githubusercontent.com/u/6329898?u=8b236810db9b96333230430837e1f021f9246da1&v=4
url: https://github.com/KentShikama
@@ -369,7 +393,7 @@ sponsors:
avatarUrl: https://avatars.githubusercontent.com/u/8574425?u=aad2a9674273c9275fe414d99269b7418d144089&v=4
url: https://github.com/albertkun
- login: xncbf
- avatarUrl: https://avatars.githubusercontent.com/u/9462045?u=05cb2d7c797a02f666805ad4639d9582f31d432c&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/9462045?u=ee91e210ae93b9cdd8f248b21cb028316cc0b747&v=4
url: https://github.com/xncbf
- login: DMantis
avatarUrl: https://avatars.githubusercontent.com/u/9536869?v=4
@@ -389,27 +413,42 @@ sponsors:
- login: pheanex
avatarUrl: https://avatars.githubusercontent.com/u/10408624?u=5b6bab6ee174aa6e991333e06eb29f628741013d&v=4
url: https://github.com/pheanex
+ - login: dzoladz
+ avatarUrl: https://avatars.githubusercontent.com/u/10561752?u=5ee314d54aa79592c18566827ad8914debd5630d&v=4
+ url: https://github.com/dzoladz
- login: JimFawkes
avatarUrl: https://avatars.githubusercontent.com/u/12075115?u=dc58ecfd064d72887c34bf500ddfd52592509acd&v=4
url: https://github.com/JimFawkes
+ - login: artempronevskiy
+ avatarUrl: https://avatars.githubusercontent.com/u/12235104?u=03df6e1e55c9c6fe5d230adabb8dd7d43d8bbe8f&v=4
+ url: https://github.com/artempronevskiy
- login: giuliano-oliveira
avatarUrl: https://avatars.githubusercontent.com/u/13181797?u=0ef2dfbf7fc9a9726d45c21d32b5d1038a174870&v=4
url: https://github.com/giuliano-oliveira
- login: TheR1D
avatarUrl: https://avatars.githubusercontent.com/u/16740832?u=b0dfdbdb27b79729430c71c6128962f77b7b53f7&v=4
url: https://github.com/TheR1D
+ - login: joshuatz
+ avatarUrl: https://avatars.githubusercontent.com/u/17817563?u=f1bf05b690d1fc164218f0b420cdd3acb7913e21&v=4
+ url: https://github.com/joshuatz
- login: jangia
avatarUrl: https://avatars.githubusercontent.com/u/17927101?u=9261b9bb0c3e3bb1ecba43e8915dc58d8c9a077e&v=4
url: https://github.com/jangia
- login: shuheng-liu
avatarUrl: https://avatars.githubusercontent.com/u/22414322?u=813c45f30786c6b511b21a661def025d8f7b609e&v=4
url: https://github.com/shuheng-liu
+ - login: salahelfarissi
+ avatarUrl: https://avatars.githubusercontent.com/u/23387408?u=73222a4be627c1a3dee9736e0da22224eccdc8f6&v=4
+ url: https://github.com/salahelfarissi
- login: pers0n4
avatarUrl: https://avatars.githubusercontent.com/u/24864600?u=f211a13a7b572cbbd7779b9c8d8cb428cc7ba07e&v=4
url: https://github.com/pers0n4
- login: kxzk
avatarUrl: https://avatars.githubusercontent.com/u/25046261?u=e185e58080090f9e678192cd214a14b14a2b232b&v=4
url: https://github.com/kxzk
+ - login: SebTota
+ avatarUrl: https://avatars.githubusercontent.com/u/25122511?v=4
+ url: https://github.com/SebTota
- login: nisutec
avatarUrl: https://avatars.githubusercontent.com/u/25281462?u=e562484c451fdfc59053163f64405f8eb262b8b0&v=4
url: https://github.com/nisutec
@@ -422,9 +461,6 @@ sponsors:
- login: rlnchow
avatarUrl: https://avatars.githubusercontent.com/u/28018479?u=a93ca9cf1422b9ece155784a72d5f2fdbce7adff&v=4
url: https://github.com/rlnchow
- - login: mertguvencli
- avatarUrl: https://avatars.githubusercontent.com/u/29762151?u=16a906d90df96c8cff9ea131a575c4bc171b1523&v=4
- url: https://github.com/mertguvencli
- login: White-Mask
avatarUrl: https://avatars.githubusercontent.com/u/31826970?u=8625355dc25ddf9c85a8b2b0b9932826c4c8f44c&v=4
url: https://github.com/White-Mask
@@ -435,14 +471,11 @@ sponsors:
avatarUrl: https://avatars.githubusercontent.com/u/33275230?u=eb223cad27017bb1e936ee9b429b450d092d0236&v=4
url: https://github.com/engineerjoe440
- login: bnkc
- avatarUrl: https://avatars.githubusercontent.com/u/34930566?u=ea88e4bd668c984cff1bca3e71ab2deb37fafdc4&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/34930566?u=fa1dc8db3e920cf5c5636b97180a6f811fa01aaf&v=4
url: https://github.com/bnkc
- login: declon
avatarUrl: https://avatars.githubusercontent.com/u/36180226?v=4
url: https://github.com/declon
- - login: DSMilestone6538
- avatarUrl: https://avatars.githubusercontent.com/u/37230924?u=f299dce910366471523155e0cb213356d34aadc1&v=4
- url: https://github.com/DSMilestone6538
- login: curegit
avatarUrl: https://avatars.githubusercontent.com/u/37978051?u=1733c322079118c0cdc573c03d92813f50a9faec&v=4
url: https://github.com/curegit
@@ -458,12 +491,12 @@ sponsors:
- login: hgalytoby
avatarUrl: https://avatars.githubusercontent.com/u/50397689?u=f4888c2c54929bd86eed0d3971d09fcb306e5088&v=4
url: https://github.com/hgalytoby
- - login: eladgunders
- avatarUrl: https://avatars.githubusercontent.com/u/52347338?u=83d454817cf991a035c8827d46ade050c813e2d6&v=4
- url: https://github.com/eladgunders
- login: conservative-dude
avatarUrl: https://avatars.githubusercontent.com/u/55538308?u=f250c44942ea6e73a6bd90739b381c470c192c11&v=4
url: https://github.com/conservative-dude
+ - login: Calesi19
+ avatarUrl: https://avatars.githubusercontent.com/u/58052598?u=273d4fc364c004602c93dd6adeaf5cc915b93cd2&v=4
+ url: https://github.com/Calesi19
- login: 0417taehyun
avatarUrl: https://avatars.githubusercontent.com/u/63915557?u=47debaa860fd52c9b98c97ef357ddcec3b3fb399&v=4
url: https://github.com/0417taehyun
@@ -476,30 +509,30 @@ sponsors:
- login: mbukeRepo
avatarUrl: https://avatars.githubusercontent.com/u/70356088?u=d2eb23e2b222a3b316c4183b05a3236b32819dc2&v=4
url: https://github.com/mbukeRepo
+ - login: adriiamontoto
+ avatarUrl: https://avatars.githubusercontent.com/u/75563346?u=eeb1350b82ecb4d96592f9b6cd1a16870c355e38&v=4
+ url: https://github.com/adriiamontoto
- login: PelicanQ
avatarUrl: https://avatars.githubusercontent.com/u/77930606?v=4
url: https://github.com/PelicanQ
+ - login: tahmarrrr23
+ avatarUrl: https://avatars.githubusercontent.com/u/138208610?u=465a46b0ff72a74252d3e3a71ac7d2f1919cda28&v=4
+ url: https://github.com/tahmarrrr23
- - login: ssbarnea
avatarUrl: https://avatars.githubusercontent.com/u/102495?u=b4bf6818deefe59952ac22fec6ed8c76de1b8f7c&v=4
url: https://github.com/ssbarnea
- login: Patechoc
avatarUrl: https://avatars.githubusercontent.com/u/2376641?u=23b49e9eda04f078cb74fa3f93593aa6a57bb138&v=4
url: https://github.com/Patechoc
- - login: LanceMoe
- avatarUrl: https://avatars.githubusercontent.com/u/18505474?u=7fd3ead4364bdf215b6d75cb122b3811c391ef6b&v=4
- url: https://github.com/LanceMoe
+ - login: DazzyMlv
+ avatarUrl: https://avatars.githubusercontent.com/u/23006212?u=df429da52882b0432e5ac81d4f1b489abc86433c&v=4
+ url: https://github.com/DazzyMlv
- login: sadikkuzu
avatarUrl: https://avatars.githubusercontent.com/u/23168063?u=d179c06bb9f65c4167fcab118526819f8e0dac17&v=4
url: https://github.com/sadikkuzu
- - login: msniezynski
- avatarUrl: https://avatars.githubusercontent.com/u/27588547?u=0e3be5ac57dcfdf124f470bcdf74b5bf79af1b6c&v=4
- url: https://github.com/msniezynski
- login: danburonline
- avatarUrl: https://avatars.githubusercontent.com/u/34251194?u=2cad4388c1544e539ecb732d656e42fb07b4ff2d&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/34251194?u=94935cccfbec58083ab1e535212d54f1bf2c978a&v=4
url: https://github.com/danburonline
- login: rwxd
avatarUrl: https://avatars.githubusercontent.com/u/40308458?u=cd04a39e3655923be4f25c2ba8a5a07b3da3230a&v=4
url: https://github.com/rwxd
- - login: IvanReyesO7
- avatarUrl: https://avatars.githubusercontent.com/u/74359151?u=4b2c368f71e1411b462a8c2290c920ad35dc1af8&v=4
- url: https://github.com/IvanReyesO7
diff --git a/docs/en/data/people.yml b/docs/en/data/people.yml
index 2e84f11285cbc..2877e7938c2ca 100644
--- a/docs/en/data/people.yml
+++ b/docs/en/data/people.yml
@@ -1,16 +1,16 @@
maintainers:
- login: tiangolo
answers: 1870
- prs: 508
+ prs: 523
avatarUrl: https://avatars.githubusercontent.com/u/1326112?u=740f11212a731f56798f558ceddb0bd07642afa7&v=4
url: https://github.com/tiangolo
experts:
- login: Kludex
- count: 512
+ count: 522
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
- login: dmontagu
- count: 240
+ count: 241
avatarUrl: https://avatars.githubusercontent.com/u/35119617?u=540f30c937a6450812628b9592a1dfe91bbe148e&v=4
url: https://github.com/dmontagu
- login: Mause
@@ -21,20 +21,20 @@ experts:
count: 217
avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=bba5af018423a2858d49309bed2a899bb5c34ac5&v=4
url: https://github.com/ycd
+- login: jgould22
+ count: 205
+ avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
+ url: https://github.com/jgould22
- login: JarroVGIT
count: 193
avatarUrl: https://avatars.githubusercontent.com/u/13659033?u=e8bea32d07a5ef72f7dde3b2079ceb714923ca05&v=4
url: https://github.com/JarroVGIT
-- login: jgould22
- count: 186
- avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
- url: https://github.com/jgould22
- login: euri10
count: 153
avatarUrl: https://avatars.githubusercontent.com/u/1104190?u=321a2e953e6645a7d09b732786c7a8061e0f8a8b&v=4
url: https://github.com/euri10
- login: iudeen
- count: 126
+ count: 127
avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4
url: https://github.com/iudeen
- login: phy25
@@ -62,9 +62,17 @@ experts:
avatarUrl: https://avatars.githubusercontent.com/u/516999?u=437c0c5038558c67e887ccd863c1ba0f846c03da&v=4
url: https://github.com/sm-Fifteen
- login: yinziyan1206
- count: 45
+ count: 48
avatarUrl: https://avatars.githubusercontent.com/u/37829370?u=da44ca53aefd5c23f346fab8e9fd2e108294c179&v=4
url: https://github.com/yinziyan1206
+- login: insomnes
+ count: 45
+ avatarUrl: https://avatars.githubusercontent.com/u/16958893?u=f8be7088d5076d963984a21f95f44e559192d912&v=4
+ url: https://github.com/insomnes
+- login: adriangb
+ count: 45
+ avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=612704256e38d6ac9cbed24f10e4b6ac2da74ecb&v=4
+ url: https://github.com/adriangb
- login: acidjunk
count: 45
avatarUrl: https://avatars.githubusercontent.com/u/685002?u=b5094ab4527fc84b006c0ac9ff54367bdebb2267&v=4
@@ -73,26 +81,22 @@ experts:
count: 45
avatarUrl: https://avatars.githubusercontent.com/u/27180793?u=5cf2877f50b3eb2bc55086089a78a36f07042889&v=4
url: https://github.com/Dustyposa
-- login: adriangb
- count: 45
- avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=612704256e38d6ac9cbed24f10e4b6ac2da74ecb&v=4
- url: https://github.com/adriangb
-- login: insomnes
- count: 45
- avatarUrl: https://avatars.githubusercontent.com/u/16958893?u=f8be7088d5076d963984a21f95f44e559192d912&v=4
- url: https://github.com/insomnes
-- login: frankie567
- count: 43
- avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=c159fe047727aedecbbeeaa96a1b03ceb9d39add&v=4
- url: https://github.com/frankie567
- login: odiseo0
count: 43
avatarUrl: https://avatars.githubusercontent.com/u/87550035?u=241a71f6b7068738b81af3e57f45ffd723538401&v=4
url: https://github.com/odiseo0
+- login: frankie567
+ count: 43
+ avatarUrl: https://avatars.githubusercontent.com/u/1144727?u=c159fe047727aedecbbeeaa96a1b03ceb9d39add&v=4
+ url: https://github.com/frankie567
- login: includeamin
count: 40
avatarUrl: https://avatars.githubusercontent.com/u/11836741?u=8bd5ef7e62fe6a82055e33c4c0e0a7879ff8cfb6&v=4
url: https://github.com/includeamin
+- login: n8sty
+ count: 40
+ avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
+ url: https://github.com/n8sty
- login: chbndrhnns
count: 38
avatarUrl: https://avatars.githubusercontent.com/u/7534547?v=4
@@ -101,10 +105,6 @@ experts:
count: 37
avatarUrl: https://avatars.githubusercontent.com/u/5167622?u=de8f597c81d6336fcebc37b32dfd61a3f877160c&v=4
url: https://github.com/STeveShary
-- login: n8sty
- count: 36
- avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
- url: https://github.com/n8sty
- login: krishnardt
count: 35
avatarUrl: https://avatars.githubusercontent.com/u/31960541?u=47f4829c77f4962ab437ffb7995951e41eeebe9b&v=4
@@ -113,6 +113,10 @@ experts:
count: 32
avatarUrl: https://avatars.githubusercontent.com/u/41326348?u=ba2fda6b30110411ecbf406d187907e2b420ac19&v=4
url: https://github.com/panla
+- login: JavierSanchezCastro
+ count: 30
+ avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
+ url: https://github.com/JavierSanchezCastro
- login: prostomarkeloff
count: 28
avatarUrl: https://avatars.githubusercontent.com/u/28061158?u=72309cc1f2e04e40fa38b29969cb4e9d3f722e7b&v=4
@@ -125,50 +129,46 @@ experts:
count: 25
avatarUrl: https://avatars.githubusercontent.com/u/365303?u=07ca03c5ee811eb0920e633cc3c3db73dbec1aa5&v=4
url: https://github.com/wshayes
-- login: SirTelemak
- count: 23
- avatarUrl: https://avatars.githubusercontent.com/u/9435877?u=719327b7d2c4c62212456d771bfa7c6b8dbb9eac&v=4
- url: https://github.com/SirTelemak
- login: acnebs
count: 23
avatarUrl: https://avatars.githubusercontent.com/u/9054108?v=4
url: https://github.com/acnebs
+- login: SirTelemak
+ count: 23
+ avatarUrl: https://avatars.githubusercontent.com/u/9435877?u=719327b7d2c4c62212456d771bfa7c6b8dbb9eac&v=4
+ url: https://github.com/SirTelemak
- login: rafsaf
count: 21
avatarUrl: https://avatars.githubusercontent.com/u/51059348?u=5fe59a56e1f2f9ccd8005d71752a8276f133ae1a&v=4
url: https://github.com/rafsaf
-- login: chris-allnutt
- count: 20
- avatarUrl: https://avatars.githubusercontent.com/u/565544?v=4
- url: https://github.com/chris-allnutt
-- login: ebottos94
+- login: nymous
count: 20
- avatarUrl: https://avatars.githubusercontent.com/u/100039558?u=e2c672da5a7977fd24d87ce6ab35f8bf5b1ed9fa&v=4
- url: https://github.com/ebottos94
+ avatarUrl: https://avatars.githubusercontent.com/u/4216559?u=360a36fb602cded27273cbfc0afc296eece90662&v=4
+ url: https://github.com/nymous
- login: nsidnev
count: 20
avatarUrl: https://avatars.githubusercontent.com/u/22559461?u=a9cc3238217e21dc8796a1a500f01b722adb082c&v=4
url: https://github.com/nsidnev
-- login: JavierSanchezCastro
+- login: chris-allnutt
count: 20
- avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
- url: https://github.com/JavierSanchezCastro
+ avatarUrl: https://avatars.githubusercontent.com/u/565544?v=4
+ url: https://github.com/chris-allnutt
- login: chrisK824
- count: 19
+ count: 20
avatarUrl: https://avatars.githubusercontent.com/u/79946379?u=03d85b22d696a58a9603e55fbbbe2de6b0f4face&v=4
url: https://github.com/chrisK824
-- login: zoliknemet
- count: 18
- avatarUrl: https://avatars.githubusercontent.com/u/22326718?u=31ba446ac290e23e56eea8e4f0c558aaf0b40779&v=4
- url: https://github.com/zoliknemet
+- login: ebottos94
+ count: 20
+ avatarUrl: https://avatars.githubusercontent.com/u/100039558?u=e2c672da5a7977fd24d87ce6ab35f8bf5b1ed9fa&v=4
+ url: https://github.com/ebottos94
- login: retnikt
count: 18
avatarUrl: https://avatars.githubusercontent.com/u/24581770?v=4
url: https://github.com/retnikt
-- login: nymous
- count: 17
- avatarUrl: https://avatars.githubusercontent.com/u/4216559?u=360a36fb602cded27273cbfc0afc296eece90662&v=4
- url: https://github.com/nymous
+- login: zoliknemet
+ count: 18
+ avatarUrl: https://avatars.githubusercontent.com/u/22326718?u=31ba446ac290e23e56eea8e4f0c558aaf0b40779&v=4
+ url: https://github.com/zoliknemet
- login: Hultner
count: 17
avatarUrl: https://avatars.githubusercontent.com/u/2669034?u=115e53df959309898ad8dc9443fbb35fee71df07&v=4
@@ -193,39 +193,31 @@ experts:
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/26334101?u=071c062d2861d3dd127f6b4a5258cd8ef55d4c50&v=4
url: https://github.com/jonatasoli
-- login: abhint
+- login: ghost
count: 15
- avatarUrl: https://avatars.githubusercontent.com/u/25699289?u=b5d219277b4d001ac26fb8be357fddd88c29d51b&v=4
- url: https://github.com/abhint
+ avatarUrl: https://avatars.githubusercontent.com/u/10137?u=b1951d34a583cf12ec0d3b0781ba19be97726318&v=4
+ url: https://github.com/ghost
last_month_active:
+- login: Ventura94
+ count: 5
+ avatarUrl: https://avatars.githubusercontent.com/u/43103937?u=ccb837005aaf212a449c374618c4339089e2f733&v=4
+ url: https://github.com/Ventura94
+- login: JavierSanchezCastro
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/72013291?u=ae5679e6bd971d9d98cd5e76e8683f83642ba950&v=4
+ url: https://github.com/JavierSanchezCastro
- login: jgould22
- count: 18
+ count: 3
avatarUrl: https://avatars.githubusercontent.com/u/4335847?u=ed77f67e0bb069084639b24d812dbb2a2b1dc554&v=4
url: https://github.com/jgould22
- login: Kludex
- count: 10
+ count: 3
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
-- login: White-Mask
- count: 5
- avatarUrl: https://avatars.githubusercontent.com/u/31826970?u=8625355dc25ddf9c85a8b2b0b9932826c4c8f44c&v=4
- url: https://github.com/White-Mask
- login: n8sty
- count: 4
+ count: 3
avatarUrl: https://avatars.githubusercontent.com/u/2964996?v=4
url: https://github.com/n8sty
-- login: hasansezertasan
- count: 4
- avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=e389634d494d503cca867f76c2d00cacc273a46e&v=4
- url: https://github.com/hasansezertasan
-- login: pythonweb2
- count: 3
- avatarUrl: https://avatars.githubusercontent.com/u/32141163?v=4
- url: https://github.com/pythonweb2
-- login: ebottos94
- count: 3
- avatarUrl: https://avatars.githubusercontent.com/u/100039558?u=e2c672da5a7977fd24d87ce6ab35f8bf5b1ed9fa&v=4
- url: https://github.com/ebottos94
top_contributors:
- login: waynerv
count: 25
@@ -343,6 +335,10 @@ top_contributors:
count: 4
avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4
url: https://github.com/lsglucas
+- login: adriangb
+ count: 4
+ avatarUrl: https://avatars.githubusercontent.com/u/1755071?u=612704256e38d6ac9cbed24f10e4b6ac2da74ecb&v=4
+ url: https://github.com/adriangb
- login: iudeen
count: 4
avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4
@@ -365,21 +361,25 @@ top_reviewers:
avatarUrl: https://avatars.githubusercontent.com/u/7353520?u=62adc405ef418f4b6c8caa93d3eb8ab107bc4927&v=4
url: https://github.com/Kludex
- login: BilalAlpaslan
- count: 82
+ count: 86
avatarUrl: https://avatars.githubusercontent.com/u/47563997?u=63ed66e304fe8d765762c70587d61d9196e5c82d&v=4
url: https://github.com/BilalAlpaslan
- login: yezz123
- count: 80
+ count: 82
avatarUrl: https://avatars.githubusercontent.com/u/52716203?u=d7062cbc6eb7671d5dc9cc0e32a24ae335e0f225&v=4
url: https://github.com/yezz123
- login: iudeen
- count: 54
+ count: 55
avatarUrl: https://avatars.githubusercontent.com/u/10519440?u=2843b3303282bff8b212dcd4d9d6689452e4470c&v=4
url: https://github.com/iudeen
- login: tokusumi
count: 51
avatarUrl: https://avatars.githubusercontent.com/u/41147016?u=55010621aece725aa702270b54fed829b6a1fe60&v=4
url: https://github.com/tokusumi
+- login: Xewus
+ count: 50
+ avatarUrl: https://avatars.githubusercontent.com/u/85196001?u=f8e2dc7e5104f109cef944af79050ea8d1b8f914&v=4
+ url: https://github.com/Xewus
- login: waynerv
count: 47
avatarUrl: https://avatars.githubusercontent.com/u/39515546?u=ec35139777597cdbbbddda29bf8b9d4396b429a9&v=4
@@ -388,10 +388,6 @@ top_reviewers:
count: 47
avatarUrl: https://avatars.githubusercontent.com/u/59285379?v=4
url: https://github.com/Laineyzhang55
-- login: Xewus
- count: 47
- avatarUrl: https://avatars.githubusercontent.com/u/85196001?u=f8e2dc7e5104f109cef944af79050ea8d1b8f914&v=4
- url: https://github.com/Xewus
- login: ycd
count: 45
avatarUrl: https://avatars.githubusercontent.com/u/62724709?u=bba5af018423a2858d49309bed2a899bb5c34ac5&v=4
@@ -416,17 +412,17 @@ top_reviewers:
count: 28
avatarUrl: https://avatars.githubusercontent.com/u/3127847?u=b0a652331da17efeb85cd6e3a4969182e5004804&v=4
url: https://github.com/cassiobotaro
+- login: lsglucas
+ count: 27
+ avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4
+ url: https://github.com/lsglucas
- login: komtaki
count: 27
avatarUrl: https://avatars.githubusercontent.com/u/39375566?u=260ad6b1a4b34c07dbfa728da5e586f16f6d1824&v=4
url: https://github.com/komtaki
-- login: lsglucas
- count: 26
- avatarUrl: https://avatars.githubusercontent.com/u/61513630?u=320e43fe4dc7bc6efc64e9b8f325f8075634fd20&v=4
- url: https://github.com/lsglucas
- login: Ryandaydev
count: 25
- avatarUrl: https://avatars.githubusercontent.com/u/4292423?u=ba0eea19429e7cf77cf2ab8ad2f3d3af202bc1cf&v=4
+ avatarUrl: https://avatars.githubusercontent.com/u/4292423?u=48f68868db8886fce31a1d802c1003914c6cd7c6&v=4
url: https://github.com/Ryandaydev
- login: LorhanSohaky
count: 24
@@ -460,6 +456,10 @@ top_reviewers:
count: 17
avatarUrl: https://avatars.githubusercontent.com/u/67154681?u=5d634834cc514028ea3f9115f7030b99a1f4d5a4&v=4
url: https://github.com/zy7y
+- login: peidrao
+ count: 17
+ avatarUrl: https://avatars.githubusercontent.com/u/32584628?u=a66902b40c13647d0ed0e573d598128240a4dd04&v=4
+ url: https://github.com/peidrao
- login: yanever
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/21978760?v=4
@@ -468,6 +468,10 @@ top_reviewers:
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/52768429?u=6a3aa15277406520ad37f6236e89466ed44bc5b8&v=4
url: https://github.com/SwftAlpc
+- login: nilslindemann
+ count: 16
+ avatarUrl: https://avatars.githubusercontent.com/u/6892179?u=1dca6a22195d6cd1ab20737c0e19a4c55d639472&v=4
+ url: https://github.com/nilslindemann
- login: axel584
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/1334088?u=9667041f5b15dc002b6f9665fda8c0412933ac04&v=4
@@ -480,6 +484,10 @@ top_reviewers:
count: 16
avatarUrl: https://avatars.githubusercontent.com/u/87962045?u=08e10fa516e844934f4b3fc7c38b33c61697e4a1&v=4
url: https://github.com/DevDae
+- login: hasansezertasan
+ count: 16
+ avatarUrl: https://avatars.githubusercontent.com/u/13135006?u=99f0b0f0fc47e88e8abb337b4447357939ef93e7&v=4
+ url: https://github.com/hasansezertasan
- login: pedabraham
count: 15
avatarUrl: https://avatars.githubusercontent.com/u/16860088?u=abf922a7b920bf8fdb7867d8b43e091f1e796178&v=4
@@ -488,10 +496,6 @@ top_reviewers:
count: 15
avatarUrl: https://avatars.githubusercontent.com/u/63476957?u=6c86e59b48e0394d4db230f37fc9ad4d7e2c27c7&v=4
url: https://github.com/delhi09
-- login: peidrao
- count: 14
- avatarUrl: https://avatars.githubusercontent.com/u/32584628?u=a66902b40c13647d0ed0e573d598128240a4dd04&v=4
- url: https://github.com/peidrao
- login: sh0nk
count: 13
avatarUrl: https://avatars.githubusercontent.com/u/6478810?u=af15d724875cec682ed8088a86d36b2798f981c0&v=4
@@ -536,6 +540,10 @@ top_reviewers:
count: 10
avatarUrl: https://avatars.githubusercontent.com/u/43503750?u=f440bc9062afb3c43b9b9c6cdfdcfe31d58699ef&v=4
url: https://github.com/ComicShrimp
+- login: romashevchenko
+ count: 9
+ avatarUrl: https://avatars.githubusercontent.com/u/132477732?v=4
+ url: https://github.com/romashevchenko
- login: izaguerreiro
count: 9
avatarUrl: https://avatars.githubusercontent.com/u/2241504?v=4
@@ -544,15 +552,3 @@ top_reviewers:
count: 9
avatarUrl: https://avatars.githubusercontent.com/u/413772?u=64b77b6aa405c68a9c6bcf45f84257c66eea5f32&v=4
url: https://github.com/graingert
-- login: PandaHun
- count: 9
- avatarUrl: https://avatars.githubusercontent.com/u/13096845?u=646eba44db720e37d0dbe8e98e77ab534ea78a20&v=4
- url: https://github.com/PandaHun
-- login: kty4119
- count: 9
- avatarUrl: https://avatars.githubusercontent.com/u/49435654?v=4
- url: https://github.com/kty4119
-- login: bezaca
- count: 9
- avatarUrl: https://avatars.githubusercontent.com/u/69092910?u=4ac58eab99bd37d663f3d23551df96d4fbdbf760&v=4
- url: https://github.com/bezaca
From f43fc82267f35586b2868ebdd2caf7859b964914 Mon Sep 17 00:00:00 2001
From: s111d
Date: Tue, 9 Jan 2024 21:22:46 +0300
Subject: [PATCH 100/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typos=20in?=
=?UTF-8?q?=20`docs/en/docs/alternatives.md`=20and=20`docs/en/docs/tutoria?=
=?UTF-8?q?l/dependencies/index.md`=20(#10906)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/en/docs/alternatives.md | 6 +++---
docs/en/docs/tutorial/dependencies/index.md | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/docs/en/docs/alternatives.md b/docs/en/docs/alternatives.md
index 0f074ccf32dcc..e02b3b55a113b 100644
--- a/docs/en/docs/alternatives.md
+++ b/docs/en/docs/alternatives.md
@@ -185,7 +185,7 @@ It's a Flask plug-in, that ties together Webargs, Marshmallow and APISpec.
It uses the information from Webargs and Marshmallow to automatically generate OpenAPI schemas, using APISpec.
-It's a great tool, very under-rated. It should be way more popular than many Flask plug-ins out there. It might be due to its documentation being too concise and abstract.
+It's a great tool, very underrated. It should be way more popular than many Flask plug-ins out there. It might be due to its documentation being too concise and abstract.
This solved having to write YAML (another syntax) inside of Python docstrings.
@@ -263,7 +263,7 @@ I discovered Molten in the first stages of building **FastAPI**. And it has quit
It doesn't use a data validation, serialization and documentation third-party library like Pydantic, it has its own. So, these data type definitions would not be reusable as easily.
-It requires a little bit more verbose configurations. And as it is based on WSGI (instead of ASGI), it is not designed to take advantage of the high-performance provided by tools like Uvicorn, Starlette and Sanic.
+It requires a little bit more verbose configurations. And as it is based on WSGI (instead of ASGI), it is not designed to take advantage of the high performance provided by tools like Uvicorn, Starlette and Sanic.
The dependency injection system requires pre-registration of the dependencies and the dependencies are solved based on the declared types. So, it's not possible to declare more than one "component" that provides a certain type.
@@ -357,7 +357,7 @@ It is comparable to Marshmallow. Although it's faster than Marshmallow in benchm
### Starlette
-Starlette is a lightweight ASGI framework/toolkit, which is ideal for building high-performance asyncio services.
+Starlette is a lightweight ASGI framework/toolkit, which is ideal for building high-performance asyncio services.
It is very simple and intuitive. It's designed to be easily extensible, and have modular components.
diff --git a/docs/en/docs/tutorial/dependencies/index.md b/docs/en/docs/tutorial/dependencies/index.md
index bc98cb26edc54..608ced407ea49 100644
--- a/docs/en/docs/tutorial/dependencies/index.md
+++ b/docs/en/docs/tutorial/dependencies/index.md
@@ -287,9 +287,9 @@ Other common terms for this same idea of "dependency injection" are:
## **FastAPI** plug-ins
-Integrations and "plug-in"s can be built using the **Dependency Injection** system. But in fact, there is actually **no need to create "plug-ins"**, as by using dependencies it's possible to declare an infinite number of integrations and interactions that become available to your *path operation functions*.
+Integrations and "plug-ins" can be built using the **Dependency Injection** system. But in fact, there is actually **no need to create "plug-ins"**, as by using dependencies it's possible to declare an infinite number of integrations and interactions that become available to your *path operation functions*.
-And dependencies can be created in a very simple and intuitive way that allow you to just import the Python packages you need, and integrate them with your API functions in a couple of lines of code, *literally*.
+And dependencies can be created in a very simple and intuitive way that allows you to just import the Python packages you need, and integrate them with your API functions in a couple of lines of code, *literally*.
You will see examples of this in the next chapters, about relational and NoSQL databases, security, etc.
From aa6586d51a7868a08b2971ee14957d6db7f47d2e Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 18:24:21 +0000
Subject: [PATCH 101/217] =?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 cf686b02a5be5..59de429abc640 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -22,6 +22,7 @@ hide:
### Translations
+* âïž Update Python version in `index.md` in several languages. PR [#10711](https://github.com/tiangolo/fastapi/pull/10711) by [@tamago3keran](https://github.com/tamago3keran).
* ð Add Russian translation for `docs/ru/docs/tutorial/request-forms-and-files.md`. PR [#10347](https://github.com/tiangolo/fastapi/pull/10347) by [@AlertRED](https://github.com/AlertRED).
* ð Add Ukrainian translation for `docs/uk/docs/index.md`. PR [#10362](https://github.com/tiangolo/fastapi/pull/10362) by [@rostik1410](https://github.com/rostik1410).
* âïž Update Python version in `docs/ko/docs/index.md`. PR [#10680](https://github.com/tiangolo/fastapi/pull/10680) by [@Eeap](https://github.com/Eeap).
From dd6cf5d71091f15b4cef40fe23f7f7d7344d6f93 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 18:32:18 +0000
Subject: [PATCH 102/217] =?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 59de429abc640..bb7c722ea389c 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* âïž Fix typos in `docs/en/docs/tutorial/dependencies/dependencies-with-yield.md`. PR [#10834](https://github.com/tiangolo/fastapi/pull/10834) by [@Molkree](https://github.com/Molkree).
* ð Add article: "Building a RESTful API with FastAPI: Secure Signup and Login Functionality Included". PR [#9733](https://github.com/tiangolo/fastapi/pull/9733) by [@dxphilo](https://github.com/dxphilo).
* ð Add warning about lifecycle events with `AsyncClient`. PR [#4167](https://github.com/tiangolo/fastapi/pull/4167) by [@andrew-chang-dewitt](https://github.com/andrew-chang-dewitt).
* âïž Fix typos in `/docs/reference/exceptions.md` and `/en/docs/reference/status.md`. PR [#10809](https://github.com/tiangolo/fastapi/pull/10809) by [@clarencepenz](https://github.com/clarencepenz).
From f73be1d59984f5af8330655de44f8305ed0ec784 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 18:33:22 +0000
Subject: [PATCH 103/217] =?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 bb7c722ea389c..d350124fcea7f 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -52,6 +52,7 @@ hide:
### Internal
+* ð¥ Update FastAPI People. PR [#10871](https://github.com/tiangolo/fastapi/pull/10871) by [@tiangolo](https://github.com/tiangolo).
* ð· Upgrade custom GitHub Action comment-docs-preview-in-pr. PR [#10916](https://github.com/tiangolo/fastapi/pull/10916) by [@tiangolo](https://github.com/tiangolo).
* â¬ïž Upgrade GitHub Action latest-changes. PR [#10915](https://github.com/tiangolo/fastapi/pull/10915) by [@tiangolo](https://github.com/tiangolo).
* ð· Upgrade GitHub Action label-approved. PR [#10913](https://github.com/tiangolo/fastapi/pull/10913) by [@tiangolo](https://github.com/tiangolo).
From 3b9a2bcb1b0b3ec234cf70adeb551d5655f774e9 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 18:35:49 +0000
Subject: [PATCH 104/217] =?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 d350124fcea7f..c7787053e9580 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* âïž Fix typos in `docs/en/docs/alternatives.md` and `docs/en/docs/tutorial/dependencies/index.md`. PR [#10906](https://github.com/tiangolo/fastapi/pull/10906) by [@s111d](https://github.com/s111d).
* âïž Fix typos in `docs/en/docs/tutorial/dependencies/dependencies-with-yield.md`. PR [#10834](https://github.com/tiangolo/fastapi/pull/10834) by [@Molkree](https://github.com/Molkree).
* ð Add article: "Building a RESTful API with FastAPI: Secure Signup and Login Functionality Included". PR [#9733](https://github.com/tiangolo/fastapi/pull/9733) by [@dxphilo](https://github.com/dxphilo).
* ð Add warning about lifecycle events with `AsyncClient`. PR [#4167](https://github.com/tiangolo/fastapi/pull/4167) by [@andrew-chang-dewitt](https://github.com/andrew-chang-dewitt).
From 7eeacc9958565dc7f2279c206d0be0e5364dd99d Mon Sep 17 00:00:00 2001
From: Craig Blaszczyk
Date: Tue, 9 Jan 2024 20:37:09 +0000
Subject: [PATCH 105/217] =?UTF-8?q?=E2=9C=A8=20Generate=20automatic=20lang?=
=?UTF-8?q?uage=20names=20for=20docs=20translations=20(#5354)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Craig Blaszczyk
Co-authored-by: Sebastián RamÃrez
---
docs/en/mkdocs.yml | 29 ++++---
docs/language_names.yml | 182 ++++++++++++++++++++++++++++++++++++++++
scripts/docs.py | 26 +++---
3 files changed, 213 insertions(+), 24 deletions(-)
create mode 100644 docs/language_names.yml
diff --git a/docs/en/mkdocs.yml b/docs/en/mkdocs.yml
index a64eff26969aa..92d081aa12333 100644
--- a/docs/en/mkdocs.yml
+++ b/docs/en/mkdocs.yml
@@ -58,15 +58,18 @@ plugins:
python:
options:
extensions:
- - griffe_typingdoc
+ - griffe_typingdoc
show_root_heading: true
show_if_no_docstring: true
- preload_modules: [httpx, starlette]
+ preload_modules:
+ - httpx
+ - starlette
inherited_members: true
members_order: source
separate_signature: true
unwrap_annotated: true
- filters: ["!^_"]
+ filters:
+ - '!^_'
merge_init_into_class: true
docstring_section_style: spacy
signature_crossrefs: true
@@ -264,25 +267,25 @@ extra:
- link: /
name: en - English
- link: /de/
- name: de
- - link: /em/
- name: ð
+ name: de - Deutsch
- link: /es/
name: es - español
- link: /fa/
- name: fa
+ name: fa - ÙارسÛ
- link: /fr/
name: fr - français
- link: /he/
- name: he
+ name: he - ×¢×ך×ת
+ - link: /hu/
+ name: hu - magyar
- link: /id/
- name: id
+ name: id - Bahasa Indonesia
- link: /ja/
name: ja - æ¥æ¬èª
- link: /ko/
name: ko - íêµìŽ
- link: /pl/
- name: pl
+ name: pl - Polski
- link: /pt/
name: pt - português
- link: /ru/
@@ -290,15 +293,17 @@ extra:
- link: /tr/
name: tr - TÌrkçe
- link: /uk/
- name: uk
+ name: uk - ÑкÑаÑÐœÑÑка ЌПва
- link: /ur/
- name: ur
+ name: ur - اردÙ
- link: /vi/
name: vi - Tiếng Viá»t
- link: /yo/
name: yo - Yorùbá
- link: /zh/
name: zh - æ±è¯
+ - link: /em/
+ name: ð
extra_css:
- css/termynal.css
- css/custom.css
diff --git a/docs/language_names.yml b/docs/language_names.yml
new file mode 100644
index 0000000000000..fbbbde303e31a
--- /dev/null
+++ b/docs/language_names.yml
@@ -0,0 +1,182 @@
+aa: Afaraf
+ab: аҧÑÑа бÑзÑÓа
+ae: avesta
+af: Afrikaans
+ak: Akan
+am: á ááá
+an: aragonés
+ar: اÙÙغة اÙعرؚÙØ©
+as: àŠ
àŠžàŠ®à§àŠ¯àŠŒàŠŸ
+av: Ð°Ð²Ð°Ñ ÐŒÐ°ÑÓ
+ay: aymar aru
+az: azÉrbaycan dili
+ba: баÑҡПÑÑ Ñеле
+be: белаÑÑÑÐºÐ°Ñ ÐŒÐŸÐ²Ð°
+bg: бÑлгаÑÑкО езОк
+bh: à€à¥à€à€ªà¥à€°à¥
+bi: Bislama
+bm: bamanankan
+bn: àŠ¬àŠŸàŠàŠ²àŠŸ
+bo: àœàœŒàœàŒàœ¡àœ²àœ
+br: brezhoneg
+bs: bosanski jezik
+ca: CatalÃ
+ce: МПÑ
ÑОйМ ЌПÑÑ
+ch: Chamoru
+co: corsu
+cr: ááŠááááá£
+cs: ÄeÅ¡tina
+cu: ѩзÑÐºÑ ÑлПвѣМÑÑкÑ
+cv: ÑÓÐ²Ð°Ñ ÑÓлÑ
О
+cy: Cymraeg
+da: dansk
+de: Deutsch
+dv: Dhivehi
+dz: àœ¢àŸ«àœŒàœàŒàœ
+ee: EÊegbe
+el: ÎλληΜικά
+en: English
+eo: Esperanto
+es: español
+et: eesti
+eu: euskara
+fa: ÙارسÛ
+ff: Fulfulde
+fi: suomi
+fj: Vakaviti
+fo: fÞroyskt
+fr: français
+fy: Frysk
+ga: Gaeilge
+gd: GÃ idhlig
+gl: galego
+gu: àªà«àªàª°àªŸàª€à«
+gv: Gaelg
+ha: ÙÙÙÙسÙ
+he: ×¢×ך×ת
+hi: à€¹à€¿à€šà¥à€Šà¥
+ho: Hiri Motu
+hr: Hrvatski
+ht: Kreyòl ayisyen
+hu: magyar
+hy: ÕÕ¡ÕµÕ¥ÖÕ¥Õ¶
+hz: Otjiherero
+ia: Interlingua
+id: Bahasa Indonesia
+ie: Interlingue
+ig: Asụsụ Igbo
+ii: êê ê¿ Nuosuhxop
+ik: Iñupiaq
+io: Ido
+is: Ãslenska
+it: italiano
+iu: ááááááŠ
+ja: æ¥æ¬èª
+jv: basa Jawa
+ka: á¥áá áá£áá
+kg: Kikongo
+ki: Gĩkũyũ
+kj: Kuanyama
+kk: ÒÐ°Ð·Ð°Ò ÑÑлÑ
+kl: kalaallisut
+km: áááááá¶áá¶
+kn: à²à²šà³à²šà²¡
+ko: íêµìŽ
+kr: Kanuri
+ks: à€à€¶à¥à€®à¥à€°à¥
+ku: Kurdî
+kv: кПЌО кÑв
+kw: Kernewek
+ky: ÐÑÑгÑзÑа
+la: latine
+lb: Lëtzebuergesch
+lg: Luganda
+li: Limburgs
+ln: Lingála
+lo: àºàº²àºªàº²
+lt: lietuvių kalba
+lu: Tshiluba
+lv: latviešu valoda
+mg: fiteny malagasy
+mh: Kajin M̧ajeČ
+mi: te reo MÄori
+mk: ЌакеЎПМÑкО ÑазОк
+ml: àŽ®àŽ²àŽ¯àŽŸàŽ³àŽ
+mn: ÐПМгПл Ñ
Ñл
+mr: à€®à€°à€Ÿà€ à¥
+ms: Bahasa Malaysia
+mt: Malti
+my: ááá¬á
á¬
+na: Ekakairũ Naoero
+nb: Norsk bokmål
+nd: isiNdebele
+ne: à€šà¥à€ªà€Ÿà€²à¥
+ng: Owambo
+nl: Nederlands
+nn: Norsk nynorsk
+'no': Norsk
+nr: isiNdebele
+nv: Diné bizaad
+ny: chiCheŵa
+oc: occitan
+oj: ááááá¯á§áá
+om: Afaan Oromoo
+or: à¬à¬¡à¬Œà¬¿à¬
+os: ОÑПМ Êвзаг
+pa: àšªà©°àšàšŸàš¬à©
+pi: à€ªà€Ÿà€Žà€¿
+pl: Polski
+ps: ÙŸÚتÙ
+pt: português
+qu: Runa Simi
+rm: rumantsch grischun
+rn: Ikirundi
+ro: RomânÄ
+ru: ÑÑÑÑкОй ÑзÑк
+rw: Ikinyarwanda
+sa: à€žà€à€žà¥à€à¥à€€à€®à¥
+sc: sardu
+sd: à€žà€¿à€šà¥à€§à¥
+se: Davvisámegiella
+sg: yângâ tî sÀngö
+si: à·à·à¶à·à¶œ
+sk: slovenÄina
+sl: slovenÅ¡Äina
+sn: chiShona
+so: Soomaaliga
+sq: shqip
+sr: ÑÑпÑкО ÑезОк
+ss: SiSwati
+st: Sesotho
+su: Basa Sunda
+sv: svenska
+sw: Kiswahili
+ta: ஀மிஎà¯
+te: à°€à±à°²à±à°à±
+tg: ÑПҷОкӣ
+th: à¹àžàž¢
+ti: áµááá
+tk: TÃŒrkmen
+tl: Wikang Tagalog
+tn: Setswana
+to: faka Tonga
+tr: TÌrkçe
+ts: Xitsonga
+tt: ÑаÑÐ°Ñ Ñеле
+tw: Twi
+ty: Reo Tahiti
+ug: ØŠÛÙغÛرÚÛâ
+uk: ÑкÑаÑÐœÑÑка ЌПва
+ur: اردÙ
+uz: Ðзбек
+ve: Tshivenáža
+vi: Tiếng Viá»t
+vo: VolapÃŒk
+wa: walon
+wo: Wollof
+xh: isiXhosa
+yi: ××ÖŽ××ש
+yo: Yorùbá
+za: Saɯ cueÅÆ
+zh: æ±è¯
+zu: isiZulu
diff --git a/scripts/docs.py b/scripts/docs.py
index 73e1900ada0c4..a6710d7a50fac 100644
--- a/scripts/docs.py
+++ b/scripts/docs.py
@@ -274,22 +274,24 @@ def live(
def update_config() -> None:
config = get_en_config()
languages = [{"en": "/"}]
- alternate: List[Dict[str, str]] = config["extra"].get("alternate", [])
- alternate_dict = {alt["link"]: alt["name"] for alt in alternate}
new_alternate: List[Dict[str, str]] = []
+ # Language names sourced from https://quickref.me/iso-639-1
+ # Contributors may wish to update or change these, e.g. to fix capitalization.
+ language_names_path = Path(__file__).parent / "../docs/language_names.yml"
+ local_language_names: Dict[str, str] = mkdocs.utils.yaml_load(
+ language_names_path.read_text(encoding="utf-8")
+ )
for lang_path in get_lang_paths():
- if lang_path.name == "en" or not lang_path.is_dir():
+ if lang_path.name in {"en", "em"} or not lang_path.is_dir():
continue
- name = lang_path.name
- languages.append({name: f"/{name}/"})
+ code = lang_path.name
+ languages.append({code: f"/{code}/"})
for lang_dict in languages:
- name = list(lang_dict.keys())[0]
- url = lang_dict[name]
- if url not in alternate_dict:
- new_alternate.append({"link": url, "name": name})
- else:
- use_name = alternate_dict[url]
- new_alternate.append({"link": url, "name": use_name})
+ code = list(lang_dict.keys())[0]
+ url = lang_dict[code]
+ use_name = f"{code} - {local_language_names[code]}"
+ new_alternate.append({"link": url, "name": use_name})
+ new_alternate.append({"link": "/em/", "name": "ð"})
config["extra"]["alternate"] = new_alternate
en_config_path.write_text(
yaml.dump(config, sort_keys=False, width=200, allow_unicode=True),
From 958425a899642d1853a1181a3b89dcb07aabea4f Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 9 Jan 2024 20:37:29 +0000
Subject: [PATCH 106/217] =?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 c7787053e9580..8699fbddcdcff 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* âš Generate automatic language names for docs translations. PR [#5354](https://github.com/tiangolo/fastapi/pull/5354) by [@jakul](https://github.com/jakul).
* âïž Fix typos in `docs/en/docs/alternatives.md` and `docs/en/docs/tutorial/dependencies/index.md`. PR [#10906](https://github.com/tiangolo/fastapi/pull/10906) by [@s111d](https://github.com/s111d).
* âïž Fix typos in `docs/en/docs/tutorial/dependencies/dependencies-with-yield.md`. PR [#10834](https://github.com/tiangolo/fastapi/pull/10834) by [@Molkree](https://github.com/Molkree).
* ð Add article: "Building a RESTful API with FastAPI: Secure Signup and Login Functionality Included". PR [#9733](https://github.com/tiangolo/fastapi/pull/9733) by [@dxphilo](https://github.com/dxphilo).
From 84cd488df17543089e0dbb1e1ab3c7bd4e976be3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Wed, 10 Jan 2024 21:19:21 +0400
Subject: [PATCH 107/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20External=20Link:?=
=?UTF-8?q?=20FastAPI=20application=20monitoring=20made=20easy=20(#10917)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Simon Gurcke
---
docs/en/data/external_links.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index d53afd7f9fac6..d9cfe3431d093 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -1,5 +1,9 @@
Articles:
English:
+ - author: Apitally
+ author_link: https://apitally.io
+ link: https://blog.apitally.io/fastapi-application-monitoring-made-easy
+ title: FastAPI application monitoring made easy
- author: John Philip
author_link: https://medium.com/@amjohnphilip
link: https://python.plainenglish.io/building-a-restful-api-with-fastapi-secure-signup-and-login-functionality-included-45cdbcb36106
From 7e0cdf25100207880e9519f109b9ad5377a83e01 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 10 Jan 2024 17:19:42 +0000
Subject: [PATCH 108/217] =?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 8699fbddcdcff..6885ef68d7e4a 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add External Link: FastAPI application monitoring made easy. PR [#10917](https://github.com/tiangolo/fastapi/pull/10917) by [@tiangolo](https://github.com/tiangolo).
* âš Generate automatic language names for docs translations. PR [#5354](https://github.com/tiangolo/fastapi/pull/5354) by [@jakul](https://github.com/jakul).
* âïž Fix typos in `docs/en/docs/alternatives.md` and `docs/en/docs/tutorial/dependencies/index.md`. PR [#10906](https://github.com/tiangolo/fastapi/pull/10906) by [@s111d](https://github.com/s111d).
* âïž Fix typos in `docs/en/docs/tutorial/dependencies/dependencies-with-yield.md`. PR [#10834](https://github.com/tiangolo/fastapi/pull/10834) by [@Molkree](https://github.com/Molkree).
From 06bf7781df11213ce4bc39370566b733de4dfd07 Mon Sep 17 00:00:00 2001
From: Fahad Md Kamal
Date: Wed, 10 Jan 2024 23:43:35 +0600
Subject: [PATCH 109/217] =?UTF-8?q?=F0=9F=8C=90=20Add=20Bengali=20translat?=
=?UTF-8?q?ion=20for=20`docs/bn/docs/index.md`=20(#9177)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/bn/docs/index.md | 464 ++++++++++++++++++++++++++++++++++++++++++
docs/bn/mkdocs.yml | 1 +
2 files changed, 465 insertions(+)
create mode 100644 docs/bn/docs/index.md
create mode 100644 docs/bn/mkdocs.yml
diff --git a/docs/bn/docs/index.md b/docs/bn/docs/index.md
new file mode 100644
index 0000000000000..4f778e87352f9
--- /dev/null
+++ b/docs/bn/docs/index.md
@@ -0,0 +1,464 @@
+
+
+
+
+ FastAPI àŠàŠà§àŠàŠà§àŠ·àŠ®àŠ€àŠŸ àŠžàŠ®à§àŠªàŠšà§àŠš, àŠžàŠ¹àŠà§ àŠ¶à§àŠàŠŸàŠ° àŠàŠ¬àŠ àŠŠà§àŠ°à§àŠ€ àŠà§àŠ¡ àŠàŠ°à§ àŠªà§àŠ°à§àŠ¡àŠŸàŠàŠ¶àŠšà§àŠ° àŠàŠšà§àŠ¯ àŠ«à§àŠ°àŠŸàŠ®àŠà§àŠŸàŠ°à§àŠà¥€
+
+
+
+
+
+
+
+
+
+
+
+
+
+---
+
+**àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿**: https://fastapi.tiangolo.com
+
+**àŠžà§àŠ°à§àŠž àŠà§àŠ¡**: https://github.com/tiangolo/fastapi
+
+---
+
+FastAPI àŠàŠàŠàŠ¿ àŠàŠ§à§àŠšàŠ¿àŠ, àŠŠà§àŠ°à§àŠ€ ( àŠ¬à§àŠ¶àŠ¿ àŠà§àŠ·àŠ®àŠ€àŠŸ ) àŠžàŠ®à§àŠªàŠšà§àŠš, Python 3.6+ àŠŠàŠ¿à§à§ API àŠ€à§àŠ°àŠ¿àŠ° àŠàŠšà§àŠ¯ àŠžà§àŠà§àŠ¯àŠŸàŠšà§àŠ¡àŠŸàŠ°à§àŠ¡ àŠªàŠŸàŠàŠ¥àŠš àŠàŠŸàŠàŠª àŠàŠà§àŠàŠ¿àŠ€ àŠàŠ¿àŠ€à§àŠ€àŠ¿àŠ àŠàŠ¯àŠŒà§àŠ¬ àŠ«à§àŠ°à§àŠ®àŠàŠ¯àŠŒàŠŸàŠ°à§àŠà¥€
+
+àŠàŠ° àŠ®à§àŠ² àŠ¬à§àŠ¶àŠ¿àŠ·à§àŠà§àŠ¯ àŠà§àŠ²à§ àŠ¹àŠ²àŠ
+
+- **àŠàŠ€àŠ¿**: àŠàŠàŠ¿ **NodeJS** àŠàŠ¬àŠ **Go** àŠàŠ° àŠ®àŠ€ àŠàŠŸàŠ°à§àŠ¯àŠà§àŠ·àŠ®àŠ€àŠŸ àŠžàŠ®à§àŠªàŠšà§àŠš (Starlette àŠàŠ¬àŠ Pydantic àŠàŠ° àŠžàŠŸàŠ¹àŠŸàŠ¯à§àŠ¯à§)ी [àŠªàŠŸàŠàŠ¥àŠš àŠàŠ° àŠŠà§àŠ°à§àŠ€àŠ€àŠ® àŠ«à§àŠ°à§àŠ®àŠàŠ¯àŠŒàŠŸàŠ°à§àŠ àŠà§àŠ²à§àŠ° àŠ®àŠ§à§àŠ¯à§ àŠàŠàŠ¿ àŠàŠàŠàŠ¿](#_11)ी
+- **àŠŠà§àŠ°à§àŠ€ àŠà§àŠ¡ àŠàŠ°àŠŸ**:àŠ¬à§àŠ¶àŠ¿àŠ·à§àŠà§àŠ¯ àŠ€à§àŠ°àŠ¿àŠ° àŠàŠ€àŠ¿ ৚৊৊% àŠ¥à§àŠà§ ৩৊৊% àŠ¬à§àŠŠà§àŠ§àŠ¿ àŠàŠ°à§à§· \*
+- **àŠžà§àŠ¬àŠ²à§àŠª bugs**: àŠ®àŠŸàŠšà§àŠ¬ (àŠ¡à§àŠà§àŠ²àŠªàŠŸàŠ°) àŠžà§àŠ·à§àŠ àŠ€à§àŠ°à§àŠàŠ¿àŠ° àŠªà§àŠ°àŠŸàŠ¯àŠŒ ৪৊% àŠ¹à§àŠ°àŠŸàŠž àŠàŠ°à§à¥€ \*
+- **àŠžà§àŠ¬àŠà§àŠàŠŸàŠ€**: àŠŠà§àŠ°à§àŠŠàŠŸàŠšà§àŠ€ àŠàŠ¡àŠ¿àŠàŠ° àŠžàŠŸàŠ¹àŠŸàŠ¯à§àŠ¯ Completion àŠšàŠŸàŠ®à§àŠ àŠªàŠ°àŠ¿àŠàŠ¿àŠ€à¥€ àŠŠà§àŠ°à§àŠ€ àŠ¡àŠ¿àŠ¬àŠŸàŠ àŠàŠ°àŠŸ àŠ¯àŠŸà§à¥€
+
+- **àŠžàŠ¹àŠ**: àŠàŠàŠ¿ àŠàŠ®àŠš àŠàŠŸàŠ¬à§ àŠžàŠàŠŸàŠšà§ àŠ¹à§à§àŠà§ àŠ¯à§àŠš àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿ àŠªà§à§ àŠžàŠ¹àŠà§ àŠ¶à§àŠàŠŸ àŠàŠ¬àŠ àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠŸ àŠ¯àŠŸà§à¥€
+- **àŠžàŠàŠà§àŠ·àŠ¿àŠªà§àŠ€**: àŠà§àŠ¡ àŠªà§àŠšàŠ°àŠŸàŠ¬à§àŠ€à§àŠ€àŠ¿ àŠàŠ®àŠŸàŠšà§àŠ° àŠªàŠŸàŠ¶àŠŸàŠªàŠŸàŠ¶àŠ¿, bug àŠàŠ®àŠŸà§ àŠàŠ¬àŠ àŠªà§àŠ°àŠ€àŠ¿àŠàŠ¿ àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ° àŠà§àŠ·àŠ£àŠŸ àŠ¥à§àŠà§ àŠàŠàŠŸàŠ§àŠ¿àŠ àŠ«àŠ¿àŠàŠŸàŠ° àŠªàŠŸàŠà§àŠŸ àŠ¯àŠŸà§ à¥€
+- **àŠà§àŠ°àŠŸàŠ²à§**: àŠžà§àŠ¬àŠ¯àŠŒàŠàŠà§àŠ°àŠ¿àŠ¯àŠŒ àŠàŠŸàŠ¬à§ àŠ€à§àŠ°àŠ¿ àŠà§àŠ°àŠ¿à§àŠŸàŠ¶à§àŠ² àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠšàŠŸ àŠšàŠ¥àŠ¿ (documentation) àŠžàŠ¹ àŠà§àŠªàŠŸàŠŠàŠš àŠàŠªàŠ¯à§àŠàŠ¿ (Production-ready) àŠà§àŠ¡ àŠªàŠŸàŠà§àŠŸ àŠ¯àŠŸà§à¥€
+- **àŠ®àŠŸàŠš-àŠàŠ¿àŠ€à§àŠ€àŠ¿àŠ**: àŠàŠ° àŠàŠ¿àŠ€à§àŠ€àŠ¿ OpenAPI (àŠ¯àŠŸ àŠªà§àŠ°à§àŠ¬à§ Swagger àŠšàŠŸàŠ®à§ àŠªàŠ°àŠ¿àŠàŠ¿àŠ€ àŠàŠ¿àŠ²) àŠàŠ¬àŠ JSON Schema àŠàŠ° àŠàŠŠàŠ°à§àŠ¶à§àŠ° àŠ®àŠŸàŠšà§àŠ° àŠàŠªàŠ°
+
+\* àŠà§àŠªàŠŸàŠŠàŠšàŠ®à§àŠàŠ¿ àŠàŠªà§àŠ²àŠ¿àŠà§àŠ¶àŠš àŠ¬àŠŸàŠšàŠŸàŠšà§àŠ° àŠàŠ àŠŠàŠ² àŠ¡à§àŠà§àŠ²àŠªàŠŸàŠ° àŠàŠ° àŠ®àŠ€àŠŸàŠ®àŠ€ àŠàŠ¿àŠ€à§àŠ€àŠ¿àŠ àŠ«àŠ²àŠŸàŠ«àŠ²à¥€
+
+## àŠžà§àŠªàŠšàŠžàŠ° àŠàŠ£
+
+
+
+{% if sponsors %}
+{% for sponsor in sponsors.gold -%}
+
+{% endfor -%}
+{%- for sponsor in sponsors.silver -%}
+
+{% endfor %}
+{% endif %}
+
+
+
+àŠ
àŠšà§àŠ¯àŠŸàŠšà§àŠ¯ àŠžà§àŠªàŠšàŠžàŠ° àŠàŠ£
+
+## àŠ®àŠ€àŠŸàŠ®àŠ€ àŠžàŠ®à§àŠ¹
+
+"_àŠàŠ®àŠ¿ àŠàŠàŠàŠŸàŠ² **FastAPI** àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠàŠ¿à¥€ [...] àŠàŠ®àŠ°àŠŸ àŠàŠŸàŠ¬àŠàŠ¿ àŠ®àŠŸàŠàŠà§àŠ°à§àŠžàŠ«à§àŠà§ **ML àŠžàŠŸàŠ°à§àŠàŠ¿àŠž** àŠ àŠžàŠàŠ² àŠŠàŠ²à§àŠ° àŠàŠšà§àŠ¯ àŠàŠàŠ¿ àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠ¬à¥€ àŠ¯àŠŸàŠ° àŠ®àŠ§à§àŠ¯à§ àŠàŠ¿àŠà§ àŠªàŠ£à§àŠ¯ **Windows** àŠ àŠžàŠàŠ¯à§àŠ¯àŠš àŠ¹à§ àŠàŠ¬àŠ àŠàŠ¿àŠà§ **Office** àŠàŠ° àŠžàŠŸàŠ¥à§ àŠžàŠàŠ¯à§àŠ¯àŠš àŠ¹àŠà§àŠà§à¥€_"
+
+àŠàŠ¬àŠ¿àŠ° àŠàŠŸàŠš -
àŠ®àŠŸàŠàŠà§àŠ°à§àŠžàŠ«à§àŠà§ (ref)
+
+---
+
+"_àŠàŠ®àŠ°àŠŸ **FastAPI** àŠ²àŠŸàŠàŠ¬à§àŠ°à§àŠ°àŠ¿ àŠà§àŠ°àŠ¹àŠ£ àŠàŠ°à§àŠàŠ¿ àŠàŠàŠàŠ¿ **REST** àŠžàŠŸàŠ°à§àŠàŠŸàŠ° àŠ€à§àŠ°àŠ¿ àŠàŠ°àŠ€à§, àŠ¯àŠŸ **àŠàŠ¬àŠ¿àŠ·à§àŠ¯àŠŠà§àŠ¬àŠŸàŠ£à§** àŠªàŠŸàŠàŠ¯àŠŒàŠŸàŠ° àŠàŠšà§àŠ¯ àŠà§à§à§àŠ°àŠ¿ àŠàŠ°àŠŸ àŠ¯à§àŠ€à§ àŠªàŠŸàŠ°à§à¥€ [àŠ²à§àŠ¡àŠàŠàŠà§àŠ° àŠàŠšà§àŠ¯]_"
+
+àŠªàŠ¿àŠ¯àŠŒà§àŠ°à§ àŠ®à§àŠ²àŠ¿àŠšà§, àŠàŠ¯àŠŒàŠŸàŠ°à§àŠžà§àŠ²àŠŸàŠ àŠŠà§àŠŠàŠ¿àŠš, àŠàŠ¬àŠ àŠžàŠŸàŠ àŠžà§àŠ®àŠšà§àŠ¥ àŠ®àŠ¿àŠ°àŠ¿àŠ¯àŠŒàŠŸàŠ²àŠŸ -
àŠàŠ¬àŠŸàŠ° (ref)
+
+---
+
+"_**Netflix** àŠàŠ®àŠŸàŠŠà§àŠ° **àŠà§àŠ°àŠŸàŠàŠžàŠ¿àŠž àŠ®à§àŠ¯àŠŸàŠšà§àŠàŠ®à§àŠšà§àŠ** àŠ
àŠ°à§àŠà§àŠžà§àŠà§àŠ°à§àŠ¶àŠš àŠ«à§àŠ°à§àŠ®àŠàŠ¯àŠŒàŠŸàŠ°à§àŠ: **àŠ¡àŠ¿àŠžàŠªà§àŠ¯àŠŸàŠ** àŠàŠ° àŠàŠªà§àŠš àŠžà§àŠ°à§àŠž àŠ°àŠ¿àŠ²àŠ¿àŠ àŠà§àŠ·àŠ£àŠŸ àŠàŠ°àŠ€à§ àŠªà§àŠ°à§ àŠàŠšàŠšà§àŠŠàŠ¿àŠ€! [àŠ¯àŠŸàŠàŠ¿àŠšàŠŸ **FastAPI** àŠŠàŠ¿àŠ¯àŠŒà§ àŠšàŠ¿àŠ°à§àŠ®àŠ¿àŠ€]_"
+
+àŠà§àŠàŠ¿àŠš àŠà§àŠ²àŠ¿àŠžàŠš, àŠ®àŠŸàŠ°à§àŠ àŠàŠ¿àŠ²àŠŸàŠšà§àŠàŠŸ, àŠ«àŠ°à§àŠžà§àŠ àŠ®àŠšàŠžà§àŠš -
àŠšà§àŠàŠ«à§àŠ²àŠ¿àŠà§àŠž (ref)
+
+---
+
+"_àŠàŠ®àŠ¿ **FastAPI** àŠšàŠ¿àŠ¯àŠŒà§ àŠàŠŸàŠàŠŠà§àŠ° àŠžàŠ®àŠŸàŠš àŠà§àŠžàŠŸàŠ¹àŠ¿àŠ€à¥€ àŠàŠàŠ¿ àŠà§àŠ¬àŠ àŠ®àŠàŠŸàŠ°!_"
+
+
+
+---
+
+"\_àŠžàŠ€à§àŠ¯àŠ¿àŠ, àŠàŠªàŠšàŠ¿ àŠ¯àŠŸ àŠ€à§àŠ°àŠ¿ àŠàŠ°à§àŠà§àŠš àŠ€àŠŸ àŠà§àŠ¬ àŠ®àŠàŠ¬à§àŠ€ àŠàŠ¬àŠ àŠªàŠ°àŠ¿àŠªà§àŠ°à§àŠšà§· àŠ
àŠšà§àŠ àŠàŠªàŠŸàŠ¯àŠŒà§, àŠàŠ®àŠ¿ àŠ¯àŠŸ **Hug** àŠ àŠàŠ°àŠ€à§ àŠà§à§à§àŠàŠ¿àŠ²àŠŸàŠ® - àŠ€àŠŸ àŠàŠŸàŠàŠà§ àŠ€à§àŠ°àŠ¿ àŠàŠ°àŠ€à§ àŠŠà§àŠà§ àŠàŠ®àŠ¿ àŠžàŠ€à§àŠ¯àŠ¿àŠ àŠ
àŠšà§àŠªà§àŠ°àŠŸàŠšàŠ¿àŠ€à§·\_"
+
+àŠàŠ¿àŠ®à§àŠ¥àŠ¿ àŠà§àŠ°àŠžàŠ²à§ -
Hug àŠžà§àŠ°àŠ·à§àŠàŠŸ (ref)
+
+---
+
+"àŠàŠªàŠšàŠ¿ àŠ¯àŠŠàŠ¿ REST API àŠ€à§àŠ°àŠ¿àŠ° àŠàŠšà§àŠ¯ àŠàŠàŠàŠ¿ **àŠàŠ§à§àŠšàŠ¿àŠ àŠ«à§àŠ°à§àŠ®àŠà§àŠŸàŠ°à§àŠ** àŠ¶àŠ¿àŠàŠ€à§ àŠàŠŸàŠš, àŠ€àŠŸàŠ¹àŠ²à§ **FastAPI** àŠŠà§àŠà§àŠš [...] àŠàŠàŠ¿ àŠŠà§àŠ°à§àŠ€, àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠŸ àŠžàŠ¹àŠ àŠàŠ¬àŠ àŠ¶àŠ¿àŠàŠ€à§àŠ àŠžàŠ¹àŠ [...]\_"
+
+"_àŠàŠ®àŠ°àŠŸ àŠàŠ®àŠŸàŠŠà§àŠ° **APIs** [...] àŠàŠ° àŠàŠšà§àŠ¯ **FastAPI**- àŠ€à§ àŠàŠžà§àŠàŠ¿ [...] àŠàŠ®àŠ¿ àŠ®àŠšà§ àŠàŠ°àŠ¿ àŠàŠªàŠšàŠ¿àŠ àŠàŠàŠ¿ àŠªàŠàŠšà§àŠŠ àŠàŠ°àŠ¬à§àŠš [...]_"
+
+àŠàŠšà§àŠž àŠ®àŠšà§àŠàŠŸàŠšàŠ¿ - àŠ®à§àŠ¯àŠŸàŠ¥àŠ¿àŠ àŠ¹à§àŠšàŠ¿àŠ¬àŠŸàŠ² -
Explosion AI àŠªà§àŠ°àŠ€àŠ¿àŠ·à§àŠ àŠŸàŠ€àŠŸ - spaCy àŠžà§àŠ°àŠ·à§àŠàŠŸ (ref) -
(ref)
+
+---
+
+## **Typer**, CLI àŠàŠ° àŠàŠšà§àŠ¯ FastAPI
+
+
+
+àŠàŠªàŠšàŠ¿ àŠ¯àŠŠàŠ¿ CLI àŠ
à§àŠ¯àŠŸàŠª àŠ¬àŠŸàŠšàŠŸàŠ€à§ àŠàŠŸàŠš, àŠ¯àŠŸ àŠàŠ¿àŠšàŠŸ àŠà§à§àŠ¬ API àŠàŠ° àŠªàŠ°àŠ¿àŠ¬àŠ°à§àŠ€à§ àŠàŠŸàŠ°à§àŠ®àŠ¿àŠšàŠŸàŠ²à§ àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠ¹àŠ¬à§, àŠ€àŠŸàŠ¹àŠ²à§ àŠŠà§àŠà§àŠš**Typer** .
+
+**àŠàŠŸàŠàŠªàŠŸàŠ°** àŠ¹àŠ² FastAPI àŠàŠ° àŠà§àŠ àŠàŠŸàŠà§à§àŠ° àŠ®àŠ€à¥€ àŠàŠ¬àŠ àŠàŠàŠ¿àŠ° àŠàŠŠà§àŠŠà§àŠ¶à§àŠ¯ àŠàŠ¿àŠ² **CLIs àŠàŠ° FastAPI** àŠ¹àŠà§àŠŸà¥€ âšïž ð
+
+## àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠšà§àŠ¯àŠŒàŠ€àŠŸ àŠà§àŠ²à§
+
+Python 3.7+
+
+FastAPI àŠàŠ¿àŠà§ àŠŠàŠŸàŠšàŠ¬à§àŠŠà§àŠ° àŠàŠŸàŠàŠ§à§ àŠŠàŠŸàŠàŠ¡àŠŒàŠ¿àŠ¯àŠŒà§ àŠàŠà§:
+
+- Starlette àŠàŠ¯àŠŒà§àŠ¬ àŠ
àŠàŠ¶à§àŠ° àŠàŠšà§àŠ¯.
+- Pydantic àŠ¡à§àŠàŠŸ àŠ
àŠàŠ¶àŠà§àŠ²àŠ¿àŠ° àŠàŠšà§àŠ¯.
+
+## àŠàŠšàŠžà§àŠàŠ²à§àŠ¶àŠš àŠªà§àŠ°àŠà§àŠ°àŠ¿à§àŠŸ
+
+
+
+```console
+$ pip install fastapi
+
+---> 100%
+```
+
+
+
+àŠàŠªàŠšàŠŸàŠ° àŠàŠàŠàŠ¿ ASGI àŠžàŠŸàŠ°à§àŠàŠŸàŠ°à§àŠ°àŠ àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠš àŠ¹àŠ¬à§, àŠªà§àŠ°à§àŠ¡àŠŸàŠàŠ¶àŠšà§àŠ° àŠàŠšà§àŠ¯ Uvicorn àŠ
àŠ¥àŠ¬àŠŸ Hypercorn .
+
+
+
+```console
+$ pip install "uvicorn[standard]"
+
+---> 100%
+```
+
+
+
+## àŠàŠŠàŠŸàŠ¹àŠ°àŠ£
+
+### àŠ€à§àŠ°àŠ¿
+
+- `main.py` àŠšàŠŸàŠ®à§ àŠàŠàŠàŠ¿ àŠ«àŠŸàŠàŠ² àŠ€à§àŠ°àŠ¿ àŠàŠ°à§àŠš:
+
+```Python
+from typing import Union
+
+from fastapi import FastAPI
+
+app = FastAPI()
+
+
+@app.get("/")
+def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+def read_item(item_id: int, q: Union[str, None] = None):
+ return {"item_id": item_id, "q": q}
+```
+
+
+àŠ
àŠ¥àŠ¬àŠŸ àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°à§àŠš async def
...
+
+àŠ¯àŠŠàŠ¿ àŠàŠªàŠšàŠŸàŠ° àŠà§àŠ¡ `async` / `await`, àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°à§ àŠ€àŠŸàŠ¹àŠ²à§ `async def` àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°à§àŠš:
+
+```Python hl_lines="9 14"
+from typing import Union
+
+from fastapi import FastAPI
+
+app = FastAPI()
+
+
+@app.get("/")
+async def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+async def read_item(item_id: int, q: Union[str, None] = None):
+ return {"item_id": item_id, "q": q}
+```
+
+**àŠà§àŠàŠŸ**:
+
+àŠàŠªàŠšàŠ¿ àŠ¯àŠŠàŠ¿ àŠšàŠŸ àŠàŠŸàŠšà§àŠš, _"àŠ€àŠŸàŠ¡àŠŒàŠŸàŠ¹à§àŠ¡àŠŒà§?"_ àŠ¬àŠ¿àŠàŠŸàŠàŠàŠ¿ àŠŠà§àŠà§àŠš `async` àŠàŠ¬àŠ `await` àŠšàŠ¥àŠ¿àŠ° àŠ®àŠ§à§àŠ¯à§ àŠŠà§àŠà§àŠš .
+
+
+
+### àŠàŠàŠ¿ àŠàŠŸàŠ²àŠŸàŠš
+
+àŠžàŠŸàŠ°à§àŠàŠŸàŠ° àŠàŠŸàŠ²à§ àŠàŠ°à§àŠš:
+
+
+
+```console
+$ uvicorn main:app --reload
+
+INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
+INFO: Started reloader process [28720]
+INFO: Started server process [28722]
+INFO: Waiting for application startup.
+INFO: Application startup complete.
+```
+
+
+
+
+àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠšàŠŸ àŠžàŠ®à§àŠªàŠ°à§àŠà§ uvicorn main:app --reload
...
+
+`uvicorn main:app` àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠšàŠŸàŠàŠ¿ àŠŠà§àŠ¬àŠŸàŠ°àŠŸ àŠ¬à§àŠàŠŸàŠ¯àŠŒ:
+
+- `main`: àŠ«àŠŸàŠàŠ² `main.py` (àŠªàŠŸàŠàŠ¥àŠš "àŠ®àŠ¡àŠ¿àŠàŠ²")ी
+- `app`: `app = FastAPI()` àŠ²àŠŸàŠàŠš àŠŠàŠ¿àŠ¯àŠŒà§ `main.py` àŠàŠ° àŠàŠ¿àŠ€àŠ°à§ àŠ€à§àŠ°àŠ¿ àŠàŠ°àŠŸ àŠ
àŠ¬àŠà§àŠà§àŠà¥€
+- `--reload`: àŠà§àŠ¡ àŠªàŠ°àŠ¿àŠ¬àŠ°à§àŠ€àŠšà§àŠ° àŠªàŠ°à§ àŠžàŠŸàŠ°à§àŠàŠŸàŠ° àŠªà§àŠšàŠ°àŠŸàŠ¯àŠŒ àŠàŠŸàŠ²à§ àŠàŠ°à§àŠšà¥€ àŠàŠàŠ¿ àŠ¶à§àŠ§à§àŠ®àŠŸàŠ€à§àŠ° àŠ¡à§àŠà§àŠ²àŠªàŠ®à§àŠšà§àŠ àŠàŠ° àŠžàŠ®à§ àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°à§àŠšà¥€
+
+
+
+### àŠàŠàŠŸ àŠà§àŠ àŠàŠ°à§àŠš
+
+àŠàŠªàŠšàŠŸàŠ° àŠ¬à§àŠ°àŠŸàŠàŠàŠŸàŠ° àŠà§àŠ²à§àŠš http://127.0.0.1:8000/items/5?q=somequery àŠà¥€
+
+àŠàŠªàŠšàŠ¿ JSON àŠ°à§àŠžàŠªàŠšà§àŠž àŠŠà§àŠàŠ€à§ àŠªàŠŸàŠ¬à§àŠš:
+
+```JSON
+{"item_id": 5, "q": "somequery"}
+```
+
+àŠàŠªàŠšàŠ¿ àŠàŠ€àŠ¿àŠ®àŠ§à§àŠ¯à§ àŠàŠàŠàŠ¿ API àŠ€à§àŠ°àŠ¿ àŠàŠ°à§àŠà§àŠš àŠ¯àŠŸ:
+
+- `/` àŠàŠ¬àŠ `/items/{item_id}` _paths_ àŠ HTTP àŠ
àŠšà§àŠ°à§àŠ§ àŠà§àŠ°àŠ¹àŠ£ àŠàŠ°à§à¥€
+- àŠàŠàŠ¯àŠŒ *path*àŠ `GET` àŠ
àŠªàŠŸàŠ°à§àŠ¶àŠš àŠšà§àŠ¯àŠŒ ( àŠ¯àŠŸ HTTP _methods_ àŠšàŠŸàŠ®à§àŠ àŠªàŠ°àŠ¿àŠàŠ¿àŠ€)ी
+- _path_ `/items/{item_id}`-àŠ àŠàŠàŠàŠ¿ _path àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ°_ `item_id` àŠàŠà§ àŠ¯àŠŸ àŠàŠ¿àŠšàŠŸ `int` àŠ¹àŠ€à§ àŠ¹àŠ¬à§à¥€
+- _path_ `/items/{item_id}`-àŠàŠ° àŠàŠàŠàŠ¿ àŠàŠà§àŠàŠ¿àŠ `str` _query àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ°_ `q` àŠàŠà§à¥€
+
+### àŠà§àŠ°àŠ¿à§àŠŸàŠ¶à§àŠ² API àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿
+
+àŠàŠàŠš àŠ¯àŠŸàŠš http://127.0.0.1:8000/docs .
+
+àŠàŠªàŠšàŠ¿ àŠžà§àŠ¬àŠ¯àŠŒàŠàŠà§àŠ°àŠ¿àŠ¯àŠŒ àŠàŠŸàŠ¬à§ àŠªà§àŠ°àŠžà§àŠ€à§àŠ€ àŠà§àŠ°àŠ¿à§àŠŸàŠ¶à§àŠ² API àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿ àŠŠà§àŠàŠ€à§ àŠªàŠŸàŠ¬à§àŠš (Swagger UI àŠªà§àŠ°àŠŠàŠ€à§àŠ€):
+
+![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
+
+### àŠ¬àŠ¿àŠàŠ²à§àŠª API àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿
+
+àŠàŠ¬àŠ àŠàŠàŠš http://127.0.0.1:8000/redoc àŠ àŠ¯àŠŸàŠš.
+
+àŠàŠªàŠšàŠ¿ àŠžà§àŠ¬àŠ¯àŠŒàŠàŠà§àŠ°àŠ¿àŠ¯àŠŒ àŠàŠŸàŠ¬à§ àŠªà§àŠ°àŠžà§àŠ€à§àŠ€ àŠ¬àŠ¿àŠàŠ²à§àŠª àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿ àŠŠà§àŠàŠ€à§ àŠªàŠŸàŠ¬à§àŠš (ReDoc àŠªà§àŠ°àŠŠàŠ€à§àŠ€):
+
+![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
+
+## àŠàŠŠàŠŸàŠ¹àŠ°àŠ£àŠžà§àŠ¬àŠ°à§àŠª àŠàŠªàŠà§àŠ°à§àŠ¡
+
+àŠàŠàŠš `main.py` àŠ«àŠŸàŠàŠ²àŠàŠ¿ àŠªàŠ°àŠ¿àŠ¬àŠ°à§àŠ€àŠš àŠàŠ°à§àŠš àŠ¯à§àŠš àŠàŠàŠ¿ `PUT` àŠ°àŠ¿àŠà§à§à§àŠžà§àŠ àŠ¥à§àŠà§ àŠ¬àŠ¡àŠ¿ àŠªà§àŠ€à§ àŠªàŠŸàŠ°à§à¥€
+
+Python àŠžà§àŠà§àŠ¯àŠŸàŠšà§àŠ¡àŠŸàŠ°à§àŠ¡ àŠ²àŠŸàŠàŠ¬à§àŠ°à§àŠ°àŠ¿, Pydantic àŠàŠ° àŠžàŠŸàŠ¹àŠŸàŠ¯à§àŠ¯à§ àŠ¬àŠ¡àŠ¿ àŠà§àŠ·àŠ£àŠŸ àŠàŠ°à§àŠšà¥€
+
+```Python hl_lines="4 9-12 25-27"
+from typing import Union
+
+from fastapi import FastAPI
+from pydantic import BaseModel
+
+app = FastAPI()
+
+
+class Item(BaseModel):
+ name: str
+ price: float
+ is_offer: Union[bool, None] = None
+
+
+@app.get("/")
+def read_root():
+ return {"Hello": "World"}
+
+
+@app.get("/items/{item_id}")
+def read_item(item_id: int, q: Union[str, None] = None):
+ return {"item_id": item_id, "q": q}
+
+
+@app.put("/items/{item_id}")
+def update_item(item_id: int, item: Item):
+ return {"item_name": item.name, "item_id": item_id}
+```
+
+àŠžàŠŸàŠ°à§àŠàŠŸàŠ°àŠàŠ¿ àŠžà§àŠ¬àŠ¯àŠŒàŠàŠà§àŠ°àŠ¿àŠ¯àŠŒàŠàŠŸàŠ¬à§ àŠªà§àŠšàŠ°àŠŸàŠ¯àŠŒ àŠ²à§àŠ¡ àŠ¹àŠàŠ¯àŠŒàŠŸ àŠàŠàŠ¿àŠ€ (àŠàŠŸàŠ°àŠ£ àŠàŠªàŠšàŠ¿ àŠàŠªàŠ°à§àŠ° `uvicorn` àŠàŠ®àŠŸàŠšà§àŠ¡à§ `--reload` àŠ¯à§àŠ àŠàŠ°à§àŠà§àŠš)ी
+
+### àŠà§àŠ°àŠ¿à§àŠŸàŠ¶à§àŠ² API àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿ àŠàŠšà§àŠšà§àŠ€àŠàŠ°àŠ£
+
+àŠàŠàŠš http://127.0.0.1:8000/docs àŠàŠ¡àŠ¡à§àŠ°à§àŠžà§ àŠ¯àŠŸàŠš.
+
+- àŠà§àŠ°àŠ¿à§àŠŸàŠ¶à§àŠ² API àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿àŠàŠ¿ àŠžà§àŠ¬àŠ¯àŠŒàŠàŠà§àŠ°àŠ¿àŠ¯àŠŒàŠàŠŸàŠ¬à§ àŠàŠšà§àŠšà§àŠ€ àŠ¹àŠ¯à§ àŠ¯àŠŸàŠ¬à§, àŠšàŠ€à§àŠš àŠ¬àŠ¡àŠ¿ àŠžàŠ¹:
+
+![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
+
+- "Try it out" àŠ¬àŠŸàŠàŠšà§ àŠàŠŸàŠªà§àŠš, àŠàŠàŠ¿ àŠàŠªàŠšàŠŸàŠà§ àŠªà§àŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ°àŠà§àŠ²à§ àŠªà§àŠ°àŠ£ àŠàŠ°àŠ€à§ àŠàŠ¬àŠ API àŠàŠ° àŠžàŠŸàŠ¥à§ àŠžàŠ°àŠŸàŠžàŠ°àŠ¿ àŠà§àŠ°àŠ¿à§àŠŸ-àŠàŠ²àŠŸàŠª àŠàŠ°àŠ€à§ àŠŠàŠ¿àŠ¬à§:
+
+![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png)
+
+- àŠ€àŠŸàŠ°àŠªàŠ°à§ "Execute" àŠ¬àŠŸàŠàŠšà§ àŠàŠŸàŠªà§àŠš, àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ°àŠàŠŸàŠ°à§àŠ° àŠàŠšà§àŠàŠŸàŠ°àŠ«à§àŠž àŠàŠªàŠšàŠŸàŠ° API àŠàŠ° àŠžàŠŸàŠ¥à§ àŠ¯à§àŠàŠŸàŠ¯à§àŠ àŠàŠ°àŠ¬à§, àŠªà§àŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ° àŠªàŠŸàŠ àŠŸàŠ¬à§, àŠ«àŠ²àŠŸàŠ«àŠ²àŠà§àŠ²àŠ¿ àŠªàŠŸàŠ¬à§ àŠàŠ¬àŠ àŠžà§àŠà§àŠ²àŠ¿ àŠªàŠ°à§àŠ°àŠŠàŠŸà§ àŠŠà§àŠàŠŸàŠ¬à§:
+
+![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png)
+
+### àŠ¬àŠ¿àŠàŠ²à§àŠª API àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿ àŠàŠªàŠà§àŠ°à§àŠ¡
+
+àŠàŠ¬àŠ àŠàŠàŠš http://127.0.0.1:8000/redoc àŠ àŠ¯àŠŸàŠšà¥€
+
+- àŠ¬àŠ¿àŠàŠ²à§àŠª àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿àŠ€à§àŠ àŠšàŠ€à§àŠš àŠà§à§à§àŠ°àŠ¿ àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ° àŠàŠ¬àŠ àŠ¬àŠ¡àŠ¿ àŠªà§àŠ°àŠ€àŠ¿àŠ«àŠ²àŠ¿àŠ€ àŠ¹àŠ¬à§:
+
+![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
+
+### àŠžàŠàŠà§àŠ·àŠ¿àŠªà§àŠ€àŠàŠ°àŠ£
+
+àŠžàŠàŠà§àŠ·à§àŠªà§, àŠàŠªàŠšàŠ¿ **àŠ¶à§àŠ§à§ àŠàŠàŠ¬àŠŸàŠ°** àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ°à§àŠ° àŠ§àŠ°àŠš, àŠ¬àŠ¡àŠ¿ àŠàŠ€à§àŠ¯àŠŸàŠŠàŠ¿ àŠ«àŠŸàŠàŠ¶àŠš àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ° àŠ¹àŠ¿àŠžà§àŠ¬à§ àŠà§àŠ·àŠ£àŠŸ àŠàŠ°à§àŠšà¥€
+
+àŠàŠªàŠšàŠ¿ àŠžà§àŠàŠ¿ àŠàŠ§à§àŠšàŠ¿àŠ àŠªàŠŸàŠàŠ¥àŠšà§àŠ° àŠžàŠŸàŠ¥à§ àŠàŠ°à§àŠšà¥€
+
+àŠàŠªàŠšàŠŸàŠà§ àŠšàŠ€à§àŠš àŠàŠ°à§ àŠšàŠ¿àŠ°à§àŠŠàŠ¿àŠ·à§àŠ àŠà§àŠš àŠ²àŠŸàŠàŠ¬à§àŠ°à§àŠ°àŠ¿àŠ° àŠ¬àŠŸàŠà§àŠ¯ àŠàŠ àŠš, àŠ«àŠŸàŠàŠ¶àŠš àŠ¬àŠŸ àŠà§àŠ²àŠŸàŠž àŠàŠ¿àŠà§àŠ àŠ¶àŠ¿àŠàŠ€à§ àŠ¹àŠà§àŠà§ àŠšàŠŸà¥€
+
+àŠ¶à§àŠ§à§àŠ àŠàŠ§à§àŠšàŠ¿àŠ **Python 3.6+**
+
+àŠàŠŠàŠŸàŠ¹àŠ°àŠ£àŠžà§àŠ¬àŠ°à§àŠª, `int` àŠàŠ° àŠàŠšà§àŠ¯:
+
+```Python
+item_id: int
+```
+
+àŠ
àŠ¥àŠ¬àŠŸ àŠàŠ°àŠ àŠàŠàŠ¿àŠ² `Item` àŠ®àŠ¡à§àŠ²à§àŠ° àŠàŠšà§àŠ¯:
+
+```Python
+item: Item
+```
+
+...àŠàŠ¬àŠ àŠžà§àŠ àŠàŠàŠ àŠà§àŠ·àŠ£àŠŸàŠ° àŠžàŠŸàŠ¥à§ àŠàŠªàŠšàŠ¿ àŠªàŠŸàŠ¬à§àŠš:
+
+- àŠàŠ¡àŠ¿àŠàŠ° àŠžàŠŸàŠ¹àŠŸàŠ¯à§àŠ¯, àŠ¯à§àŠ®àŠš
+ - àŠžàŠ®àŠŸàŠªà§àŠ€àŠ¿à¥€
+ - àŠ§àŠ°àŠ£ àŠ¯àŠŸàŠàŠŸàŠ
+- àŠ€àŠ¥à§àŠ¯ àŠ¯àŠŸàŠàŠŸàŠàŠàŠ°àŠ£:
+ - àŠ¡à§àŠàŠŸ àŠ
àŠ¬à§àŠ§ àŠ¹àŠ²à§ àŠžà§àŠ¬àŠ¯àŠŒàŠàŠà§àŠ°àŠ¿àŠ¯àŠŒ àŠàŠ¬àŠ àŠªàŠ°àŠ¿àŠ·à§àŠàŠŸàŠ° àŠ€à§àŠ°à§àŠàŠ¿àŠ° àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠšàŠŸà¥€
+ - àŠàŠ®àŠšàŠàŠ¿ àŠàŠà§àŠ°àŠàŠŸàŠ¬à§ àŠšà§àŠžà§àŠ àŠàŠ°àŠŸ JSON àŠ
àŠ¬àŠà§àŠà§àŠà§àŠ° àŠàŠšà§àŠ¯ àŠ¬à§àŠ§àŠ€àŠŸà¥€
+- àŠªà§àŠ°à§àŠ°àŠ¿àŠ€ àŠ€àŠ¥à§àŠ¯ àŠ°à§àŠªàŠŸàŠšà§àŠ€àŠ° : àŠ¯àŠŸ àŠšà§àŠàŠà§àŠŸàŠ°à§àŠ àŠ¥à§àŠà§ àŠªàŠŸàŠàŠ¥àŠšà§àŠ° àŠ€àŠ¥à§àŠ¯ àŠàŠ¬àŠ àŠ§àŠ°àŠšà§ àŠàŠžà§, àŠàŠ¬àŠ àŠžà§àŠàŠŸàŠš àŠ¥à§àŠà§ àŠªà§àŠŸ:
+
+ - JSONी
+ - àŠªàŠŸàŠ¥ àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ°à¥€
+ - àŠà§à§à§àŠ°àŠ¿ àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ°à¥€
+ - àŠà§àŠàŠ¿àŠ
+ - àŠ¹à§àŠ¡àŠŸàŠ°
+ - àŠ«àŠ°à§àŠ®
+ - àŠ«àŠŸàŠàŠ²
+
+- àŠàŠàŠàŠªà§àŠ àŠ¡à§àŠàŠŸàŠ° àŠ°à§àŠªàŠŸàŠšà§àŠ€àŠ° : àŠªàŠŸàŠàŠ¥àŠš àŠ¡à§àŠàŠŸ àŠàŠ¬àŠ àŠàŠŸàŠàŠª àŠ¥à§àŠà§ àŠšà§àŠàŠàŠ¯àŠŒàŠŸàŠ°à§àŠ àŠ¡à§àŠàŠŸàŠ€à§ àŠ°à§àŠªàŠŸàŠšà§àŠ€àŠ° àŠàŠ°àŠŸ (JSON àŠ¹àŠ¿àŠžàŠŸàŠ¬à§):
+ -àŠªàŠŸàŠàŠ¥àŠš àŠàŠŸàŠàŠªà§ àŠ°à§àŠªàŠŸàŠšà§àŠ€àŠ° àŠàŠ°à§àŠš (`str`, `int`, `float`, `bool`, `list`, àŠàŠ€à§àŠ¯àŠŸàŠŠàŠ¿)ी
+ - `datetime` àŠ
àŠ¬àŠà§àŠà§àŠà¥€
+ - `UUID` objeàŠ
àŠ¬àŠà§àŠà§àŠctsी
+ - àŠ¡àŠŸàŠàŠŸàŠ¬à§àŠž àŠ®àŠ¡à§àŠ²à¥€
+ - ...àŠàŠ¬àŠ àŠàŠ°à§ àŠ
àŠšà§àŠà¥€
+- àŠžà§àŠ¬àŠ¯àŠŒàŠàŠà§àŠ°àŠ¿àŠ¯àŠŒ àŠà§àŠ°àŠ¿à§àŠŸàŠ¶à§àŠ² API àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿, 2àŠàŠ¿ àŠ¬àŠ¿àŠàŠ²à§àŠª àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ°àŠàŠŸàŠ°à§àŠ° àŠàŠšà§àŠàŠŸàŠ°àŠ«à§àŠž àŠžàŠ¹:
+ - àŠžà§àŠ¯àŠŒàŠŸàŠàŠŸàŠ° àŠàŠ àŠàŠ (Swagger UI)ी
+ - àŠ°àŠ¿àŠ¡àŠ (ReDoc)ी
+
+---
+
+àŠªà§àŠ°à§àŠ¬àŠ¬àŠ°à§àŠ€à§ àŠà§àŠ¡ àŠàŠŠàŠŸàŠ¹àŠ°àŠ£à§ àŠ«àŠ¿àŠ°à§ àŠàŠžàŠŸ àŠ¯àŠŸàŠ, **FastAPI** àŠ¯àŠŸ àŠàŠ°àŠ¬à§:
+
+- `GET` àŠàŠ¬àŠ `PUT` àŠ
àŠšà§àŠ°à§àŠ§à§àŠ° àŠàŠšà§àŠ¯ àŠªàŠ¥à§ `item_id` àŠàŠà§ àŠàŠ¿àŠšàŠŸ àŠ€àŠŸ àŠ¯àŠŸàŠàŠŸàŠ àŠàŠ°àŠ¬à§à¥€
+- `GET` àŠàŠ¬àŠ `PUT` àŠ
àŠšà§àŠ°à§àŠ§à§àŠ° àŠàŠšà§àŠ¯ `item_id` àŠàŠŸàŠàŠª `int` àŠàŠ° àŠ¹àŠ€à§ àŠ¹àŠ¬à§ àŠ€àŠŸ àŠ¯àŠŸàŠàŠŸàŠ àŠàŠ°àŠ¬à§à¥€
+ - àŠ¯àŠŠàŠ¿ àŠšàŠŸ àŠ¹àŠ¯àŠŒ àŠ€àŠ¬à§ àŠà§àŠ²àŠŸàŠ¯àŠŒà§àŠšà§àŠ àŠàŠàŠàŠ¿ àŠàŠªàŠ¯à§àŠà§àŠ€, àŠªàŠ°àŠ¿àŠ·à§àŠàŠŸàŠ° àŠ€à§àŠ°à§àŠàŠ¿ àŠŠà§àŠàŠ€à§ àŠªàŠŸàŠ¬à§àŠšà¥€
+- `GET` àŠ
àŠšà§àŠ°à§àŠ§à§àŠ° àŠàŠšà§àŠ¯ àŠàŠàŠàŠ¿ àŠàŠà§àŠàŠ¿àŠ àŠà§àŠ¯à§àŠ¯àŠŒà§àŠ°àŠ¿ àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ° àŠšàŠŸàŠ®àŠ `q` (àŠ¯à§àŠ®àŠš `http://127.0.0.1:8000/items/foo?q=somequery`) àŠàŠà§ àŠàŠ¿ àŠ€àŠŸ àŠà§àŠ àŠàŠ°àŠ¬à§à¥€
+ - àŠ¯à§àŠ¹à§àŠ€à§ `q` àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ°àŠàŠ¿ `= None` àŠŠàŠ¿àŠ¯àŠŒà§ àŠà§àŠ·àŠ£àŠŸ àŠàŠ°àŠŸ àŠ¹àŠ¯àŠŒà§àŠà§, àŠ€àŠŸàŠ àŠàŠàŠ¿ àŠàŠà§àŠàŠ¿àŠà¥€
+ - `None` àŠàŠŸàŠ¡àŠŒàŠŸ àŠàŠàŠ¿ àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠšà§àŠ¯àŠŒ àŠ¹àŠ€à§ (àŠ¯à§àŠ®àŠš `PUT` àŠàŠ° àŠà§àŠ·à§àŠ€à§àŠ°à§ àŠ¹à§à§àŠà§)ी
+- `/items/{item_id}` àŠàŠ° àŠàŠšà§àŠ¯ `PUT` àŠ
àŠšà§àŠ°à§àŠ§à§àŠ° àŠ¬àŠ¡àŠ¿ JSON àŠ¹àŠ¿àŠžàŠŸàŠ¬à§ àŠªàŠ¡àŠŒà§àŠš:
+ - àŠ²àŠà§àŠ· àŠàŠ°à§àŠš, `name` àŠàŠàŠàŠ¿ àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠšà§àŠ¯àŠŒ àŠ
à§àŠ¯àŠŸàŠà§àŠ°àŠ¿àŠ¬àŠ¿àŠàŠ àŠ¹àŠ¿àŠžàŠŸàŠ¬à§ àŠ¬àŠ¿àŠ¬à§àŠàŠšàŠŸ àŠàŠ°à§àŠà§ àŠàŠ¬àŠ àŠàŠàŠ¿ `str` àŠ¹àŠ€à§ àŠ¹àŠ¬à§à¥€
+ - àŠ²àŠà§àŠ· àŠàŠ°à§àŠš àŠàŠàŠŸàŠšà§, `price` àŠ
à§àŠ¯àŠŸàŠà§àŠ°àŠ¿àŠ¬àŠ¿àŠàŠàŠàŠ¿ àŠàŠ¬àŠ¶à§àŠ¯àŠ àŠàŠ¬àŠ àŠàŠàŠ¿ `float` àŠ¹àŠ€à§ àŠ¹àŠ¬à§à¥€
+ - àŠ²àŠà§àŠ· àŠàŠ°à§àŠš `is_offer` àŠàŠàŠàŠ¿ àŠàŠà§àŠàŠ¿àŠ àŠ
à§àŠ¯àŠŸàŠà§àŠ°àŠ¿àŠ¬àŠ¿àŠàŠ àŠàŠ¬àŠ àŠàŠàŠ¿ `bool` àŠ¹àŠ€à§ àŠ¹àŠ¬à§ àŠ¯àŠŠàŠ¿ àŠàŠªàŠžà§àŠ¥àŠ¿àŠ€ àŠ¥àŠŸàŠà§à¥€
+ - àŠàŠ àŠžàŠ¬àŠàŠ¿ àŠàŠà§àŠ°àŠàŠŸàŠ¬à§ àŠ
àŠ¬àŠžà§àŠ¥àŠŸàŠšàŠ°àŠ€ JSON àŠ
àŠ¬àŠà§àŠà§àŠàŠà§àŠ²àŠ¿àŠ€à§àŠ àŠàŠŸàŠ àŠàŠ°àŠ¬à§à¥€
+- àŠžà§àŠ¬àŠ¯àŠŒàŠàŠà§àŠ°àŠ¿àŠ¯àŠŒàŠàŠŸàŠ¬à§ JSON àŠ¹àŠ€à§ àŠàŠ¬àŠ JSON àŠ¥à§àŠà§ àŠàŠšàŠàŠŸàŠ°à§àŠ àŠàŠ°à§àŠšà¥€
+- OpenAPI àŠŠàŠ¿àŠ¯àŠŒà§ àŠžàŠ¬àŠàŠ¿àŠà§ àŠ¡àŠà§àŠ®à§àŠšà§àŠ àŠàŠ°à§àŠš, àŠ¯àŠŸ àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠŸ àŠ¯à§àŠ€à§ àŠªàŠŸàŠ°à§:
+ - àŠà§àŠ°àŠ¿à§àŠŸàŠ¶à§àŠ² àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿à¥€
+ - àŠ
àŠšà§àŠ àŠàŠŸàŠ·àŠŸàŠ° àŠàŠšà§àŠ¯ àŠžà§àŠ¬àŠ¯àŠŒàŠàŠà§àŠ°àŠ¿àŠ¯àŠŒ àŠà§àŠ²àŠŸàŠ¯àŠŒà§àŠšà§àŠ àŠà§àŠ¡ àŠ€à§àŠ°àŠ¿àŠ° àŠ¬à§àŠ¯àŠ¬àŠžà§àŠ¥àŠŸà¥€
+- àŠžàŠ°àŠŸàŠžàŠ°àŠ¿ 2àŠàŠ¿ àŠà§àŠ°àŠ¿à§àŠŸàŠ¶à§àŠ² àŠšàŠ¿àŠ°à§àŠŠà§àŠ¶àŠ¿àŠàŠŸ àŠšàŠ¥àŠ¿ àŠàŠ¯àŠŒà§àŠ¬ àŠªà§àŠ·à§àŠ àŠªà§àŠ°àŠŠàŠŸàŠš àŠàŠ°àŠŸ àŠ¹à§à§àŠà§à¥€
+
+---
+
+àŠàŠ®àŠ°àŠŸ àŠàŠ€àŠà§àŠ·àŠš àŠ¶à§àŠ§à§ àŠàŠ° àŠªà§àŠ·à§àŠ àŠ€à§àŠ°àŠ¿ àŠàŠ°à§àŠàŠ¿, àŠàŠ¿àŠšà§àŠ€à§ àŠàŠªàŠšàŠ¿ àŠàŠ€àŠ®àŠ§à§àŠ¯à§àŠ àŠàŠàŠ¿ àŠàŠ¿àŠàŠŸàŠ¬à§ àŠàŠŸàŠ àŠàŠ°à§ àŠ€àŠŸàŠ° àŠ§àŠŸàŠ°àŠ£àŠŸàŠ àŠªà§à§à§ àŠàŠ¿à§à§àŠà§àŠšà¥€
+
+àŠšàŠ¿àŠ®à§àŠšà§àŠà§àŠ€ àŠ²àŠŸàŠàŠš àŠà§àŠ²à§ àŠªàŠ°àŠ¿àŠ¬àŠ°à§àŠ€àŠš àŠàŠ°àŠŸàŠ° àŠà§àŠ·à§àŠàŠŸ àŠàŠ°à§àŠš:
+
+```Python
+ return {"item_name": item.name, "item_id": item_id}
+```
+
+...àŠªà§àŠ°à§àŠ¬à§:
+
+```Python
+ ... "item_name": item.name ...
+```
+
+...àŠªàŠ°àŠ¬àŠ°à§àŠ€à§àŠ€à§:
+
+```Python
+ ... "item_price": item.price ...
+```
+
+...àŠàŠ¬àŠ àŠŠà§àŠà§àŠš àŠàŠ¿àŠàŠŸàŠ¬à§ àŠàŠªàŠšàŠŸàŠ° àŠàŠ¡àŠ¿àŠàŠ° àŠàŠªàŠŸàŠŠàŠŸàŠšàŠà§àŠ²à§àŠà§ àŠžà§àŠàŠà§àŠ°àŠ¿à§àŠàŠŸàŠ¬à§-àŠžàŠ®à§àŠªàŠšà§àŠš àŠàŠ°àŠ¬à§ àŠàŠ¬àŠ àŠ€àŠŸàŠŠà§àŠ° àŠ§àŠ°àŠš àŠàŠŸàŠšàŠ€à§ àŠªàŠŸàŠ°àŠ¬à§:
+
+![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
+
+àŠàŠ°àŠ àŠ¬à§àŠ¶àŠ¿àŠ·à§àŠà§àŠ¯ àŠžàŠ®à§àŠªàŠšà§àŠš àŠàŠŠàŠŸàŠ¹àŠ°àŠ£à§àŠ° àŠàŠšà§àŠ¯, àŠŠà§àŠà§àŠš àŠàŠ¿àŠàŠà§àŠ°àŠ¿à§àŠŸàŠ² - àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ°àŠàŠŸàŠ°à§àŠ° àŠàŠŸàŠàŠ¡ .
+
+**àŠžà§àŠªà§àŠ²àŠŸàŠ° àŠžàŠ€àŠ°à§àŠàŠ€àŠŸ**: àŠàŠ¿àŠàŠà§àŠ°àŠ¿à§àŠŸàŠ² - àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ°àŠàŠŸàŠ°à§àŠ° àŠàŠŸàŠàŠ¡ àŠšàŠ¿àŠ®à§àŠšà§àŠà§àŠ€ àŠ¬àŠ¿àŠ·à§àŠà§àŠ²àŠ¿ àŠ
àŠšà§àŠ€àŠ°à§àŠà§àŠà§àŠ€ àŠàŠ°à§:
+
+- **àŠ¹à§àŠ¡àŠŸàŠ°**, **àŠà§àŠàŠ¿àŠ**, **àŠ«àŠ°à§àŠ® àŠ«àŠ¿àŠ²à§àŠ¡** àŠàŠ¬àŠ **àŠ«àŠŸàŠàŠ²àŠà§àŠ²àŠ¿** àŠàŠ®àŠš àŠ
àŠšà§àŠ¯àŠŸàŠšà§àŠ¯ àŠàŠŸà§àŠàŠŸ àŠ¥à§àŠà§ àŠªà§àŠ¯àŠŸàŠ°àŠŸàŠ®àŠ¿àŠàŠŸàŠ° àŠà§àŠ·àŠ£àŠŸ àŠàŠ°àŠŸà¥€
+- `maximum_length` àŠ¬àŠŸ `regex` àŠàŠ° àŠ®àŠ€à§ **àŠ¯àŠŸàŠàŠŸàŠàŠàŠ°àŠ£ àŠ¬àŠŸàŠ§àŠŸàŠ®à§àŠà§àŠ€àŠ¿** àŠžà§àŠ àŠàŠ°àŠŸ àŠ¹àŠ¯àŠŒ àŠàŠ¿àŠàŠŸàŠ¬à§, àŠ€àŠŸ àŠšàŠ¿à§à§ àŠàŠ²à§àŠàŠšàŠŸ àŠàŠ°àŠŸ àŠ¹àŠ¬à§à¥€
+- àŠàŠàŠàŠ¿ àŠà§àŠ¬ àŠ¶àŠà§àŠ€àŠ¿àŠ¶àŠŸàŠ²à§ àŠàŠ¬àŠ àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠŸ àŠžàŠ¹àŠ àŠ¡àŠ¿àŠªà§àŠšà§àŠ¡à§àŠšà§àŠžàŠ¿ àŠàŠšàŠà§àŠàŠ¶àŠš àŠªàŠŠà§àŠ§àŠ€àŠ¿
+- **OAuth2** àŠàŠ¬àŠ **JWT àŠà§àŠà§àŠš** àŠàŠ¬àŠ **HTTP Basic** auth àŠžàŠ¹ àŠšàŠ¿àŠ°àŠŸàŠªàŠ€à§àŠ€àŠŸ àŠàŠ¬àŠ àŠ
àŠšà§àŠ®à§àŠŠàŠšàŠªà§àŠ°àŠŸàŠªà§àŠ€àŠ¿ àŠžàŠ®à§àŠªàŠ°à§àŠàŠ¿àŠ€ àŠ¬àŠ¿àŠ·à§àŠžàŠ®à§àŠ¹à§àŠ° àŠàŠªàŠ°à¥€
+- **àŠàŠà§àŠ°àŠàŠŸàŠ¬à§ àŠ
àŠ¬àŠžà§àŠ¥àŠŸàŠšàŠ°àŠ€ JSON àŠ®àŠ¡à§àŠ²** àŠà§àŠ·àŠ£àŠŸ àŠàŠ°àŠŸàŠ° àŠàŠšà§àŠ¯ àŠàŠ°àŠ àŠàŠšà§àŠšàŠ€ (àŠàŠ¿àŠšà§àŠ€à§ àŠžàŠ®àŠŸàŠš àŠžàŠ¹àŠ) àŠà§àŠ¶àŠ² (Pydantic àŠà§ àŠ§àŠšà§àŠ¯àŠ¬àŠŸàŠŠ)ी
+- àŠàŠ°à§ àŠ
àŠ€àŠ¿àŠ°àŠ¿àŠà§àŠ€ àŠ¬à§àŠ¶àŠ¿àŠ·à§àŠà§àŠ¯ (àŠžà§àŠàŠŸàŠ°àŠ²à§àŠàŠà§ àŠ§àŠšà§àŠ¯àŠ¬àŠŸàŠŠ) àŠ¹àŠ¿àŠžàŠŸàŠ¬à§:
+ - **WebSockets**
+ - **GraphQL**
+ - HTTPX àŠàŠ¬àŠ `pytest` àŠàŠ¿àŠ€à§àŠ€àŠ¿àŠ àŠ
àŠ€à§àŠ¯àŠšà§àŠ€ àŠžàŠ¹àŠ àŠªàŠ°à§àŠà§àŠ·àŠŸ
+ - **CORS**
+ - **Cookie Sessions**
+ - ...àŠàŠ¬àŠ àŠàŠ°à§à¥€
+
+## àŠàŠ°à§àŠ®àŠà§àŠ·àŠ®àŠ€àŠŸ
+
+àŠžà§àŠ¬àŠŸàŠ§à§àŠš TechEmpower Benchmarks àŠŠà§àŠàŠŸàŠ¯àŠŒ àŠ¯à§ **FastAPI** àŠ
à§àŠ¯àŠŸàŠªà§àŠ²àŠ¿àŠà§àŠ¶àŠšàŠà§àŠ²àŠ¿ Uvicorn-àŠàŠ° àŠ
àŠ§à§àŠšà§ àŠàŠ²àŠ®àŠŸàŠš àŠŠà§àŠ°à§àŠ€àŠ€àŠ®àŠªàŠŸàŠàŠ¥àŠš àŠ«à§àŠ°à§àŠ®àŠàŠ¯àŠŒàŠŸàŠ°à§àŠàŠà§àŠ²àŠ¿àŠ° àŠ®àŠ§à§àŠ¯à§ àŠàŠàŠàŠ¿, àŠ¶à§àŠ§à§àŠ®àŠŸàŠ€à§àŠ° Starlette àŠàŠ¬àŠ Uvicorn-àŠàŠ° àŠªàŠ° (FastAPI àŠŠà§àŠ¬àŠŸàŠ°àŠŸ àŠ
àŠà§àŠ¯àŠšà§àŠ€àŠ°à§àŠ£àŠàŠŸàŠ¬à§ àŠ¬à§àŠ¯àŠ¬àŠ¹à§àŠ€)ी (\*)
+
+àŠàŠàŠ¿ àŠžàŠ®à§àŠªàŠ°à§àŠà§ àŠàŠ°àŠ àŠ¬à§àŠàŠ€à§, àŠŠà§àŠà§àŠš Benchmarks .
+
+## àŠàŠà§àŠàŠ¿àŠ àŠšàŠ¿àŠ°à§àŠàŠ°àŠ¶à§àŠ²àŠ€àŠŸ
+
+Pydantic àŠŠà§àŠ¬àŠŸàŠ°àŠŸ àŠ¬à§àŠ¯àŠ¬àŠ¹à§àŠ€:
+
+- ujson
- àŠŠà§àŠ°à§àŠ€ JSON àŠàŠ° àŠàŠšà§àŠ¯ "parsing" .
+- email_validator
- àŠàŠ®à§àŠ² àŠ¯àŠŸàŠàŠŸàŠàŠàŠ°àŠ£à§àŠ° àŠàŠšà§àŠ¯à¥€
+
+àŠžà§àŠàŠŸàŠ°àŠ²à§àŠ àŠŠà§àŠ¬àŠŸàŠ°àŠŸ àŠ¬à§àŠ¯àŠ¬àŠ¹à§àŠ€:
+
+- httpx
- àŠàŠªàŠšàŠ¿ àŠ¯àŠŠàŠ¿ `TestClient` àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠ€à§ àŠàŠŸàŠš àŠ€àŠŸàŠ¹àŠ²à§ àŠàŠ¬àŠ¶à§àŠ¯àŠà¥€
+- jinja2
- àŠàŠªàŠšàŠ¿ àŠ¯àŠŠàŠ¿ àŠªà§àŠ°àŠŠàŠ€à§àŠ€ àŠà§àŠ®àŠªà§àŠ²à§àŠ àŠ°à§àŠªàŠ°à§àŠàŠŸ àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠ€à§ àŠàŠŸàŠš àŠ€àŠŸàŠ¹àŠ²à§ àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠšà¥€
+- python-multipart
- àŠàŠªàŠšàŠ¿ àŠ¯àŠŠàŠ¿ àŠ«àŠ°à§àŠ® àŠžàŠ¹àŠŸàŠ¯àŠŒàŠ€àŠŸ àŠàŠ°àŠ€à§ àŠàŠŸàŠš àŠ€àŠŸàŠ¹àŠ²à§ àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠš "parsing" , `request.form()` àŠžàŠ¹à¥€
+- itsdangerous
- `SessionMiddleware` àŠžàŠ¹àŠŸàŠ¯àŠŒàŠ€àŠŸàŠ° àŠàŠšà§àŠ¯ àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠšà¥€
+- pyyaml
- àŠžà§àŠàŠŸàŠ°àŠ²à§àŠà§àŠ° SchemaGenerator àŠžàŠŸàŠªà§àŠ°à§àŠ àŠàŠ° àŠàŠšà§àŠ¯ àŠªà§àŠ°à§à§àŠàŠš (àŠàŠªàŠšàŠŸàŠ° àŠžàŠ®à§àŠàŠŸàŠ¬àŠ€ FastAPI àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠš àŠšà§àŠ)ी
+- graphene
- `GraphQLApp` àŠžàŠ¹àŠŸàŠ¯àŠŒàŠ€àŠŸàŠ° àŠàŠšà§àŠ¯ àŠªà§àŠ°à§à§àŠàŠšà¥€
+- ujson
- àŠàŠªàŠšàŠ¿ `UJSONResponse` àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠ€à§ àŠàŠŸàŠàŠ²à§ àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠšà¥€
+
+FastAPI / Starlette àŠŠà§àŠ¬àŠŸàŠ°àŠŸ àŠ¬à§àŠ¯àŠ¬àŠ¹à§àŠ€:
+
+- uvicorn
- àŠžàŠŸàŠ°à§àŠàŠŸàŠ°à§àŠ° àŠàŠšà§àŠ¯ àŠ¯àŠŸ àŠàŠªàŠšàŠŸàŠ° àŠ
à§àŠ¯àŠŸàŠªà§àŠ²àŠ¿àŠà§àŠ¶àŠš àŠ²à§àŠ¡ àŠàŠ°à§ àŠàŠ¬àŠ àŠªàŠ°àŠ¿àŠ¬à§àŠ¶àŠš àŠàŠ°à§à¥€
+- orjson
- àŠàŠªàŠšàŠ¿ `ORJSONResponse` àŠ¬à§àŠ¯àŠ¬àŠ¹àŠŸàŠ° àŠàŠ°àŠ€à§ àŠàŠŸàŠàŠ²à§ àŠªà§àŠ°àŠ¯àŠŒà§àŠàŠšà¥€
+
+àŠàŠªàŠšàŠ¿ àŠàŠ àŠžàŠ¬ àŠàŠšàŠžà§àŠàŠ² àŠàŠ°àŠ€à§ àŠªàŠŸàŠ°à§àŠš `pip install fastapi[all]` àŠŠàŠ¿à§à§.
+
+## àŠ²àŠŸàŠàŠžà§àŠšà§àŠž
+
+àŠàŠ àŠªà§àŠ°àŠà§àŠà§àŠ MIT àŠ²àŠŸàŠàŠžà§àŠšà§àŠž àŠšà§àŠ€àŠ¿àŠ®àŠŸàŠ²àŠŸàŠ° àŠ
àŠ§à§àŠšà§ àŠ¶àŠ°à§àŠ€àŠŸà§àŠ¿àŠ€à¥€
diff --git a/docs/bn/mkdocs.yml b/docs/bn/mkdocs.yml
new file mode 100644
index 0000000000000..de18856f445aa
--- /dev/null
+++ b/docs/bn/mkdocs.yml
@@ -0,0 +1 @@
+INHERIT: ../en/mkdocs.yml
From 1cd23a1dbce8f2fd7f15ece57c3cd45a2cb04cac Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 10 Jan 2024 17:43:56 +0000
Subject: [PATCH 110/217] =?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 6885ef68d7e4a..f3c70489b6782 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -26,6 +26,7 @@ hide:
### Translations
+* ð Add Bengali translation for `docs/bn/docs/index.md`. PR [#9177](https://github.com/tiangolo/fastapi/pull/9177) by [@Fahad-Md-Kamal](https://github.com/Fahad-Md-Kamal).
* âïž Update Python version in `index.md` in several languages. PR [#10711](https://github.com/tiangolo/fastapi/pull/10711) by [@tamago3keran](https://github.com/tamago3keran).
* ð Add Russian translation for `docs/ru/docs/tutorial/request-forms-and-files.md`. PR [#10347](https://github.com/tiangolo/fastapi/pull/10347) by [@AlertRED](https://github.com/AlertRED).
* ð Add Ukrainian translation for `docs/uk/docs/index.md`. PR [#10362](https://github.com/tiangolo/fastapi/pull/10362) by [@rostik1410](https://github.com/rostik1410).
From 843bc85155be86d7688ab126bb7ea266d410bf71 Mon Sep 17 00:00:00 2001
From: Sungyun Hur
Date: Thu, 11 Jan 2024 03:15:04 +0900
Subject: [PATCH 111/217] =?UTF-8?q?=F0=9F=93=9D=20Fix=20broken=20link=20in?=
=?UTF-8?q?=20`docs/en/docs/tutorial/sql-databases.md`=20(#10765)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
---
docs/en/docs/tutorial/sql-databases.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/en/docs/tutorial/sql-databases.md b/docs/en/docs/tutorial/sql-databases.md
index 010244bbf6f14..ce6507912252e 100644
--- a/docs/en/docs/tutorial/sql-databases.md
+++ b/docs/en/docs/tutorial/sql-databases.md
@@ -624,7 +624,7 @@ def read_user(user_id: int, db: Session = Depends(get_db)):
```
!!! info
- If you need to connect to your relational database asynchronously, see [Async SQL (Relational) Databases](../advanced/async-sql-databases.md){.internal-link target=_blank}.
+ If you need to connect to your relational database asynchronously, see [Async SQL (Relational) Databases](../how-to/async-sql-encode-databases.md){.internal-link target=_blank}.
!!! note "Very Technical Details"
If you are curious and have a deep technical knowledge, you can check the very technical details of how this `async def` vs `def` is handled in the [Async](../async.md#very-technical-details){.internal-link target=_blank} docs.
From 1334485435ce0e934a965b23912654baab5d861d Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 10 Jan 2024 18:15:28 +0000
Subject: [PATCH 112/217] =?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 f3c70489b6782..b0a6c8dc6f38a 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Fix broken link in `docs/en/docs/tutorial/sql-databases.md`. PR [#10765](https://github.com/tiangolo/fastapi/pull/10765) by [@HurSungYun](https://github.com/HurSungYun).
* ð Add External Link: FastAPI application monitoring made easy. PR [#10917](https://github.com/tiangolo/fastapi/pull/10917) by [@tiangolo](https://github.com/tiangolo).
* âš Generate automatic language names for docs translations. PR [#5354](https://github.com/tiangolo/fastapi/pull/5354) by [@jakul](https://github.com/jakul).
* âïž Fix typos in `docs/en/docs/alternatives.md` and `docs/en/docs/tutorial/dependencies/index.md`. PR [#10906](https://github.com/tiangolo/fastapi/pull/10906) by [@s111d](https://github.com/s111d).
From b584faffee11bfc08bea3bd2d66c304701b921d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Wed, 10 Jan 2024 23:13:55 +0400
Subject: [PATCH 113/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20notes=20about=20Py?=
=?UTF-8?q?dantic=20v2's=20new=20`.model=5Fdump()`=20(#10929)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../docs/how-to/async-sql-encode-databases.md | 5 +++++
docs/en/docs/tutorial/body-updates.md | 20 ++++++++++++++-----
docs/en/docs/tutorial/extra-models.md | 5 +++++
docs/en/docs/tutorial/response-model.md | 5 +++++
docs/en/docs/tutorial/sql-databases.md | 5 +++++
5 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/docs/en/docs/how-to/async-sql-encode-databases.md b/docs/en/docs/how-to/async-sql-encode-databases.md
index 697167f790267..0e2ccce78dbc3 100644
--- a/docs/en/docs/how-to/async-sql-encode-databases.md
+++ b/docs/en/docs/how-to/async-sql-encode-databases.md
@@ -114,6 +114,11 @@ Create the *path operation function* to create notes:
{!../../../docs_src/async_sql_databases/tutorial001.py!}
```
+!!! info
+ In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
+
+ The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
+
!!! Note
Notice that as we communicate with the database using `await`, the *path operation function* is declared with `async`.
diff --git a/docs/en/docs/tutorial/body-updates.md b/docs/en/docs/tutorial/body-updates.md
index 3341f2d5d88b4..39d133c55f3dd 100644
--- a/docs/en/docs/tutorial/body-updates.md
+++ b/docs/en/docs/tutorial/body-updates.md
@@ -59,9 +59,14 @@ This means that you can send only the data that you want to update, leaving the
### Using Pydantic's `exclude_unset` parameter
-If you want to receive partial updates, it's very useful to use the parameter `exclude_unset` in Pydantic's model's `.dict()`.
+If you want to receive partial updates, it's very useful to use the parameter `exclude_unset` in Pydantic's model's `.model_dump()`.
-Like `item.dict(exclude_unset=True)`.
+Like `item.model_dump(exclude_unset=True)`.
+
+!!! info
+ In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
+
+ The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
That would generate a `dict` with only the data that was set when creating the `item` model, excluding default values.
@@ -87,9 +92,14 @@ Then you can use this to generate a `dict` with only the data that was set (sent
### Using Pydantic's `update` parameter
-Now, you can create a copy of the existing model using `.copy()`, and pass the `update` parameter with a `dict` containing the data to update.
+Now, you can create a copy of the existing model using `.model_copy()`, and pass the `update` parameter with a `dict` containing the data to update.
+
+!!! info
+ In Pydantic v1 the method was called `.copy()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_copy()`.
+
+ The examples here use `.copy()` for compatibility with Pydantic v1, but you should use `.model_copy()` instead if you can use Pydantic v2.
-Like `stored_item_model.copy(update=update_data)`:
+Like `stored_item_model.model_copy(update=update_data)`:
=== "Python 3.10+"
@@ -120,7 +130,7 @@ In summary, to apply partial updates you would:
* This way you can update only the values actually set by the user, instead of overriding values already stored with default values in your model.
* Create a copy of the stored model, updating it's attributes with the received partial updates (using the `update` parameter).
* Convert the copied model to something that can be stored in your DB (for example, using the `jsonable_encoder`).
- * This is comparable to using the model's `.dict()` method again, but it makes sure (and converts) the values to data types that can be converted to JSON, for example, `datetime` to `str`.
+ * This is comparable to using the model's `.model_dump()` method again, but it makes sure (and converts) the values to data types that can be converted to JSON, for example, `datetime` to `str`.
* Save the data to your DB.
* Return the updated model.
diff --git a/docs/en/docs/tutorial/extra-models.md b/docs/en/docs/tutorial/extra-models.md
index 590d095bd2457..d83b6bc8594bb 100644
--- a/docs/en/docs/tutorial/extra-models.md
+++ b/docs/en/docs/tutorial/extra-models.md
@@ -29,6 +29,11 @@ Here's a general idea of how the models could look like with their password fiel
{!> ../../../docs_src/extra_models/tutorial001.py!}
```
+!!! info
+ In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
+
+ The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
+
### About `**user_in.dict()`
#### Pydantic's `.dict()`
diff --git a/docs/en/docs/tutorial/response-model.md b/docs/en/docs/tutorial/response-model.md
index d6d3d61cb4b24..d5683ac7f2e8a 100644
--- a/docs/en/docs/tutorial/response-model.md
+++ b/docs/en/docs/tutorial/response-model.md
@@ -377,6 +377,11 @@ So, if you send a request to that *path operation* for the item with ID `foo`, t
}
```
+!!! info
+ In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
+
+ The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
+
!!! info
FastAPI uses Pydantic model's `.dict()` with its `exclude_unset` parameter to achieve this.
diff --git a/docs/en/docs/tutorial/sql-databases.md b/docs/en/docs/tutorial/sql-databases.md
index ce6507912252e..1bc87a702d1b8 100644
--- a/docs/en/docs/tutorial/sql-databases.md
+++ b/docs/en/docs/tutorial/sql-databases.md
@@ -451,6 +451,11 @@ The steps are:
{!../../../docs_src/sql_databases/sql_app/crud.py!}
```
+!!! info
+ In Pydantic v1 the method was called `.dict()`, it was deprecated (but still supported) in Pydantic v2, and renamed to `.model_dump()`.
+
+ The examples here use `.dict()` for compatibility with Pydantic v1, but you should use `.model_dump()` instead if you can use Pydantic v2.
+
!!! tip
The SQLAlchemy model for `User` contains a `hashed_password` that should contain a secure hashed version of the password.
From 91d7fb6d255156a753108b4f762a4f12b8861961 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 10 Jan 2024 19:14:15 +0000
Subject: [PATCH 114/217] =?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 b0a6c8dc6f38a..ab64e33d0ae84 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add notes about Pydantic v2's new `.model_dump()`. PR [#10929](https://github.com/tiangolo/fastapi/pull/10929) by [@tiangolo](https://github.com/tiangolo).
* ð Fix broken link in `docs/en/docs/tutorial/sql-databases.md`. PR [#10765](https://github.com/tiangolo/fastapi/pull/10765) by [@HurSungYun](https://github.com/HurSungYun).
* ð Add External Link: FastAPI application monitoring made easy. PR [#10917](https://github.com/tiangolo/fastapi/pull/10917) by [@tiangolo](https://github.com/tiangolo).
* âš Generate automatic language names for docs translations. PR [#5354](https://github.com/tiangolo/fastapi/pull/5354) by [@jakul](https://github.com/jakul).
From 07f8d31ec9d6e2234e12515f3373f57020b1726d Mon Sep 17 00:00:00 2001
From: Aliaksei Urbanski
Date: Wed, 10 Jan 2024 23:55:45 +0300
Subject: [PATCH 115/217] =?UTF-8?q?=E2=9C=A8=20Add=20support=20for=20Pytho?=
=?UTF-8?q?n=203.12=20(#10666)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
.github/workflows/test.yml | 7 ++++++-
docs_src/security/tutorial004.py | 6 +++---
docs_src/security/tutorial004_an.py | 6 +++---
docs_src/security/tutorial004_an_py310.py | 6 +++---
docs_src/security/tutorial004_an_py39.py | 6 +++---
docs_src/security/tutorial004_py310.py | 6 +++---
docs_src/security/tutorial005.py | 6 +++---
docs_src/security/tutorial005_an.py | 6 +++---
docs_src/security/tutorial005_an_py310.py | 6 +++---
docs_src/security/tutorial005_an_py39.py | 6 +++---
docs_src/security/tutorial005_py310.py | 6 +++---
docs_src/security/tutorial005_py39.py | 6 +++---
pyproject.toml | 10 ++++++++++
13 files changed, 49 insertions(+), 34 deletions(-)
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index 7ebb80efdfc99..032db9c9c85b4 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -42,7 +42,12 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
- python-version: ["3.8", "3.9", "3.10", "3.11"]
+ python-version:
+ - "3.12"
+ - "3.11"
+ - "3.10"
+ - "3.9"
+ - "3.8"
pydantic-version: ["pydantic-v1", "pydantic-v2"]
fail-fast: false
steps:
diff --git a/docs_src/security/tutorial004.py b/docs_src/security/tutorial004.py
index 64099abe9cffe..134c15c5a0369 100644
--- a/docs_src/security/tutorial004.py
+++ b/docs_src/security/tutorial004.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from typing import Union
from fastapi import Depends, FastAPI, HTTPException, status
@@ -78,9 +78,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial004_an.py b/docs_src/security/tutorial004_an.py
index ca350343d2082..204151a566485 100644
--- a/docs_src/security/tutorial004_an.py
+++ b/docs_src/security/tutorial004_an.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from typing import Union
from fastapi import Depends, FastAPI, HTTPException, status
@@ -79,9 +79,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial004_an_py310.py b/docs_src/security/tutorial004_an_py310.py
index 8bf5f3b7185cd..64dfa15c62718 100644
--- a/docs_src/security/tutorial004_an_py310.py
+++ b/docs_src/security/tutorial004_an_py310.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from typing import Annotated
from fastapi import Depends, FastAPI, HTTPException, status
@@ -78,9 +78,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: timedelta | None = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial004_an_py39.py b/docs_src/security/tutorial004_an_py39.py
index a634e23de9843..631a8366eb81b 100644
--- a/docs_src/security/tutorial004_an_py39.py
+++ b/docs_src/security/tutorial004_an_py39.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from typing import Annotated, Union
from fastapi import Depends, FastAPI, HTTPException, status
@@ -78,9 +78,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial004_py310.py b/docs_src/security/tutorial004_py310.py
index 797d56d0431ab..470f22e29f03b 100644
--- a/docs_src/security/tutorial004_py310.py
+++ b/docs_src/security/tutorial004_py310.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from fastapi import Depends, FastAPI, HTTPException, status
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
@@ -77,9 +77,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: timedelta | None = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial005.py b/docs_src/security/tutorial005.py
index bd0a33581c21c..ece461bc8ac36 100644
--- a/docs_src/security/tutorial005.py
+++ b/docs_src/security/tutorial005.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from typing import List, Union
from fastapi import Depends, FastAPI, HTTPException, Security, status
@@ -93,9 +93,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial005_an.py b/docs_src/security/tutorial005_an.py
index ec4fa1a07e2cd..c5b5609e525e0 100644
--- a/docs_src/security/tutorial005_an.py
+++ b/docs_src/security/tutorial005_an.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from typing import List, Union
from fastapi import Depends, FastAPI, HTTPException, Security, status
@@ -94,9 +94,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial005_an_py310.py b/docs_src/security/tutorial005_an_py310.py
index 45f3fc0bd6de1..5e81a50e12d63 100644
--- a/docs_src/security/tutorial005_an_py310.py
+++ b/docs_src/security/tutorial005_an_py310.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from typing import Annotated
from fastapi import Depends, FastAPI, HTTPException, Security, status
@@ -93,9 +93,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: timedelta | None = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial005_an_py39.py b/docs_src/security/tutorial005_an_py39.py
index ecb5ed5160d86..ae9811c689f5b 100644
--- a/docs_src/security/tutorial005_an_py39.py
+++ b/docs_src/security/tutorial005_an_py39.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from typing import Annotated, List, Union
from fastapi import Depends, FastAPI, HTTPException, Security, status
@@ -93,9 +93,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial005_py310.py b/docs_src/security/tutorial005_py310.py
index ba756ef4f4d67..0fcdda4c004c6 100644
--- a/docs_src/security/tutorial005_py310.py
+++ b/docs_src/security/tutorial005_py310.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from fastapi import Depends, FastAPI, HTTPException, Security, status
from fastapi.security import (
@@ -92,9 +92,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: timedelta | None = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/docs_src/security/tutorial005_py39.py b/docs_src/security/tutorial005_py39.py
index 9e4dbcffba38d..d756c0b6b87f9 100644
--- a/docs_src/security/tutorial005_py39.py
+++ b/docs_src/security/tutorial005_py39.py
@@ -1,4 +1,4 @@
-from datetime import datetime, timedelta
+from datetime import datetime, timedelta, timezone
from typing import Union
from fastapi import Depends, FastAPI, HTTPException, Security, status
@@ -93,9 +93,9 @@ def authenticate_user(fake_db, username: str, password: str):
def create_access_token(data: dict, expires_delta: Union[timedelta, None] = None):
to_encode = data.copy()
if expires_delta:
- expire = datetime.utcnow() + expires_delta
+ expire = datetime.now(timezone.utc) + expires_delta
else:
- expire = datetime.utcnow() + timedelta(minutes=15)
+ expire = datetime.now(timezone.utc) + timedelta(minutes=15)
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, SECRET_KEY, algorithm=ALGORITHM)
return encoded_jwt
diff --git a/pyproject.toml b/pyproject.toml
index 38728d99e945b..2fde7553a8759 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -36,6 +36,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
+ "Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
"Topic :: Internet :: WWW/HTTP",
]
@@ -111,6 +112,15 @@ filterwarnings = [
"ignore::trio.TrioDeprecationWarning",
# TODO remove pytest-cov
'ignore::pytest.PytestDeprecationWarning:pytest_cov',
+ # TODO: remove after upgrading SQLAlchemy to a version that includes the following changes
+ # https://github.com/sqlalchemy/sqlalchemy/commit/59521abcc0676e936b31a523bd968fc157fef0c2
+ 'ignore:datetime\.datetime\.utcfromtimestamp\(\) is deprecated and scheduled for removal in a future version\..*:DeprecationWarning:sqlalchemy',
+ # TODO: remove after upgrading python-jose to a version that explicitly supports Python 3.12
+ # also, if it won't receive an update, consider replacing python-jose with some alternative
+ # related issues:
+ # - https://github.com/mpdavis/python-jose/issues/332
+ # - https://github.com/mpdavis/python-jose/issues/334
+ 'ignore:datetime\.datetime\.utcnow\(\) is deprecated and scheduled for removal in a future version\..*:DeprecationWarning:jose',
]
[tool.coverage.run]
From 21145d8e9f896502ae227678c63467fb00384cfa Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 10 Jan 2024 20:56:59 +0000
Subject: [PATCH 116/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index ab64e33d0ae84..25219b32800af 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,10 @@ hide:
## Latest Changes
+### Features
+
+* âš Add support for Python 3.12. PR [#10666](https://github.com/tiangolo/fastapi/pull/10666) by [@Jamim](https://github.com/Jamim).
+
### Docs
* ð Add notes about Pydantic v2's new `.model_dump()`. PR [#10929](https://github.com/tiangolo/fastapi/pull/10929) by [@tiangolo](https://github.com/tiangolo).
From 135dcba746cdaf2b4726f4f10fad9eb8bb91e342 Mon Sep 17 00:00:00 2001
From: Nils Lindemann
Date: Wed, 10 Jan 2024 22:00:32 +0100
Subject: [PATCH 117/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20VS=20Code=20tutori?=
=?UTF-8?q?al=20link=20(#10592)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/en/data/external_links.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index d9cfe3431d093..f15560d1b6a8b 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -1,5 +1,9 @@
Articles:
English:
+ - author: Visual Studio Code Team
+ author_link: https://code.visualstudio.com/
+ link: https://code.visualstudio.com/docs/python/tutorial-fastapi
+ title: FastAPI Tutorial in Visual Studio Code
- author: Apitally
author_link: https://apitally.io
link: https://blog.apitally.io/fastapi-application-monitoring-made-easy
From 0da980cb0b73c8cb5713d95d44620c41c0a29b5d Mon Sep 17 00:00:00 2001
From: github-actions
Date: Wed, 10 Jan 2024 21:00:51 +0000
Subject: [PATCH 118/217] =?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 25219b32800af..b523be75dfc7c 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -13,6 +13,7 @@ hide:
### Docs
+* ð Add VS Code tutorial link. PR [#10592](https://github.com/tiangolo/fastapi/pull/10592) by [@nilslindemann](https://github.com/nilslindemann).
* ð Add notes about Pydantic v2's new `.model_dump()`. PR [#10929](https://github.com/tiangolo/fastapi/pull/10929) by [@tiangolo](https://github.com/tiangolo).
* ð Fix broken link in `docs/en/docs/tutorial/sql-databases.md`. PR [#10765](https://github.com/tiangolo/fastapi/pull/10765) by [@HurSungYun](https://github.com/HurSungYun).
* ð Add External Link: FastAPI application monitoring made easy. PR [#10917](https://github.com/tiangolo/fastapi/pull/10917) by [@tiangolo](https://github.com/tiangolo).
From 69cb005f61239a378a7e0715cc5e3ff4b713ab4d Mon Sep 17 00:00:00 2001
From: Nils Lindemann
Date: Thu, 11 Jan 2024 15:33:05 +0100
Subject: [PATCH 119/217] =?UTF-8?q?=F0=9F=93=9D=20Replace=20`email`=20with?=
=?UTF-8?q?=20`username`=20in=20`docs=5Fsrc/security/tutorial007`=20code?=
=?UTF-8?q?=20examples=20(#10649)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/advanced/security/http-basic-auth.md | 6 +++---
docs_src/security/tutorial007.py | 2 +-
docs_src/security/tutorial007_an.py | 2 +-
docs_src/security/tutorial007_an_py39.py | 2 +-
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/docs/en/docs/advanced/security/http-basic-auth.md b/docs/en/docs/advanced/security/http-basic-auth.md
index 6f9002f608022..680f4dff53e6c 100644
--- a/docs/en/docs/advanced/security/http-basic-auth.md
+++ b/docs/en/docs/advanced/security/http-basic-auth.md
@@ -105,7 +105,7 @@ if "johndoe" == "stanleyjobson" and "love123" == "swordfish":
...
```
-But right at the moment Python compares the first `j` in `johndoe` to the first `s` in `stanleyjobson`, it will return `False`, because it already knows that those two strings are not the same, thinking that "there's no need to waste more computation comparing the rest of the letters". And your application will say "incorrect user or password".
+But right at the moment Python compares the first `j` in `johndoe` to the first `s` in `stanleyjobson`, it will return `False`, because it already knows that those two strings are not the same, thinking that "there's no need to waste more computation comparing the rest of the letters". And your application will say "Incorrect username or password".
But then the attackers try with username `stanleyjobsox` and password `love123`.
@@ -116,11 +116,11 @@ if "stanleyjobsox" == "stanleyjobson" and "love123" == "swordfish":
...
```
-Python will have to compare the whole `stanleyjobso` in both `stanleyjobsox` and `stanleyjobson` before realizing that both strings are not the same. So it will take some extra microseconds to reply back "incorrect user or password".
+Python will have to compare the whole `stanleyjobso` in both `stanleyjobsox` and `stanleyjobson` before realizing that both strings are not the same. So it will take some extra microseconds to reply back "Incorrect username or password".
#### The time to answer helps the attackers
-At that point, by noticing that the server took some microseconds longer to send the "incorrect user or password" response, the attackers will know that they got _something_ right, some of the initial letters were right.
+At that point, by noticing that the server took some microseconds longer to send the "Incorrect username or password" response, the attackers will know that they got _something_ right, some of the initial letters were right.
And then they can try again knowing that it's probably something more similar to `stanleyjobsox` than to `johndoe`.
diff --git a/docs_src/security/tutorial007.py b/docs_src/security/tutorial007.py
index 790ee10bc6b1d..ac816eb0c19d2 100644
--- a/docs_src/security/tutorial007.py
+++ b/docs_src/security/tutorial007.py
@@ -22,7 +22,7 @@ def get_current_username(credentials: HTTPBasicCredentials = Depends(security)):
if not (is_correct_username and is_correct_password):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
- detail="Incorrect email or password",
+ detail="Incorrect username or password",
headers={"WWW-Authenticate": "Basic"},
)
return credentials.username
diff --git a/docs_src/security/tutorial007_an.py b/docs_src/security/tutorial007_an.py
index 5fb7c8e57560c..9e9c3cd7020f0 100644
--- a/docs_src/security/tutorial007_an.py
+++ b/docs_src/security/tutorial007_an.py
@@ -25,7 +25,7 @@ def get_current_username(
if not (is_correct_username and is_correct_password):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
- detail="Incorrect email or password",
+ detail="Incorrect username or password",
headers={"WWW-Authenticate": "Basic"},
)
return credentials.username
diff --git a/docs_src/security/tutorial007_an_py39.py b/docs_src/security/tutorial007_an_py39.py
index 17177dabf9e47..3d9ea27269eed 100644
--- a/docs_src/security/tutorial007_an_py39.py
+++ b/docs_src/security/tutorial007_an_py39.py
@@ -25,7 +25,7 @@ def get_current_username(
if not (is_correct_username and is_correct_password):
raise HTTPException(
status_code=status.HTTP_401_UNAUTHORIZED,
- detail="Incorrect email or password",
+ detail="Incorrect username or password",
headers={"WWW-Authenticate": "Basic"},
)
return credentials.username
From 5b1e6865c50207ad24d26b55f3577b5c3b8244b3 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 14:33:27 +0000
Subject: [PATCH 120/217] =?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 b523be75dfc7c..f95ccff5672b1 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -13,6 +13,7 @@ hide:
### Docs
+* ð Replace `email` with `username` in `docs_src/security/tutorial007` code examples. PR [#10649](https://github.com/tiangolo/fastapi/pull/10649) by [@nilslindemann](https://github.com/nilslindemann).
* ð Add VS Code tutorial link. PR [#10592](https://github.com/tiangolo/fastapi/pull/10592) by [@nilslindemann](https://github.com/nilslindemann).
* ð Add notes about Pydantic v2's new `.model_dump()`. PR [#10929](https://github.com/tiangolo/fastapi/pull/10929) by [@tiangolo](https://github.com/tiangolo).
* ð Fix broken link in `docs/en/docs/tutorial/sql-databases.md`. PR [#10765](https://github.com/tiangolo/fastapi/pull/10765) by [@HurSungYun](https://github.com/HurSungYun).
From c46eba8004cc688ebfb4d9bf4074ccc8c6f0ca3e Mon Sep 17 00:00:00 2001
From: s111d
Date: Thu, 11 Jan 2024 17:33:57 +0300
Subject: [PATCH 121/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Fix=20typo=20in=20?=
=?UTF-8?q?`docs/en/docs/alternatives.md`=20(#10931)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
---
docs/en/docs/alternatives.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/en/docs/alternatives.md b/docs/en/docs/alternatives.md
index e02b3b55a113b..70bbcac91c3cb 100644
--- a/docs/en/docs/alternatives.md
+++ b/docs/en/docs/alternatives.md
@@ -191,7 +191,7 @@ This solved having to write YAML (another syntax) inside of Python docstrings.
This combination of Flask, Flask-apispec with Marshmallow and Webargs was my favorite backend stack until building **FastAPI**.
-Using it led to the creation of several Flask full-stack generators. These are the main stack I (and several external teams) have been using up to now:
+Using it led to the creation of several Flask full-stack generators. These are the main stacks I (and several external teams) have been using up to now:
* https://github.com/tiangolo/full-stack
* https://github.com/tiangolo/full-stack-flask-couchbase
@@ -211,7 +211,7 @@ This isn't even Python, NestJS is a JavaScript (TypeScript) NodeJS framework ins
It achieves something somewhat similar to what can be done with Flask-apispec.
-It has an integrated dependency injection system, inspired by Angular two. It requires pre-registering the "injectables" (like all the other dependency injection systems I know), so, it adds to the verbosity and code repetition.
+It has an integrated dependency injection system, inspired by Angular 2. It requires pre-registering the "injectables" (like all the other dependency injection systems I know), so, it adds to the verbosity and code repetition.
As the parameters are described with TypeScript types (similar to Python type hints), editor support is quite good.
From c3e062542375f1c8c9e645ca1889872e51e97ed4 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 14:35:15 +0000
Subject: [PATCH 122/217] =?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 f95ccff5672b1..0ec3fd4f51f8a 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -13,6 +13,7 @@ hide:
### Docs
+* âïž Fix typo in `docs/en/docs/alternatives.md`. PR [#10931](https://github.com/tiangolo/fastapi/pull/10931) by [@s111d](https://github.com/s111d).
* ð Replace `email` with `username` in `docs_src/security/tutorial007` code examples. PR [#10649](https://github.com/tiangolo/fastapi/pull/10649) by [@nilslindemann](https://github.com/nilslindemann).
* ð Add VS Code tutorial link. PR [#10592](https://github.com/tiangolo/fastapi/pull/10592) by [@nilslindemann](https://github.com/nilslindemann).
* ð Add notes about Pydantic v2's new `.model_dump()`. PR [#10929](https://github.com/tiangolo/fastapi/pull/10929) by [@tiangolo](https://github.com/tiangolo).
From 5e583199b3ad252a3539f1d865e36d3c9ae61318 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Thu, 11 Jan 2024 19:29:54 +0400
Subject: [PATCH 123/217] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20Starlett?=
=?UTF-8?q?e=20to=20>=3D0.35.0,<0.36.0=20(#10938)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pyproject.toml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/pyproject.toml b/pyproject.toml
index 2fde7553a8759..8e7f8bbbe5914 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -41,7 +41,7 @@ classifiers = [
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
- "starlette>=0.29.0,<0.33.0",
+ "starlette>=0.35.0,<0.36.0",
"pydantic>=1.7.4,!=1.8,!=1.8.1,!=2.0.0,!=2.0.1,!=2.1.0,<3.0.0",
"typing-extensions>=4.8.0",
]
@@ -121,6 +121,9 @@ filterwarnings = [
# - https://github.com/mpdavis/python-jose/issues/332
# - https://github.com/mpdavis/python-jose/issues/334
'ignore:datetime\.datetime\.utcnow\(\) is deprecated and scheduled for removal in a future version\..*:DeprecationWarning:jose',
+ # TODO: remove after upgrading Starlette to a version including https://github.com/encode/starlette/pull/2406
+ # Probably Starlette 0.36.0
+ "ignore: The 'method' parameter is not used, and it will be removed.:DeprecationWarning:starlette",
]
[tool.coverage.run]
From 7c1aeb5db21593421d96fa226461569c77f973eb Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 15:30:35 +0000
Subject: [PATCH 124/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 0ec3fd4f51f8a..3395215af38db 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -11,6 +11,10 @@ hide:
* âš Add support for Python 3.12. PR [#10666](https://github.com/tiangolo/fastapi/pull/10666) by [@Jamim](https://github.com/Jamim).
+### Upgrades
+
+* â¬ïž Upgrade Starlette to >=0.35.0,<0.36.0. PR [#10938](https://github.com/tiangolo/fastapi/pull/10938) by [@tiangolo](https://github.com/tiangolo).
+
### Docs
* âïž Fix typo in `docs/en/docs/alternatives.md`. PR [#10931](https://github.com/tiangolo/fastapi/pull/10931) by [@s111d](https://github.com/s111d).
From cb95d1cb8927292fc096834a62c3aa46af46e4ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebasti=C3=A1n=20Ram=C3=ADrez?=
Date: Thu, 11 Jan 2024 16:32:00 +0100
Subject: [PATCH 125/217] =?UTF-8?q?=F0=9F=94=96=20Release=20version=200.10?=
=?UTF-8?q?9.0?=
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 3395215af38db..d75d9e3bd90f2 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,8 @@ hide:
## Latest Changes
+## 0.109.0
+
### Features
* âš Add support for Python 3.12. PR [#10666](https://github.com/tiangolo/fastapi/pull/10666) by [@Jamim](https://github.com/Jamim).
diff --git a/fastapi/__init__.py b/fastapi/__init__.py
index 02ac83b5e4aee..f457fafd4aa64 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.108.0"
+__version__ = "0.109.0"
from starlette import status as status
From 6bda1326a47968a1e81888da39397c4460368bb8 Mon Sep 17 00:00:00 2001
From: Nils Lindemann
Date: Thu, 11 Jan 2024 16:59:27 +0100
Subject: [PATCH 126/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20location=20info=20?=
=?UTF-8?q?to=20`tutorial/bigger-applications.md`=20(#10552)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/em/docs/tutorial/bigger-applications.md | 26 ++++++++---------
docs/en/docs/tutorial/bigger-applications.md | 30 ++++++++++----------
docs/zh/docs/tutorial/bigger-applications.md | 26 ++++++++---------
3 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/docs/em/docs/tutorial/bigger-applications.md b/docs/em/docs/tutorial/bigger-applications.md
index 7b4694387dd9b..c30bba106afa4 100644
--- a/docs/em/docs/tutorial/bigger-applications.md
+++ b/docs/em/docs/tutorial/bigger-applications.md
@@ -79,7 +79,7 @@
ð ð â«ïž & â "ð" ð ð ð ð â®ïž ð `FastAPI`:
-```Python hl_lines="1 3"
+```Python hl_lines="1 3" title="app/routers/users.py"
{!../../../docs_src/bigger_applications/app/routers/users.py!}
```
@@ -89,7 +89,7 @@
âïž â«ïž ð ð ð ð âïž `FastAPI` ð:
-```Python hl_lines="6 11 16"
+```Python hl_lines="6 11 16" title="app/routers/users.py"
{!../../../docs_src/bigger_applications/app/routers/users.py!}
```
@@ -112,7 +112,7 @@
ð¥ ð ð âïž ð
ð â ð `X-Token` ð:
-```Python hl_lines="1 4-6"
+```Python hl_lines="1 4-6" title="app/dependencies.py"
{!../../../docs_src/bigger_applications/app/dependencies.py!}
```
@@ -143,7 +143,7 @@
, â©ïž â ð ð ð *â¡ ð ïž*, ð¥ ðª ð® â«ïž `APIRouter`.
-```Python hl_lines="5-10 16 21"
+```Python hl_lines="5-10 16 21" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!}
```
@@ -195,7 +195,7 @@ async def read_item(item_id: str):
ð¥ âïž â ð â®ïž `..` ð:
-```Python hl_lines="3"
+```Python hl_lines="3" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!}
```
@@ -265,7 +265,7 @@ that ð â:
âïž ð¥ ðª ð® _ð
_ `tags` ð ð â ð¯ *â¡ ð ïž*, & â `responses` ð¯ ð *â¡ ð ïž*:
-```Python hl_lines="30-31"
+```Python hl_lines="30-31" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!}
```
@@ -290,7 +290,7 @@ that ð â:
& ð¥ ðª ð£ [ð ð](dependencies/global-dependencies.md){.internal-link target=_blank} ð ð ð â®ïž ð ð `APIRouter`:
-```Python hl_lines="1 3 7"
+```Python hl_lines="1 3 7" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -298,7 +298,7 @@ that ð â:
ð ð¥ ð ð ð ð âïž `APIRouter`â:
-```Python hl_lines="5"
+```Python hl_lines="5" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -360,7 +360,7 @@ from .routers.users import router
, ðª âïž ð¯ââïž ð« ð ð, ð¥ ð ð ð:
-```Python hl_lines="4"
+```Python hl_lines="5" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -368,7 +368,7 @@ from .routers.users import router
ð, â¡ïž ð `router`â âªïžâ¡ïž ð `users` & `items`:
-```Python hl_lines="10-11"
+```Python hl_lines="10-11" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -401,7 +401,7 @@ from .routers.users import router
ð ðŒ â«ïž ð ð ð
. âïž â¡ïž ð¬ ð â©ïž â«ïž ð° â®ïž ð ð ð¢, ð¥ ð«ð ð â«ïž & ð® `prefix`, `dependencies`, `tags`, âïž. ð `APIRouter`:
-```Python hl_lines="3"
+```Python hl_lines="3" title="app/internal/admin.py"
{!../../../docs_src/bigger_applications/app/internal/admin.py!}
```
@@ -409,7 +409,7 @@ from .routers.users import router
ð¥ ðª ð£ ð ð ðµ âïž ð â®ïž `APIRouter` ð¶ââïž ð ð¢ `app.include_router()`:
-```Python hl_lines="14-17"
+```Python hl_lines="14-17" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -432,7 +432,7 @@ from .routers.users import router
ð¥ ð¥ â«ïž... ðŠ ð ð¥ ðª ð€·:
-```Python hl_lines="21-23"
+```Python hl_lines="21-23" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
diff --git a/docs/en/docs/tutorial/bigger-applications.md b/docs/en/docs/tutorial/bigger-applications.md
index 1cf7e50e02c50..9ec3720c8d714 100644
--- a/docs/en/docs/tutorial/bigger-applications.md
+++ b/docs/en/docs/tutorial/bigger-applications.md
@@ -79,7 +79,7 @@ You can create the *path operations* for that module using `APIRouter`.
You import it and create an "instance" the same way you would with the class `FastAPI`:
-```Python hl_lines="1 3"
+```Python hl_lines="1 3" title="app/routers/users.py"
{!../../../docs_src/bigger_applications/app/routers/users.py!}
```
@@ -89,7 +89,7 @@ And then you use it to declare your *path operations*.
Use it the same way you would use the `FastAPI` class:
-```Python hl_lines="6 11 16"
+```Python hl_lines="6 11 16" title="app/routers/users.py"
{!../../../docs_src/bigger_applications/app/routers/users.py!}
```
@@ -114,13 +114,13 @@ We will now use a simple dependency to read a custom `X-Token` header:
=== "Python 3.9+"
- ```Python hl_lines="3 6-8"
+ ```Python hl_lines="3 6-8" title="app/dependencies.py"
{!> ../../../docs_src/bigger_applications/app_an_py39/dependencies.py!}
```
=== "Python 3.8+"
- ```Python hl_lines="1 5-7"
+ ```Python hl_lines="1 5-7" title="app/dependencies.py"
{!> ../../../docs_src/bigger_applications/app_an/dependencies.py!}
```
@@ -129,7 +129,7 @@ We will now use a simple dependency to read a custom `X-Token` header:
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="1 4-6"
+ ```Python hl_lines="1 4-6" title="app/dependencies.py"
{!> ../../../docs_src/bigger_applications/app/dependencies.py!}
```
@@ -160,7 +160,7 @@ We know all the *path operations* in this module have the same:
So, instead of adding all that to each *path operation*, we can add it to the `APIRouter`.
-```Python hl_lines="5-10 16 21"
+```Python hl_lines="5-10 16 21" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!}
```
@@ -212,7 +212,7 @@ And we need to get the dependency function from the module `app.dependencies`, t
So we use a relative import with `..` for the dependencies:
-```Python hl_lines="3"
+```Python hl_lines="3" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!}
```
@@ -282,7 +282,7 @@ We are not adding the prefix `/items` nor the `tags=["items"]` to each *path ope
But we can still add _more_ `tags` that will be applied to a specific *path operation*, and also some extra `responses` specific to that *path operation*:
-```Python hl_lines="30-31"
+```Python hl_lines="30-31" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!}
```
@@ -307,7 +307,7 @@ You import and create a `FastAPI` class as normally.
And we can even declare [global dependencies](dependencies/global-dependencies.md){.internal-link target=_blank} that will be combined with the dependencies for each `APIRouter`:
-```Python hl_lines="1 3 7"
+```Python hl_lines="1 3 7" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -315,7 +315,7 @@ And we can even declare [global dependencies](dependencies/global-dependencies.m
Now we import the other submodules that have `APIRouter`s:
-```Python hl_lines="5"
+```Python hl_lines="5" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -377,7 +377,7 @@ The `router` from `users` would overwrite the one from `items` and we wouldn't b
So, to be able to use both of them in the same file, we import the submodules directly:
-```Python hl_lines="5"
+```Python hl_lines="5" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -385,7 +385,7 @@ So, to be able to use both of them in the same file, we import the submodules di
Now, let's include the `router`s from the submodules `users` and `items`:
-```Python hl_lines="10-11"
+```Python hl_lines="10-11" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -418,7 +418,7 @@ It contains an `APIRouter` with some admin *path operations* that your organizat
For this example it will be super simple. But let's say that because it is shared with other projects in the organization, we cannot modify it and add a `prefix`, `dependencies`, `tags`, etc. directly to the `APIRouter`:
-```Python hl_lines="3"
+```Python hl_lines="3" title="app/internal/admin.py"
{!../../../docs_src/bigger_applications/app/internal/admin.py!}
```
@@ -426,7 +426,7 @@ But we still want to set a custom `prefix` when including the `APIRouter` so tha
We can declare all that without having to modify the original `APIRouter` by passing those parameters to `app.include_router()`:
-```Python hl_lines="14-17"
+```Python hl_lines="14-17" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -449,7 +449,7 @@ We can also add *path operations* directly to the `FastAPI` app.
Here we do it... just to show that we can ð€·:
-```Python hl_lines="21-23"
+```Python hl_lines="21-23" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
diff --git a/docs/zh/docs/tutorial/bigger-applications.md b/docs/zh/docs/tutorial/bigger-applications.md
index 9f0134f683c9e..1389595669313 100644
--- a/docs/zh/docs/tutorial/bigger-applications.md
+++ b/docs/zh/docs/tutorial/bigger-applications.md
@@ -79,7 +79,7 @@
äœ å¯ä»¥å¯Œå
¥å®å¹¶éè¿äž `FastAPI` ç±»çžåçæ¹åŒå建äžäžªãå®äŸãïŒ
-```Python hl_lines="1 3"
+```Python hl_lines="1 3" title="app/routers/users.py"
{!../../../docs_src/bigger_applications/app/routers/users.py!}
```
@@ -89,7 +89,7 @@
䜿çšæ¹åŒäž `FastAPI` ç±»çžåïŒ
-```Python hl_lines="6 11 16"
+```Python hl_lines="6 11 16" title="app/routers/users.py"
{!../../../docs_src/bigger_applications/app/routers/users.py!}
```
@@ -112,7 +112,7 @@
ç°åšæ们å°äœ¿çšäžäžªç®åçäŸèµé¡¹æ¥è¯»åäžäžªèªå®ä¹ç `X-Token` 请æ±éŠéšïŒ
-```Python hl_lines="1 4-6"
+```Python hl_lines="1 4-6" title="app/dependencies.py"
{!../../../docs_src/bigger_applications/app/dependencies.py!}
```
@@ -143,7 +143,7 @@
å æ€ïŒæ们å¯ä»¥å°å
¶æ·»å å° `APIRouter` äžïŒèäžæ¯å°å
¶æ·»å å°æ¯äžªè·¯åŸæäœäžã
-```Python hl_lines="5-10 16 21"
+```Python hl_lines="5-10 16 21" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!}
```
@@ -195,7 +195,7 @@ async def read_item(item_id: str):
å æ€ïŒæ们éè¿ `..` 对äŸèµé¡¹äœ¿çšäºçžå¯¹å¯Œå
¥ïŒ
-```Python hl_lines="3"
+```Python hl_lines="3" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!}
```
@@ -265,7 +265,7 @@ from ...dependencies import get_token_header
äœæ¯æ们ä»ç¶å¯ä»¥æ·»å *æŽå€*å°äŒåºçšäºç¹å®ç*è·¯åŸæäœ*ç `tags`ïŒä»¥åäžäºç¹å®äºè¯¥*è·¯åŸæäœ*çé¢å€ `responses`ïŒ
-```Python hl_lines="30-31"
+```Python hl_lines="30-31" title="app/routers/items.py"
{!../../../docs_src/bigger_applications/app/routers/items.py!}
```
@@ -290,7 +290,7 @@ from ...dependencies import get_token_header
æ们çè³å¯ä»¥å£°æ[å
šå±äŸèµé¡¹](dependencies/global-dependencies.md){.internal-link target=_blank}ïŒå®äŒåæ¯äžª `APIRouter` çäŸèµé¡¹ç»ååšäžèµ·ïŒ
-```Python hl_lines="1 3 7"
+```Python hl_lines="1 3 7" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -298,7 +298,7 @@ from ...dependencies import get_token_header
ç°åšïŒæ们富å
¥å
·æ `APIRouter` çå
¶ä»åæš¡åïŒ
-```Python hl_lines="5"
+```Python hl_lines="5" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -360,7 +360,7 @@ from .routers.users import router
å æ€ïŒäžºäºèœå€åšåäžäžªæ件äžäœ¿çšå®ä»¬ïŒæ们çŽæ¥å¯Œå
¥åæš¡åïŒ
-```Python hl_lines="4"
+```Python hl_lines="5" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -368,7 +368,7 @@ from .routers.users import router
ç°åšïŒè®©æ们æ¥å
å«æ¥èª `users` å `items` åæš¡åç `router`ã
-```Python hl_lines="10-11"
+```Python hl_lines="10-11" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -401,7 +401,7 @@ from .routers.users import router
对äºæ€ç€ºäŸïŒå®å°éåžžç®åãäœæ¯å讟ç±äºå®æ¯äžç»ç»äžçå
¶ä»é¡¹ç®æå
±äº«çïŒå æ€æ们æ æ³å¯¹å
¶è¿è¡ä¿®æ¹ïŒä»¥åçŽæ¥åš `APIRouter` äžæ·»å `prefix`ã`dependencies`ã`tags` çïŒ
-```Python hl_lines="3"
+```Python hl_lines="3" title="app/internal/admin.py"
{!../../../docs_src/bigger_applications/app/internal/admin.py!}
```
@@ -409,7 +409,7 @@ from .routers.users import router
æ们å¯ä»¥éè¿å°è¿äºåæ°äŒ éç» `app.include_router()` æ¥å®æææç声æïŒèäžå¿
ä¿®æ¹åå§ç `APIRouter`ïŒ
-```Python hl_lines="14-17"
+```Python hl_lines="14-17" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
@@ -432,7 +432,7 @@ from .routers.users import router
è¿éæ们è¿æ ·åäº...åªæ¯äžºäºè¡šææ们å¯ä»¥åå°ð€·ïŒ
-```Python hl_lines="21-23"
+```Python hl_lines="21-23" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
From fedee4d028e8c5ff634f91ca742fb404641adb40 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 15:59:47 +0000
Subject: [PATCH 127/217] =?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 | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index d75d9e3bd90f2..8d789b1373ee8 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -7,6 +7,10 @@ hide:
## Latest Changes
+### Docs
+
+* ð Add location info to `tutorial/bigger-applications.md`. PR [#10552](https://github.com/tiangolo/fastapi/pull/10552) by [@nilslindemann](https://github.com/nilslindemann).
+
## 0.109.0
### Features
From 1369c45c2e047fe349c18fd0d4a29451de02106f Mon Sep 17 00:00:00 2001
From: Jeny Sadadia
Date: Thu, 11 Jan 2024 21:37:05 +0530
Subject: [PATCH 128/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20External=20Link:?=
=?UTF-8?q?=20Talk=20by=20Jeny=20Sadadia=20(#10265)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: Jeny Sadadia
Co-authored-by: Sebastián RamÃrez
---
docs/en/data/external_links.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index f15560d1b6a8b..ed512b733b881 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -349,6 +349,10 @@ Podcasts:
title: FastAPI on PythonBytes
Talks:
English:
+ - author: Jeny Sadadia
+ author_link: https://github.com/JenySadadia
+ link: https://www.youtube.com/watch?v=uZdTe8_Z6BQ
+ title: 'PyCon AU 2023: Testing asynchronous applications with FastAPI and pytest'
- author: Sebastián RamÃrez (tiangolo)
author_link: https://twitter.com/tiangolo
link: https://www.youtube.com/watch?v=PnpTY1f4k2U
From facdc9162933acec437eecb0318d8d2bfdec2d6b Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 16:07:29 +0000
Subject: [PATCH 129/217] =?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 8d789b1373ee8..692890d73b2ad 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add External Link: Talk by Jeny Sadadia. PR [#10265](https://github.com/tiangolo/fastapi/pull/10265) by [@JenySadadia](https://github.com/JenySadadia).
* ð Add location info to `tutorial/bigger-applications.md`. PR [#10552](https://github.com/tiangolo/fastapi/pull/10552) by [@nilslindemann](https://github.com/nilslindemann).
## 0.109.0
From 838e9c964eaef85f47ec8b22b4d1feb124a3a039 Mon Sep 17 00:00:00 2001
From: malicious <38064672+malicious@users.noreply.github.com>
Date: Thu, 11 Jan 2024 16:31:18 +0000
Subject: [PATCH 130/217] =?UTF-8?q?=F0=9F=93=9D=20Reword=20in=20docs,=20fr?=
=?UTF-8?q?om=20"have=20in=20mind"=20to=20"keep=20in=20mind"=20(#10376)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
---
docs/en/docs/advanced/additional-responses.md | 2 +-
docs/en/docs/advanced/behind-a-proxy.md | 4 ++--
docs/en/docs/advanced/custom-response.md | 2 +-
docs/en/docs/advanced/dataclasses.md | 2 +-
docs/en/docs/advanced/events.md | 2 +-
docs/en/docs/advanced/response-change-status-code.md | 2 +-
docs/en/docs/advanced/response-cookies.md | 2 +-
docs/en/docs/advanced/response-headers.md | 2 +-
docs/en/docs/advanced/websockets.md | 2 +-
docs/en/docs/benchmarks.md | 2 +-
docs/en/docs/deployment/concepts.md | 4 ++--
docs/en/docs/deployment/https.md | 2 +-
docs/en/docs/deployment/index.md | 4 ++--
docs/en/docs/deployment/manually.md | 4 ++--
docs/en/docs/help-fastapi.md | 6 +++---
docs/en/docs/how-to/sql-databases-peewee.md | 4 ++--
docs/en/docs/release-notes.md | 2 +-
docs/en/docs/tutorial/body-nested-models.md | 2 +-
docs/en/docs/tutorial/middleware.md | 2 +-
docs/en/docs/tutorial/path-params-numeric-validations.md | 4 ++--
docs/en/docs/tutorial/query-params-str-validations.md | 8 ++++----
docs/en/docs/tutorial/request-files.md | 2 +-
docs/en/docs/tutorial/security/get-current-user.md | 2 +-
docs/en/docs/tutorial/security/oauth2-jwt.md | 2 +-
docs/en/docs/tutorial/sql-databases.md | 2 +-
25 files changed, 36 insertions(+), 36 deletions(-)
diff --git a/docs/en/docs/advanced/additional-responses.md b/docs/en/docs/advanced/additional-responses.md
index 624036ce974c5..41b39c18e6bc1 100644
--- a/docs/en/docs/advanced/additional-responses.md
+++ b/docs/en/docs/advanced/additional-responses.md
@@ -28,7 +28,7 @@ For example, to declare another response with a status code `404` and a Pydantic
```
!!! note
- Have in mind that you have to return the `JSONResponse` directly.
+ Keep in mind that you have to return the `JSONResponse` directly.
!!! info
The `model` key is not part of OpenAPI.
diff --git a/docs/en/docs/advanced/behind-a-proxy.md b/docs/en/docs/advanced/behind-a-proxy.md
index e7af77f3da1af..01998cc912626 100644
--- a/docs/en/docs/advanced/behind-a-proxy.md
+++ b/docs/en/docs/advanced/behind-a-proxy.md
@@ -125,7 +125,7 @@ Passing the `root_path` to `FastAPI` would be the equivalent of passing the `--r
### About `root_path`
-Have in mind that the server (Uvicorn) won't use that `root_path` for anything else than passing it to the app.
+Keep in mind that the server (Uvicorn) won't use that `root_path` for anything else than passing it to the app.
But if you go with your browser to http://127.0.0.1:8000/app you will see the normal response:
@@ -142,7 +142,7 @@ Uvicorn will expect the proxy to access Uvicorn at `http://127.0.0.1:8000/app`,
## About proxies with a stripped path prefix
-Have in mind that a proxy with stripped path prefix is only one of the ways to configure it.
+Keep in mind that a proxy with stripped path prefix is only one of the ways to configure it.
Probably in many cases the default will be that the proxy doesn't have a stripped path prefix.
diff --git a/docs/en/docs/advanced/custom-response.md b/docs/en/docs/advanced/custom-response.md
index ce2619e8de5fc..827776f5e52b6 100644
--- a/docs/en/docs/advanced/custom-response.md
+++ b/docs/en/docs/advanced/custom-response.md
@@ -101,7 +101,7 @@ But as you passed the `HTMLResponse` in the `response_class` too, **FastAPI** wi
Here are some of the available responses.
-Have in mind that you can use `Response` to return anything else, or even create a custom sub-class.
+Keep in mind that you can use `Response` to return anything else, or even create a custom sub-class.
!!! note "Technical Details"
You could also use `from starlette.responses import HTMLResponse`.
diff --git a/docs/en/docs/advanced/dataclasses.md b/docs/en/docs/advanced/dataclasses.md
index 72daca06ad9f7..ed1d5610fc279 100644
--- a/docs/en/docs/advanced/dataclasses.md
+++ b/docs/en/docs/advanced/dataclasses.md
@@ -21,7 +21,7 @@ And of course, it supports the same:
This works the same way as with Pydantic models. And it is actually achieved in the same way underneath, using Pydantic.
!!! info
- Have in mind that dataclasses can't do everything Pydantic models can do.
+ Keep in mind that dataclasses can't do everything Pydantic models can do.
So, you might still need to use Pydantic models.
diff --git a/docs/en/docs/advanced/events.md b/docs/en/docs/advanced/events.md
index 6b7de41309bbe..6df1411d1f317 100644
--- a/docs/en/docs/advanced/events.md
+++ b/docs/en/docs/advanced/events.md
@@ -159,4 +159,4 @@ Underneath, in the ASGI technical specification, this is part of the using the 'X-' prefix .
+Keep in mind that custom proprietary headers can be added using the 'X-' prefix .
But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS configurations (read more in [CORS (Cross-Origin Resource Sharing)](../tutorial/cors.md){.internal-link target=_blank}), using the parameter `expose_headers` documented in Starlette's CORS docs .
diff --git a/docs/en/docs/advanced/websockets.md b/docs/en/docs/advanced/websockets.md
index 49b8fba899015..b8dfab1d1f69f 100644
--- a/docs/en/docs/advanced/websockets.md
+++ b/docs/en/docs/advanced/websockets.md
@@ -212,7 +212,7 @@ Client #1596980209979 left the chat
!!! tip
The app above is a minimal and simple example to demonstrate how to handle and broadcast messages to several WebSocket connections.
- But have in mind that, as everything is handled in memory, in a single list, it will only work while the process is running, and will only work with a single process.
+ But keep in mind that, as everything is handled in memory, in a single list, it will only work while the process is running, and will only work with a single process.
If you need something easy to integrate with FastAPI but that is more robust, supported by Redis, PostgreSQL or others, check encode/broadcaster .
diff --git a/docs/en/docs/benchmarks.md b/docs/en/docs/benchmarks.md
index e05fec8406621..d746b6d7c4e24 100644
--- a/docs/en/docs/benchmarks.md
+++ b/docs/en/docs/benchmarks.md
@@ -2,7 +2,7 @@
Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as one of the fastest Python frameworks available , only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)
-But when checking benchmarks and comparisons you should have the following in mind.
+But when checking benchmarks and comparisons you should keep the following in mind.
## Benchmarks and speed
diff --git a/docs/en/docs/deployment/concepts.md b/docs/en/docs/deployment/concepts.md
index 77419f8b0dfd9..cc01fb24e1584 100644
--- a/docs/en/docs/deployment/concepts.md
+++ b/docs/en/docs/deployment/concepts.md
@@ -258,7 +258,7 @@ And you will have to make sure that it's a single process running those previous
Of course, there are some cases where there's no problem in running the previous steps multiple times, in that case, it's a lot easier to handle.
!!! tip
- Also, have in mind that depending on your setup, in some cases you **might not even need any previous steps** before starting your application.
+ Also, keep in mind that depending on your setup, in some cases you **might not even need any previous steps** before starting your application.
In that case, you wouldn't have to worry about any of this. ð€·
@@ -297,7 +297,7 @@ You can use simple tools like `htop` to see the CPU and RAM used in your server
## Recap
-You have been reading here some of the main concepts that you would probably need to have in mind when deciding how to deploy your application:
+You have been reading here some of the main concepts that you would probably need to keep in mind when deciding how to deploy your application:
* Security - HTTPS
* Running on startup
diff --git a/docs/en/docs/deployment/https.md b/docs/en/docs/deployment/https.md
index 790976a718f78..5cf76c1111d6e 100644
--- a/docs/en/docs/deployment/https.md
+++ b/docs/en/docs/deployment/https.md
@@ -9,7 +9,7 @@ But it is way more complex than that.
To **learn the basics of HTTPS**, from a consumer perspective, check https://howhttps.works/ .
-Now, from a **developer's perspective**, here are several things to have in mind while thinking about HTTPS:
+Now, from a **developer's perspective**, here are several things to keep in mind while thinking about HTTPS:
* For HTTPS, **the server** needs to **have "certificates"** generated by a **third party**.
* Those certificates are actually **acquired** from the third party, not "generated".
diff --git a/docs/en/docs/deployment/index.md b/docs/en/docs/deployment/index.md
index 6c43d8abbe4db..b43bd050a37ab 100644
--- a/docs/en/docs/deployment/index.md
+++ b/docs/en/docs/deployment/index.md
@@ -16,6 +16,6 @@ There are several ways to do it depending on your specific use case and the tool
You could **deploy a server** yourself using a combination of tools, you could use a **cloud service** that does part of the work for you, or other possible options.
-I will show you some of the main concepts you should probably have in mind when deploying a **FastAPI** application (although most of it applies to any other type of web application).
+I will show you some of the main concepts you should probably keep in mind when deploying a **FastAPI** application (although most of it applies to any other type of web application).
-You will see more details to have in mind and some of the techniques to do it in the next sections. âš
+You will see more details to keep in mind and some of the techniques to do it in the next sections. âš
diff --git a/docs/en/docs/deployment/manually.md b/docs/en/docs/deployment/manually.md
index d6892b2c14ad6..b10a3686d7565 100644
--- a/docs/en/docs/deployment/manually.md
+++ b/docs/en/docs/deployment/manually.md
@@ -10,11 +10,11 @@ There are 3 main alternatives:
## Server Machine and Server Program
-There's a small detail about names to have in mind. ð¡
+There's a small detail about names to keep in mind. ð¡
The word "**server**" is commonly used to refer to both the remote/cloud computer (the physical or virtual machine) and also the program that is running on that machine (e.g. Uvicorn).
-Just have that in mind when you read "server" in general, it could refer to one of those two things.
+Just keep in mind that when you read "server" in general, it could refer to one of those two things.
When referring to the remote machine, it's common to call it **server**, but also **machine**, **VM** (virtual machine), **node**. Those all refer to some type of remote machine, normally running Linux, where you run programs.
diff --git a/docs/en/docs/help-fastapi.md b/docs/en/docs/help-fastapi.md
index 8199c9b9a9b1b..71c580409708c 100644
--- a/docs/en/docs/help-fastapi.md
+++ b/docs/en/docs/help-fastapi.md
@@ -106,7 +106,7 @@ In many cases they will only copy a fragment of the code, but that's not enough
* You can ask them to provide a minimal, reproducible, example , that you can **copy-paste** and run locally to see the same error or behavior they are seeing, or to understand their use case better.
-* If you are feeling too generous, you can try to **create an example** like that yourself, just based on the description of the problem. Just have in mind that this might take a lot of time and it might be better to ask them to clarify the problem first.
+* If you are feeling too generous, you can try to **create an example** like that yourself, just based on the description of the problem. Just keep in mind that this might take a lot of time and it might be better to ask them to clarify the problem first.
### Suggest solutions
@@ -148,7 +148,7 @@ Again, please try your best to be kind. ð€
---
-Here's what to have in mind and how to review a pull request:
+Here's what to keep in mind and how to review a pull request:
### Understand the problem
@@ -233,7 +233,7 @@ Join the ð¥ `contextvars` that can create a local variable very similar to `threading.local`, but also supporting these async features.
-There are several things to have in mind.
+There are several things to keep in mind.
The `ContextVar` has to be created at the top of the module, like:
diff --git a/docs/en/docs/release-notes.md b/docs/en/docs/release-notes.md
index 692890d73b2ad..6431ed2c3bebc 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -3379,7 +3379,7 @@ Note: all the previous parameters are still there, so it's still possible to dec
* Add OAuth2 redirect page for Swagger UI. This allows having delegated authentication in the Swagger UI docs. For this to work, you need to add `{your_origin}/docs/oauth2-redirect` to the allowed callbacks in your OAuth2 provider (in Auth0, Facebook, Google, etc).
* For example, during development, it could be `http://localhost:8000/docs/oauth2-redirect`.
- * Have in mind that this callback URL is independent of whichever one is used by your frontend. You might also have another callback at `https://yourdomain.com/login/callback`.
+ * Keep in mind that this callback URL is independent of whichever one is used by your frontend. You might also have another callback at `https://yourdomain.com/login/callback`.
* This is only to allow delegated authentication in the API docs with Swagger UI.
* PR [#198](https://github.com/tiangolo/fastapi/pull/198) by [@steinitzu](https://github.com/steinitzu).
diff --git a/docs/en/docs/tutorial/body-nested-models.md b/docs/en/docs/tutorial/body-nested-models.md
index 387f0de9aaed7..7058d4ad040c5 100644
--- a/docs/en/docs/tutorial/body-nested-models.md
+++ b/docs/en/docs/tutorial/body-nested-models.md
@@ -361,7 +361,7 @@ In this case, you would accept any `dict` as long as it has `int` keys with `flo
```
!!! tip
- Have in mind that JSON only supports `str` as keys.
+ Keep in mind that JSON only supports `str` as keys.
But Pydantic has automatic data conversion.
diff --git a/docs/en/docs/tutorial/middleware.md b/docs/en/docs/tutorial/middleware.md
index 3c6868fe4de73..492a1b065e515 100644
--- a/docs/en/docs/tutorial/middleware.md
+++ b/docs/en/docs/tutorial/middleware.md
@@ -33,7 +33,7 @@ The middleware function receives:
```
!!! tip
- Have in mind that custom proprietary headers can be added using the 'X-' prefix .
+ Keep in mind that custom proprietary headers can be added using the 'X-' prefix .
But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS configurations ([CORS (Cross-Origin Resource Sharing)](cors.md){.internal-link target=_blank}) using the parameter `expose_headers` documented in Starlette's CORS docs .
diff --git a/docs/en/docs/tutorial/path-params-numeric-validations.md b/docs/en/docs/tutorial/path-params-numeric-validations.md
index 57ad20b137ea0..b5b13cfbe6f81 100644
--- a/docs/en/docs/tutorial/path-params-numeric-validations.md
+++ b/docs/en/docs/tutorial/path-params-numeric-validations.md
@@ -126,7 +126,7 @@ So, you can declare your function as:
{!> ../../../docs_src/path_params_numeric_validations/tutorial002.py!}
```
-But have in mind that if you use `Annotated`, you won't have this problem, it won't matter as you're not using the function parameter default values for `Query()` or `Path()`.
+But keep in mind that if you use `Annotated`, you won't have this problem, it won't matter as you're not using the function parameter default values for `Query()` or `Path()`.
=== "Python 3.9+"
@@ -166,7 +166,7 @@ Python won't do anything with that `*`, but it will know that all the following
### Better with `Annotated`
-Have in mind that if you use `Annotated`, as you are not using function parameter default values, you won't have this problem, and you probably won't need to use `*`.
+Keep in mind that if you use `Annotated`, as you are not using function parameter default values, you won't have this problem, and you probably won't need to use `*`.
=== "Python 3.9+"
diff --git a/docs/en/docs/tutorial/query-params-str-validations.md b/docs/en/docs/tutorial/query-params-str-validations.md
index 91ae615fffb68..7a9bc487541f9 100644
--- a/docs/en/docs/tutorial/query-params-str-validations.md
+++ b/docs/en/docs/tutorial/query-params-str-validations.md
@@ -173,7 +173,7 @@ q: str | None = None
But it declares it explicitly as being a query parameter.
!!! info
- Have in mind that the most important part to make a parameter optional is the part:
+ Keep in mind that the most important part to make a parameter optional is the part:
```Python
= None
@@ -199,7 +199,7 @@ This will validate the data, show a clear error when the data is not valid, and
### `Query` as the default value or in `Annotated`
-Have in mind that when using `Query` inside of `Annotated` you cannot use the `default` parameter for `Query`.
+Keep in mind that when using `Query` inside of `Annotated` you cannot use the `default` parameter for `Query`.
Instead use the actual default value of the function parameter. Otherwise, it would be inconsistent.
@@ -659,7 +659,7 @@ You can also use `list` directly instead of `List[str]` (or `list[str]` in Pytho
```
!!! note
- Have in mind that in this case, FastAPI won't check the contents of the list.
+ Keep in mind that in this case, FastAPI won't check the contents of the list.
For example, `List[int]` would check (and document) that the contents of the list are integers. But `list` alone wouldn't.
@@ -670,7 +670,7 @@ You can add more information about the parameter.
That information will be included in the generated OpenAPI and used by the documentation user interfaces and external tools.
!!! note
- Have in mind that different tools might have different levels of OpenAPI support.
+ Keep in mind that different tools might have different levels of OpenAPI support.
Some of them might not show all the extra information declared yet, although in most of the cases, the missing feature is already planned for development.
diff --git a/docs/en/docs/tutorial/request-files.md b/docs/en/docs/tutorial/request-files.md
index c85a68ed60631..8eb8ace64850c 100644
--- a/docs/en/docs/tutorial/request-files.md
+++ b/docs/en/docs/tutorial/request-files.md
@@ -71,7 +71,7 @@ The files will be uploaded as "form data".
If you declare the type of your *path operation function* parameter as `bytes`, **FastAPI** will read the file for you and you will receive the contents as `bytes`.
-Have in mind that this means that the whole contents will be stored in memory. This will work well for small files.
+Keep in mind that this means that the whole contents will be stored in memory. This will work well for small files.
But there are several cases in which you might benefit from using `UploadFile`.
diff --git a/docs/en/docs/tutorial/security/get-current-user.md b/docs/en/docs/tutorial/security/get-current-user.md
index e99a800c6d50c..dc6d87c9caaf8 100644
--- a/docs/en/docs/tutorial/security/get-current-user.md
+++ b/docs/en/docs/tutorial/security/get-current-user.md
@@ -227,7 +227,7 @@ Just use any kind of model, any kind of class, any kind of database that you nee
## Code size
-This example might seem verbose. Have in mind that we are mixing security, data models, utility functions and *path operations* in the same file.
+This example might seem verbose. Keep in mind that we are mixing security, data models, utility functions and *path operations* in the same file.
But here's the key point.
diff --git a/docs/en/docs/tutorial/security/oauth2-jwt.md b/docs/en/docs/tutorial/security/oauth2-jwt.md
index 0a347fed3eb83..4159b36591942 100644
--- a/docs/en/docs/tutorial/security/oauth2-jwt.md
+++ b/docs/en/docs/tutorial/security/oauth2-jwt.md
@@ -318,7 +318,7 @@ In those cases, several of those entities could have the same ID, let's say `foo
So, to avoid ID collisions, when creating the JWT token for the user, you could prefix the value of the `sub` key, e.g. with `username:`. So, in this example, the value of `sub` could have been: `username:johndoe`.
-The important thing to have in mind is that the `sub` key should have a unique identifier across the entire application, and it should be a string.
+The important thing to keep in mind is that the `sub` key should have a unique identifier across the entire application, and it should be a string.
## Check it
diff --git a/docs/en/docs/tutorial/sql-databases.md b/docs/en/docs/tutorial/sql-databases.md
index 1bc87a702d1b8..161d5491d7795 100644
--- a/docs/en/docs/tutorial/sql-databases.md
+++ b/docs/en/docs/tutorial/sql-databases.md
@@ -301,7 +301,7 @@ while Pydantic *models* declare the types using `:`, the new type annotation syn
name: str
```
-Have it in mind, so you don't get confused when using `=` and `:` with them.
+Keep these in mind, so you don't get confused when using `=` and `:` with them.
### Create Pydantic *models* / schemas for reading / returning
From 6761fc1fa4ffce2cc0c73117aeadce81fa3a659c Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 16:31:38 +0000
Subject: [PATCH 131/217] =?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 6431ed2c3bebc..9cdb82e199839 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Reword in docs, from "have in mind" to "keep in mind". PR [#10376](https://github.com/tiangolo/fastapi/pull/10376) by [@malicious](https://github.com/malicious).
* ð Add External Link: Talk by Jeny Sadadia. PR [#10265](https://github.com/tiangolo/fastapi/pull/10265) by [@JenySadadia](https://github.com/JenySadadia).
* ð Add location info to `tutorial/bigger-applications.md`. PR [#10552](https://github.com/tiangolo/fastapi/pull/10552) by [@nilslindemann](https://github.com/nilslindemann).
From abe7db6b2489052e73b2386d6c5372922f9a7cee Mon Sep 17 00:00:00 2001
From: Mikhail Rozhkov
Date: Thu, 11 Jan 2024 18:29:24 +0100
Subject: [PATCH 132/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20External=20Link:?=
=?UTF-8?q?=20ML=20serving=20and=20monitoring=20with=20FastAPI=20and=20Evi?=
=?UTF-8?q?dently=20(#9701)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
docs/en/data/external_links.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index ed512b733b881..aea400dfcd726 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -1,5 +1,9 @@
Articles:
English:
+ - author: Mikhail Rozhkov, Elena Samuylova
+ author_link: https://www.linkedin.com/in/mnrozhkov/
+ link: https://www.evidentlyai.com/blog/fastapi-tutorial
+ title: ML serving and monitoring with FastAPI and Evidently
- author: Visual Studio Code Team
author_link: https://code.visualstudio.com/
link: https://code.visualstudio.com/docs/python/tutorial-fastapi
From 3325635eed6ab45e81de31766863e63ab3a7662a Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 17:29:48 +0000
Subject: [PATCH 133/217] =?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 9cdb82e199839..ccb2d15933c6f 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add External Link: ML serving and monitoring with FastAPI and Evidently. PR [#9701](https://github.com/tiangolo/fastapi/pull/9701) by [@mnrozhkov](https://github.com/mnrozhkov).
* ð Reword in docs, from "have in mind" to "keep in mind". PR [#10376](https://github.com/tiangolo/fastapi/pull/10376) by [@malicious](https://github.com/malicious).
* ð Add External Link: Talk by Jeny Sadadia. PR [#10265](https://github.com/tiangolo/fastapi/pull/10265) by [@JenySadadia](https://github.com/JenySadadia).
* ð Add location info to `tutorial/bigger-applications.md`. PR [#10552](https://github.com/tiangolo/fastapi/pull/10552) by [@nilslindemann](https://github.com/nilslindemann).
From 0380ca3e69efe642149bda481d05906f99f4da69 Mon Sep 17 00:00:00 2001
From: Nils Lindemann
Date: Thu, 11 Jan 2024 18:42:43 +0100
Subject: [PATCH 134/217] =?UTF-8?q?=F0=9F=93=9D=20Review=20and=20rewording?=
=?UTF-8?q?=20of=20`en/docs/contributing.md`=20(#10480)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/en/docs/contributing.md | 71 ++++++++++++++++++++----------------
1 file changed, 40 insertions(+), 31 deletions(-)
diff --git a/docs/en/docs/contributing.md b/docs/en/docs/contributing.md
index 35bc1c50197d4..2d308a9dbd801 100644
--- a/docs/en/docs/contributing.md
+++ b/docs/en/docs/contributing.md
@@ -4,11 +4,11 @@ First, you might want to see the basic ways to [help FastAPI and get help](help-
## Developing
-If you already cloned the repository and you know that you need to deep dive in the code, here are some guidelines to set up your environment.
+If you already cloned the fastapi repository and you want to deep dive in the code, here are some guidelines to set up your environment.
### Virtual environment with `venv`
-You can create a virtual environment in a directory using Python's `venv` module:
+You can create an isolated virtual local environment in a directory using Python's `venv` module. Let's do this in the cloned repository (where the `requirements.txt` is):
@@ -18,7 +18,7 @@ $ python -m venv env
-That will create a directory `./env/` with the Python binaries and then you will be able to install packages for that isolated environment.
+That will create a directory `./env/` with the Python binaries, and then you will be able to install packages for that local environment.
### Activate the environment
@@ -84,7 +84,7 @@ To check it worked, use:
If it shows the `pip` binary at `env/bin/pip` then it worked. ð
-Make sure you have the latest pip version on your virtual environment to avoid errors on the next steps:
+Make sure you have the latest pip version on your local environment to avoid errors on the next steps:
@@ -101,7 +101,7 @@ $ python -m pip install --upgrade pip
This makes sure that if you use a terminal program installed by that package, you use the one from your local environment and not any other that could be installed globally.
-### pip
+### Install requirements using pip
After activating the environment as described above:
@@ -117,20 +117,20 @@ $ pip install -r requirements.txt
It will install all the dependencies and your local FastAPI in your local environment.
-#### Using your local FastAPI
+### Using your local FastAPI
-If you create a Python file that imports and uses FastAPI, and run it with the Python from your local environment, it will use your local FastAPI source code.
+If you create a Python file that imports and uses FastAPI, and run it with the Python from your local environment, it will use your cloned local FastAPI source code.
And if you update that local FastAPI source code when you run that Python file again, it will use the fresh version of FastAPI you just edited.
That way, you don't have to "install" your local version to be able to test every change.
!!! note "Technical Details"
- This only happens when you install using this included `requirements.txt` instead of installing `pip install fastapi` directly.
+ This only happens when you install using this included `requirements.txt` instead of running `pip install fastapi` directly.
- That is because inside of the `requirements.txt` file, the local version of FastAPI is marked to be installed in "editable" mode, with the `-e` option.
+ That is because inside the `requirements.txt` file, the local version of FastAPI is marked to be installed in "editable" mode, with the `-e` option.
-### Format
+### Format the code
There is a script that you can run that will format and clean all your code:
@@ -227,15 +227,13 @@ And those Python files are included/injected in the documentation when generatin
Most of the tests actually run against the example source files in the documentation.
-This helps making sure that:
+This helps to make sure that:
-* The documentation is up to date.
+* The documentation is up-to-date.
* The documentation examples can be run as is.
* Most of the features are covered by the documentation, ensured by test coverage.
-
-
-### Apps and docs at the same time
+#### Apps and docs at the same time
If you run the examples with, e.g.:
@@ -259,7 +257,9 @@ Here are the steps to help with translations.
#### Tips and guidelines
-* Check the currently
existing pull requests for your language and add reviews requesting changes or approving them.
+* Check the currently
existing pull requests for your language. You can filter the pull requests by the ones with the label for your language. For example, for Spanish, the label is
`lang-es` .
+
+* Review those pull requests, requesting changes or approving them. For the languages I don't speak, I'll wait for several others to review the translation before merging.
!!! tip
You can
add comments with change suggestions to existing pull requests.
@@ -268,19 +268,9 @@ Here are the steps to help with translations.
* Check if there's a
GitHub Discussion to coordinate translations for your language. You can subscribe to it, and when there's a new pull request to review, an automatic comment will be added to the discussion.
-* Add a single pull request per page translated. That will make it much easier for others to review it.
-
-For the languages I don't speak, I'll wait for several others to review the translation before merging.
+* If you translate pages, add a single pull request per page translated. That will make it much easier for others to review it.
-* You can also check if there are translations for your language and add a review to them, that will help me know that the translation is correct and I can merge it.
- * You could check in the
GitHub Discussions for your language.
- * Or you can filter the existing PRs by the ones with the label for your language, for example, for Spanish, the label is
`lang-es` .
-
-* Use the same Python examples and only translate the text in the docs. You don't have to change anything for this to work.
-
-* Use the same images, file names, and links. You don't have to change anything for it to work.
-
-* To check the 2-letter code for the language you want to translate you can use the table
List of ISO 639-1 codes .
+* To check the 2-letter code for the language you want to translate, you can use the table
List of ISO 639-1 codes .
#### Existing language
@@ -323,7 +313,7 @@ $ python ./scripts/docs.py live es
Now you can go to
http://127.0.0.1:8008 and see your changes live.
-You will see that every language has all the pages. But some pages are not translated and have a notification about the missing translation.
+You will see that every language has all the pages. But some pages are not translated and have an info box at the top, about the missing translation.
Now let's say that you want to add a translation for the section [Features](features.md){.internal-link target=_blank}.
@@ -342,7 +332,7 @@ docs/es/docs/features.md
!!! tip
Notice that the only change in the path and file name is the language code, from `en` to `es`.
-If you go to your browser you will see that now the docs show your new section. ð
+If you go to your browser you will see that now the docs show your new section (the info box at the top is gone). ð
Now you can translate it all and see how it looks as you save the file.
@@ -386,7 +376,7 @@ You can make the first pull request with those two files, `docs/ht/mkdocs.yml` a
#### Preview the result
-You can use the `./scripts/docs.py` with the `live` command to preview the results (or `mkdocs serve`).
+As already mentioned above, you can use the `./scripts/docs.py` with the `live` command to preview the results (or `mkdocs serve`).
Once you are done, you can also test it all as it would look online, including all the other languages.
@@ -423,6 +413,25 @@ Serving at: http://127.0.0.1:8008
+#### Translation specific tips and guidelines
+
+* Translate only the Markdown documents (`.md`). Do not translate the code examples at `./docs_src`.
+
+* In code blocks within the Markdown document, translate comments (`# a comment`), but leave the rest unchanged.
+
+* Do not change anything enclosed in "``" (inline code).
+
+* In lines starting with `===` or `!!!`, translate only the ` "... Text ..."` part. Leave the rest unchanged.
+
+* You can translate info boxes like `!!! warning` with for example `!!! warning "Achtung"`. But do not change the word immediately after the `!!!`, it determines the color of the info box.
+
+* Do not change the paths in links to images, code files, Markdown documents.
+
+* However, when a Markdown document is translated, the `#hash-parts` in links to its headings may change. Update these links if possible.
+ * Search for such links in the translated document using the regex `#[^# ]`.
+ * Search in all documents already translated into your language for `your-translated-document.md`. For example VS Code has an option "Edit" -> "Find in Files".
+ * When translating a document, do not "pre-translate" `#hash-parts` that link to headings in untranslated documents.
+
## Tests
There is a script that you can run locally to test all the code and generate coverage reports in HTML:
From 0be64abac748116f12d68ca766915ec46ff879df Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 17:43:08 +0000
Subject: [PATCH 135/217] =?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 ccb2d15933c6f..65a81f7d31e2f 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Review and rewording of `en/docs/contributing.md`. PR [#10480](https://github.com/tiangolo/fastapi/pull/10480) by [@nilslindemann](https://github.com/nilslindemann).
* ð Add External Link: ML serving and monitoring with FastAPI and Evidently. PR [#9701](https://github.com/tiangolo/fastapi/pull/9701) by [@mnrozhkov](https://github.com/mnrozhkov).
* ð Reword in docs, from "have in mind" to "keep in mind". PR [#10376](https://github.com/tiangolo/fastapi/pull/10376) by [@malicious](https://github.com/malicious).
* ð Add External Link: Talk by Jeny Sadadia. PR [#10265](https://github.com/tiangolo/fastapi/pull/10265) by [@JenySadadia](https://github.com/JenySadadia).
From e6759aa6044929d1aaaea8280dd2e576a2339dc3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B3=20Lino?=
Date: Thu, 11 Jan 2024 20:52:15 +0100
Subject: [PATCH 136/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20External=20Link:?=
=?UTF-8?q?=20Instrument=20a=20FastAPI=20service=20adding=20tracing=20with?=
=?UTF-8?q?=20OpenTelemetry=20and=20send/show=20traces=20in=20Grafana=20Te?=
=?UTF-8?q?mpo=20(#9440)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Carol Willing
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
---
docs/en/data/external_links.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index aea400dfcd726..4121564426ce7 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -1,5 +1,9 @@
Articles:
English:
+ - author: Nicoló Lino
+ author_link: https://www.nlino.com
+ link: https://github.com/softwarebloat/python-tracing-demo
+ title: Instrument a FastAPI service adding tracing with OpenTelemetry and send/show traces in Grafana Tempo
- author: Mikhail Rozhkov, Elena Samuylova
author_link: https://www.linkedin.com/in/mnrozhkov/
link: https://www.evidentlyai.com/blog/fastapi-tutorial
From 4dde172a969644e4e4f88b5d6c29b1d4d2e95303 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 19:52:37 +0000
Subject: [PATCH 137/217] =?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 65a81f7d31e2f..23dbeb5b3ca9a 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add External Link: Instrument a FastAPI service adding tracing with OpenTelemetry and send/show traces in Grafana Tempo. PR [#9440](https://github.com/tiangolo/fastapi/pull/9440) by [@softwarebloat](https://github.com/softwarebloat).
* ð Review and rewording of `en/docs/contributing.md`. PR [#10480](https://github.com/tiangolo/fastapi/pull/10480) by [@nilslindemann](https://github.com/nilslindemann).
* ð Add External Link: ML serving and monitoring with FastAPI and Evidently. PR [#9701](https://github.com/tiangolo/fastapi/pull/9701) by [@mnrozhkov](https://github.com/mnrozhkov).
* ð Reword in docs, from "have in mind" to "keep in mind". PR [#10376](https://github.com/tiangolo/fastapi/pull/10376) by [@malicious](https://github.com/malicious).
From f74aeb00674d35d10e4f9f0ecd34a8e36a0df131 Mon Sep 17 00:00:00 2001
From: Hungtsetse <33526088+hungtsetse@users.noreply.github.com>
Date: Fri, 12 Jan 2024 03:56:09 +0800
Subject: [PATCH 138/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20hyperlink=20to=20`?=
=?UTF-8?q?docs/en/docs/tutorial/static-files.md`=20(#10243)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
docs/en/docs/tutorial/static-files.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/en/docs/tutorial/static-files.md b/docs/en/docs/tutorial/static-files.md
index 7a0c36af3f4c5..311d2b1c8de14 100644
--- a/docs/en/docs/tutorial/static-files.md
+++ b/docs/en/docs/tutorial/static-files.md
@@ -22,7 +22,7 @@ You can serve static files automatically from a directory using `StaticFiles`.
This is different from using an `APIRouter` as a mounted application is completely independent. The OpenAPI and docs from your main application won't include anything from the mounted application, etc.
-You can read more about this in the **Advanced User Guide**.
+You can read more about this in the [Advanced User Guide](../advanced/index.md){.internal-link target=_blank}.
## Details
From 99769b966975b85321a8213b48a57828fac9453c Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 19:57:48 +0000
Subject: [PATCH 139/217] =?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 23dbeb5b3ca9a..66b7f260e6c87 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add hyperlink to `docs/en/docs/tutorial/static-files.md`. PR [#10243](https://github.com/tiangolo/fastapi/pull/10243) by [@hungtsetse](https://github.com/hungtsetse).
* ð Add External Link: Instrument a FastAPI service adding tracing with OpenTelemetry and send/show traces in Grafana Tempo. PR [#9440](https://github.com/tiangolo/fastapi/pull/9440) by [@softwarebloat](https://github.com/softwarebloat).
* ð Review and rewording of `en/docs/contributing.md`. PR [#10480](https://github.com/tiangolo/fastapi/pull/10480) by [@nilslindemann](https://github.com/nilslindemann).
* ð Add External Link: ML serving and monitoring with FastAPI and Evidently. PR [#9701](https://github.com/tiangolo/fastapi/pull/9701) by [@mnrozhkov](https://github.com/mnrozhkov).
From b62e379a55488d523c42718616f0ad7eea526850 Mon Sep 17 00:00:00 2001
From: Ankit Anchlia
Date: Thu, 11 Jan 2024 13:59:29 -0600
Subject: [PATCH 140/217] =?UTF-8?q?=F0=9F=93=9D=20Add=20External=20Link:?=
=?UTF-8?q?=20Explore=20How=20to=20Effectively=20Use=20JWT=20With=20FastAP?=
=?UTF-8?q?I=20(#10212)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Ankit
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
---
docs/en/data/external_links.yml | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/docs/en/data/external_links.yml b/docs/en/data/external_links.yml
index 4121564426ce7..b4b8687c4d7f3 100644
--- a/docs/en/data/external_links.yml
+++ b/docs/en/data/external_links.yml
@@ -1,5 +1,9 @@
Articles:
English:
+ - author: Ankit Anchlia
+ author_link: https://linkedin.com/in/aanchlia21
+ link: https://hackernoon.com/explore-how-to-effectively-use-jwt-with-fastapi
+ title: Explore How to Effectively Use JWT With FastAPI
- author: Nicoló Lino
author_link: https://www.nlino.com
link: https://github.com/softwarebloat/python-tracing-demo
From cbcd3fe863a4ee537facb65acf0e8ef9e2b6da23 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 20:01:57 +0000
Subject: [PATCH 141/217] =?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 66b7f260e6c87..b4b137a301bd6 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Add External Link: Explore How to Effectively Use JWT With FastAPI. PR [#10212](https://github.com/tiangolo/fastapi/pull/10212) by [@aanchlia](https://github.com/aanchlia).
* ð Add hyperlink to `docs/en/docs/tutorial/static-files.md`. PR [#10243](https://github.com/tiangolo/fastapi/pull/10243) by [@hungtsetse](https://github.com/hungtsetse).
* ð Add External Link: Instrument a FastAPI service adding tracing with OpenTelemetry and send/show traces in Grafana Tempo. PR [#9440](https://github.com/tiangolo/fastapi/pull/9440) by [@softwarebloat](https://github.com/softwarebloat).
* ð Review and rewording of `en/docs/contributing.md`. PR [#10480](https://github.com/tiangolo/fastapi/pull/10480) by [@nilslindemann](https://github.com/nilslindemann).
From d192ddacec3ffc2d0ff5ec43bc7f816358ab769c Mon Sep 17 00:00:00 2001
From: Pedro Augusto de Paula Barbosa
Date: Thu, 11 Jan 2024 17:18:07 -0300
Subject: [PATCH 142/217] =?UTF-8?q?=E2=9C=8F=EF=B8=8F=20Update=20highlight?=
=?UTF-8?q?ed=20line=20in=20`docs/en/docs/tutorial/bigger-applications.md`?=
=?UTF-8?q?=20(#5490)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
---
docs/en/docs/tutorial/bigger-applications.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/en/docs/tutorial/bigger-applications.md b/docs/en/docs/tutorial/bigger-applications.md
index 9ec3720c8d714..b2d92840523a3 100644
--- a/docs/en/docs/tutorial/bigger-applications.md
+++ b/docs/en/docs/tutorial/bigger-applications.md
@@ -315,7 +315,7 @@ And we can even declare [global dependencies](dependencies/global-dependencies.m
Now we import the other submodules that have `APIRouter`s:
-```Python hl_lines="5" title="app/main.py"
+```Python hl_lines="4-5" title="app/main.py"
{!../../../docs_src/bigger_applications/app/main.py!}
```
From 53a3dd740826362dd874c92d5c08fb5f607e2bc0 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 20:18:31 +0000
Subject: [PATCH 143/217] =?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 b4b137a301bd6..80a581865240d 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* âïž Update highlighted line in `docs/en/docs/tutorial/bigger-applications.md`. PR [#5490](https://github.com/tiangolo/fastapi/pull/5490) by [@papb](https://github.com/papb).
* ð Add External Link: Explore How to Effectively Use JWT With FastAPI. PR [#10212](https://github.com/tiangolo/fastapi/pull/10212) by [@aanchlia](https://github.com/aanchlia).
* ð Add hyperlink to `docs/en/docs/tutorial/static-files.md`. PR [#10243](https://github.com/tiangolo/fastapi/pull/10243) by [@hungtsetse](https://github.com/hungtsetse).
* ð Add External Link: Instrument a FastAPI service adding tracing with OpenTelemetry and send/show traces in Grafana Tempo. PR [#9440](https://github.com/tiangolo/fastapi/pull/9440) by [@softwarebloat](https://github.com/softwarebloat).
From fd97e8efe43baced1c040cac3627904b37f2380b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20Szaci=C5=82owski?=
<44623605+piotrszacilowski@users.noreply.github.com>
Date: Thu, 11 Jan 2024 22:21:35 +0100
Subject: [PATCH 144/217] =?UTF-8?q?=F0=9F=93=9D=20Update=20usage=20of=20To?=
=?UTF-8?q?ken=20model=20in=20security=20docs=20(#9313)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Alejandra Sánchez
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
---
.../em/docs/advanced/security/oauth2-scopes.md | 6 +++---
docs/em/docs/tutorial/security/oauth2-jwt.md | 4 ++--
.../en/docs/advanced/security/oauth2-scopes.md | 18 +++++++++---------
docs/en/docs/tutorial/security/oauth2-jwt.md | 4 ++--
docs/ja/docs/tutorial/security/oauth2-jwt.md | 2 +-
docs/zh/docs/tutorial/security/oauth2-jwt.md | 2 +-
docs_src/security/tutorial004.py | 8 +++++---
docs_src/security/tutorial004_an.py | 6 +++---
docs_src/security/tutorial004_an_py310.py | 6 +++---
docs_src/security/tutorial004_an_py39.py | 6 +++---
docs_src/security/tutorial004_py310.py | 8 +++++---
docs_src/security/tutorial005.py | 8 +++++---
docs_src/security/tutorial005_an.py | 6 +++---
docs_src/security/tutorial005_an_py310.py | 6 +++---
docs_src/security/tutorial005_an_py39.py | 6 +++---
docs_src/security/tutorial005_py310.py | 8 +++++---
docs_src/security/tutorial005_py39.py | 8 +++++---
17 files changed, 61 insertions(+), 51 deletions(-)
diff --git a/docs/em/docs/advanced/security/oauth2-scopes.md b/docs/em/docs/advanced/security/oauth2-scopes.md
index a4684352ccd4d..d82fe152bef31 100644
--- a/docs/em/docs/advanced/security/oauth2-scopes.md
+++ b/docs/em/docs/advanced/security/oauth2-scopes.md
@@ -56,7 +56,7 @@ Oauth2ïžâ£ ð§ ð¬ "â" ð ð» ð ð.
ð¥, â¡ïž ð ð ð ð ð âªïžâ¡ïž ðŒ ð **ð° - ð©âð» ðŠ®** [Oauth2ïžâ£ â®ïž ð (& ð), ðš â®ïž ð¥ ð€](../../tutorial/security/oauth2-jwt.md){.internal-link target=_blank}. ð âïž Oauth2ïžâ£ â:
-```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 153"
+```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
{!../../../docs_src/security/tutorial005.py!}
```
@@ -93,7 +93,7 @@ Oauth2ïžâ£ ð§ ð¬ "â" ð ð» ð ð.
âïž ð ðž, ðââ, ð ð â ð ð ðŽ ð® â ð ð©âð» ð€ ðª âïž, âïž ð ð âïž ð.
-```Python hl_lines="153"
+```Python hl_lines="155"
{!../../../docs_src/security/tutorial005.py!}
```
@@ -118,7 +118,7 @@ Oauth2ïžâ£ ð§ ð¬ "â" ð ð» ð ð.
ð¥ ðš â«ïž ð¥ ðŠ â **FastAPI** ðµ â ð£ ð ð.
-```Python hl_lines="4 139 166"
+```Python hl_lines="4 139 168"
{!../../../docs_src/security/tutorial005.py!}
```
diff --git a/docs/em/docs/tutorial/security/oauth2-jwt.md b/docs/em/docs/tutorial/security/oauth2-jwt.md
index bc207c5666d90..bc3c943f86dc6 100644
--- a/docs/em/docs/tutorial/security/oauth2-jwt.md
+++ b/docs/em/docs/tutorial/security/oauth2-jwt.md
@@ -192,13 +192,13 @@ $ openssl rand -hex 32
=== "ð 3ïžâ£.6ïžâ£ & ð"
- ```Python hl_lines="115-128"
+ ```Python hl_lines="115-130"
{!> ../../../docs_src/security/tutorial004.py!}
```
=== "ð 3ïžâ£.1ïžâ£0ïžâ£ & ð"
- ```Python hl_lines="114-127"
+ ```Python hl_lines="114-129"
{!> ../../../docs_src/security/tutorial004_py310.py!}
```
diff --git a/docs/en/docs/advanced/security/oauth2-scopes.md b/docs/en/docs/advanced/security/oauth2-scopes.md
index 304a46090e1d7..b93d2991c4dcb 100644
--- a/docs/en/docs/advanced/security/oauth2-scopes.md
+++ b/docs/en/docs/advanced/security/oauth2-scopes.md
@@ -79,7 +79,7 @@ First, let's quickly see the parts that change from the examples in the main **T
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="3 7 11 45 63 104 106-114 120-123 127-133 138 152"
+ ```Python hl_lines="3 7 11 45 63 104 106-114 120-123 127-133 138 154"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -88,7 +88,7 @@ First, let's quickly see the parts that change from the examples in the main **T
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 153"
+ ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -97,7 +97,7 @@ First, let's quickly see the parts that change from the examples in the main **T
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 153"
+ ```Python hl_lines="2 4 8 12 46 64 105 107-115 121-124 128-134 139 155"
{!> ../../../docs_src/security/tutorial005.py!}
```
@@ -199,7 +199,7 @@ And we return the scopes as part of the JWT token.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="152"
+ ```Python hl_lines="154"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -208,7 +208,7 @@ And we return the scopes as part of the JWT token.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="153"
+ ```Python hl_lines="155"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -217,7 +217,7 @@ And we return the scopes as part of the JWT token.
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="153"
+ ```Python hl_lines="155"
{!> ../../../docs_src/security/tutorial005.py!}
```
@@ -265,7 +265,7 @@ In this case, it requires the scope `me` (it could require more than one scope).
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="3 138 165"
+ ```Python hl_lines="3 138 167"
{!> ../../../docs_src/security/tutorial005_py310.py!}
```
@@ -274,7 +274,7 @@ In this case, it requires the scope `me` (it could require more than one scope).
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="4 139 166"
+ ```Python hl_lines="4 139 168"
{!> ../../../docs_src/security/tutorial005_py39.py!}
```
@@ -283,7 +283,7 @@ In this case, it requires the scope `me` (it could require more than one scope).
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="4 139 166"
+ ```Python hl_lines="4 139 168"
{!> ../../../docs_src/security/tutorial005.py!}
```
diff --git a/docs/en/docs/tutorial/security/oauth2-jwt.md b/docs/en/docs/tutorial/security/oauth2-jwt.md
index 4159b36591942..1c792e3d9e599 100644
--- a/docs/en/docs/tutorial/security/oauth2-jwt.md
+++ b/docs/en/docs/tutorial/security/oauth2-jwt.md
@@ -285,7 +285,7 @@ Create a real JWT access token and return it
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="114-127"
+ ```Python hl_lines="114-129"
{!> ../../../docs_src/security/tutorial004_py310.py!}
```
@@ -294,7 +294,7 @@ Create a real JWT access token and return it
!!! tip
Prefer to use the `Annotated` version if possible.
- ```Python hl_lines="115-128"
+ ```Python hl_lines="115-130"
{!> ../../../docs_src/security/tutorial004.py!}
```
diff --git a/docs/ja/docs/tutorial/security/oauth2-jwt.md b/docs/ja/docs/tutorial/security/oauth2-jwt.md
index 348ffda0163e9..d5b179aa05abf 100644
--- a/docs/ja/docs/tutorial/security/oauth2-jwt.md
+++ b/docs/ja/docs/tutorial/security/oauth2-jwt.md
@@ -167,7 +167,7 @@ JWTããŒã¯ã³ã®çœ²åã«äœ¿çšããã¢ã«ãŽãªãºã `"HS256"`ãæå®ã
JWTã¢ã¯ã»ã¹ããŒã¯ã³ãäœæãããããè¿ããŸãã
-```Python hl_lines="115-128"
+```Python hl_lines="115-130"
{!../../../docs_src/security/tutorial004.py!}
```
diff --git a/docs/zh/docs/tutorial/security/oauth2-jwt.md b/docs/zh/docs/tutorial/security/oauth2-jwt.md
index 054198545ef8e..33a4d7fc76171 100644
--- a/docs/zh/docs/tutorial/security/oauth2-jwt.md
+++ b/docs/zh/docs/tutorial/security/oauth2-jwt.md
@@ -170,7 +170,7 @@ $ openssl rand -hex 32
å建并è¿åçæ£ç JWT 访é®ä»€çã
-```Python hl_lines="115-128"
+```Python hl_lines="115-130"
{!../../../docs_src/security/tutorial004.py!}
```
diff --git a/docs_src/security/tutorial004.py b/docs_src/security/tutorial004.py
index 134c15c5a0369..044eec70037da 100644
--- a/docs_src/security/tutorial004.py
+++ b/docs_src/security/tutorial004.py
@@ -112,8 +112,10 @@ async def get_current_active_user(current_user: User = Depends(get_current_user)
return current_user
-@app.post("/token", response_model=Token)
-async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends()):
+@app.post("/token")
+async def login_for_access_token(
+ form_data: OAuth2PasswordRequestForm = Depends()
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(
@@ -125,7 +127,7 @@ async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends(
access_token = create_access_token(
data={"sub": user.username}, expires_delta=access_token_expires
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial004_an.py b/docs_src/security/tutorial004_an.py
index 204151a566485..c78e8496c6427 100644
--- a/docs_src/security/tutorial004_an.py
+++ b/docs_src/security/tutorial004_an.py
@@ -115,10 +115,10 @@ async def get_current_active_user(
return current_user
-@app.post("/token", response_model=Token)
+@app.post("/token")
async def login_for_access_token(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
-):
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(
@@ -130,7 +130,7 @@ async def login_for_access_token(
access_token = create_access_token(
data={"sub": user.username}, expires_delta=access_token_expires
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial004_an_py310.py b/docs_src/security/tutorial004_an_py310.py
index 64dfa15c62718..36dbc677e0638 100644
--- a/docs_src/security/tutorial004_an_py310.py
+++ b/docs_src/security/tutorial004_an_py310.py
@@ -114,10 +114,10 @@ async def get_current_active_user(
return current_user
-@app.post("/token", response_model=Token)
+@app.post("/token")
async def login_for_access_token(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
-):
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(
@@ -129,7 +129,7 @@ async def login_for_access_token(
access_token = create_access_token(
data={"sub": user.username}, expires_delta=access_token_expires
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial004_an_py39.py b/docs_src/security/tutorial004_an_py39.py
index 631a8366eb81b..23fc04a721433 100644
--- a/docs_src/security/tutorial004_an_py39.py
+++ b/docs_src/security/tutorial004_an_py39.py
@@ -114,10 +114,10 @@ async def get_current_active_user(
return current_user
-@app.post("/token", response_model=Token)
+@app.post("/token")
async def login_for_access_token(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
-):
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(
@@ -129,7 +129,7 @@ async def login_for_access_token(
access_token = create_access_token(
data={"sub": user.username}, expires_delta=access_token_expires
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial004_py310.py b/docs_src/security/tutorial004_py310.py
index 470f22e29f03b..8363d45ab5349 100644
--- a/docs_src/security/tutorial004_py310.py
+++ b/docs_src/security/tutorial004_py310.py
@@ -111,8 +111,10 @@ async def get_current_active_user(current_user: User = Depends(get_current_user)
return current_user
-@app.post("/token", response_model=Token)
-async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends()):
+@app.post("/token")
+async def login_for_access_token(
+ form_data: OAuth2PasswordRequestForm = Depends()
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(
@@ -124,7 +126,7 @@ async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends(
access_token = create_access_token(
data={"sub": user.username}, expires_delta=access_token_expires
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial005.py b/docs_src/security/tutorial005.py
index ece461bc8ac36..b16bf440a51c1 100644
--- a/docs_src/security/tutorial005.py
+++ b/docs_src/security/tutorial005.py
@@ -143,8 +143,10 @@ async def get_current_active_user(
return current_user
-@app.post("/token", response_model=Token)
-async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends()):
+@app.post("/token")
+async def login_for_access_token(
+ form_data: OAuth2PasswordRequestForm = Depends()
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(status_code=400, detail="Incorrect username or password")
@@ -153,7 +155,7 @@ async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends(
data={"sub": user.username, "scopes": form_data.scopes},
expires_delta=access_token_expires,
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial005_an.py b/docs_src/security/tutorial005_an.py
index c5b5609e525e0..95e406b32f748 100644
--- a/docs_src/security/tutorial005_an.py
+++ b/docs_src/security/tutorial005_an.py
@@ -144,10 +144,10 @@ async def get_current_active_user(
return current_user
-@app.post("/token", response_model=Token)
+@app.post("/token")
async def login_for_access_token(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
-):
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(status_code=400, detail="Incorrect username or password")
@@ -156,7 +156,7 @@ async def login_for_access_token(
data={"sub": user.username, "scopes": form_data.scopes},
expires_delta=access_token_expires,
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial005_an_py310.py b/docs_src/security/tutorial005_an_py310.py
index 5e81a50e12d63..c6116a5ed120f 100644
--- a/docs_src/security/tutorial005_an_py310.py
+++ b/docs_src/security/tutorial005_an_py310.py
@@ -143,10 +143,10 @@ async def get_current_active_user(
return current_user
-@app.post("/token", response_model=Token)
+@app.post("/token")
async def login_for_access_token(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
-):
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(status_code=400, detail="Incorrect username or password")
@@ -155,7 +155,7 @@ async def login_for_access_token(
data={"sub": user.username, "scopes": form_data.scopes},
expires_delta=access_token_expires,
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial005_an_py39.py b/docs_src/security/tutorial005_an_py39.py
index ae9811c689f5b..af51c08b5081d 100644
--- a/docs_src/security/tutorial005_an_py39.py
+++ b/docs_src/security/tutorial005_an_py39.py
@@ -143,10 +143,10 @@ async def get_current_active_user(
return current_user
-@app.post("/token", response_model=Token)
+@app.post("/token")
async def login_for_access_token(
form_data: Annotated[OAuth2PasswordRequestForm, Depends()]
-):
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(status_code=400, detail="Incorrect username or password")
@@ -155,7 +155,7 @@ async def login_for_access_token(
data={"sub": user.username, "scopes": form_data.scopes},
expires_delta=access_token_expires,
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial005_py310.py b/docs_src/security/tutorial005_py310.py
index 0fcdda4c004c6..37a22c70907f6 100644
--- a/docs_src/security/tutorial005_py310.py
+++ b/docs_src/security/tutorial005_py310.py
@@ -142,8 +142,10 @@ async def get_current_active_user(
return current_user
-@app.post("/token", response_model=Token)
-async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends()):
+@app.post("/token")
+async def login_for_access_token(
+ form_data: OAuth2PasswordRequestForm = Depends()
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(status_code=400, detail="Incorrect username or password")
@@ -152,7 +154,7 @@ async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends(
data={"sub": user.username, "scopes": form_data.scopes},
expires_delta=access_token_expires,
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
diff --git a/docs_src/security/tutorial005_py39.py b/docs_src/security/tutorial005_py39.py
index d756c0b6b87f9..c275807636c4b 100644
--- a/docs_src/security/tutorial005_py39.py
+++ b/docs_src/security/tutorial005_py39.py
@@ -143,8 +143,10 @@ async def get_current_active_user(
return current_user
-@app.post("/token", response_model=Token)
-async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends()):
+@app.post("/token")
+async def login_for_access_token(
+ form_data: OAuth2PasswordRequestForm = Depends()
+) -> Token:
user = authenticate_user(fake_users_db, form_data.username, form_data.password)
if not user:
raise HTTPException(status_code=400, detail="Incorrect username or password")
@@ -153,7 +155,7 @@ async def login_for_access_token(form_data: OAuth2PasswordRequestForm = Depends(
data={"sub": user.username, "scopes": form_data.scopes},
expires_delta=access_token_expires,
)
- return {"access_token": access_token, "token_type": "bearer"}
+ return Token(access_token=access_token, token_type="bearer")
@app.get("/users/me/", response_model=User)
From 22e68b151d92aff6d6e0cdf001b08a792e20020d Mon Sep 17 00:00:00 2001
From: github-actions
Date: Thu, 11 Jan 2024 21:21:57 +0000
Subject: [PATCH 145/217] =?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 80a581865240d..945d342d95279 100644
--- a/docs/en/docs/release-notes.md
+++ b/docs/en/docs/release-notes.md
@@ -9,6 +9,7 @@ hide:
### Docs
+* ð Update usage of Token model in security docs. PR [#9313](https://github.com/tiangolo/fastapi/pull/9313) by [@piotrszacilowski](https://github.com/piotrszacilowski).
* âïž Update highlighted line in `docs/en/docs/tutorial/bigger-applications.md`. PR [#5490](https://github.com/tiangolo/fastapi/pull/5490) by [@papb](https://github.com/papb).
* ð Add External Link: Explore How to Effectively Use JWT With FastAPI. PR [#10212](https://github.com/tiangolo/fastapi/pull/10212) by [@aanchlia](https://github.com/aanchlia).
* ð Add hyperlink to `docs/en/docs/tutorial/static-files.md`. PR [#10243](https://github.com/tiangolo/fastapi/pull/10243) by [@hungtsetse](https://github.com/hungtsetse).
From 0c796747a3d652f7d5d7fc59c5fbb68512b64ccf Mon Sep 17 00:00:00 2001
From: Ezzeddin Abdullah
Date: Fri, 12 Jan 2024 00:25:37 +0200
Subject: [PATCH 146/217] =?UTF-8?q?=F0=9F=93=9D=20Update=20template=20docs?=
=?UTF-8?q?=20with=20more=20info=20about=20`url=5Ffor`=20(#5937)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Co-authored-by: Sebastián RamÃrez
---
docs/en/docs/advanced/templates.md | 48 +++++++++++++++++--
docs_src/templates/templates/item.html | 2 +-
.../test_templates/test_tutorial001.py | 5 +-
3 files changed, 49 insertions(+), 6 deletions(-)
diff --git a/docs/en/docs/advanced/templates.md b/docs/en/docs/advanced/templates.md
index 583abda7fb0e4..6055b30170db6 100644
--- a/docs/en/docs/advanced/templates.md
+++ b/docs/en/docs/advanced/templates.md
@@ -46,21 +46,61 @@ $ pip install jinja2
## Writing templates
-Then you can write a template at `templates/item.html` with:
+Then you can write a template at `templates/item.html` with, for example:
```jinja hl_lines="7"
{!../../../docs_src/templates/templates/item.html!}
```
-It will show the `id` taken from the "context" `dict` you passed:
+### Template Context Values
+
+In the HTML that contains:
+
+{% raw %}
+
+```jinja
+Item ID: {{ id }}
+```
+
+{% endraw %}
+
+...it will show the `id` taken from the "context" `dict` you passed:
```Python
-{"request": request, "id": id}
+{"id": id}
+```
+
+For example, with an ID of `42`, this would render:
+
+```html
+Item ID: 42
+```
+
+### Template `url_for` Arguments
+
+You can also use `url_for()` inside of the template, it takes as arguments the same arguments that would be used by your *path operation function*.
+
+So, the section with:
+
+{% raw %}
+
+```jinja
+
+```
+
+{% endraw %}
+
+...will generate a link to the same URL that would be handled by the *path operation function* `read_item(id=id)`.
+
+For example, with an ID of `42`, this would render:
+
+```html
+
```
## Templates and static files
-You can also use `url_for()` inside of the template, and use it, for example, with the `StaticFiles` you mounted.
+You can also use `url_for()` inside of the template, and use it, for example, with the `StaticFiles` you mounted with the `name="static"`.
```jinja hl_lines="4"
{!../../../docs_src/templates/templates/item.html!}
diff --git a/docs_src/templates/templates/item.html b/docs_src/templates/templates/item.html
index a70287e77d345..27994ca994b00 100644
--- a/docs_src/templates/templates/item.html
+++ b/docs_src/templates/templates/item.html
@@ -4,6 +4,6 @@
- Item ID: {{ id }}
+