Compare commits

...

2074 Commits

Author SHA1 Message Date
Marcelo Trylesinski
28bd5ca47e Update README.md 2024-01-26 03:13:57 -07:00
github-actions
92feb73531 📝 Update release notes 2024-01-25 15:09:59 +00:00
Luccas Mateus
d693d0a980 🌐 Add Portuguese translation for docs/pt/docs/tutorial/schema-extra-example.md (#4065) 2024-01-25 10:05:24 -05:00
github-actions
1b01cbe092 📝 Update release notes 2024-01-25 15:03:50 +00:00
Hasan Sezer Taşan
5d74e58e95 🌐 Add Turkish translation for docs/tr/docs/history-design-future.md (#11012) 2024-01-25 09:59:43 -05:00
github-actions
06bdf03bce 📝 Update release notes 2024-01-25 14:59:03 +00:00
github-actions
01c56c059e 📝 Update release notes 2024-01-25 14:58:23 +00:00
Hasan Sezer Taşan
3e98fb9c83 🌐 Add Turkish translation for docs/tr/docs/resources/index.md (#11020) 2024-01-25 09:57:16 -05:00
Hasan Sezer Taşan
ecee093e34 🌐 Add Turkish translation for docs/tr/docs/how-to/index.md (#11021) 2024-01-25 09:56:05 -05:00
github-actions
28e679d6dc 📝 Update release notes 2024-01-25 14:55:49 +00:00
Nils Lindemann
e55c7ccbcb 🌐 Add German translation for docs/de/docs/tutorial/query-params.md (#10293) 2024-01-25 09:53:41 -05:00
github-actions
9af7f2a5d5 📝 Update release notes 2024-01-25 14:53:25 +00:00
Jessica Temporal
9ee70f82e7 📝 Add External Link: Tips on migrating from Flask to FastAPI and vice-versa (#11029) 2024-01-25 09:53:05 -05:00
github-actions
e96e74ad36 📝 Update release notes 2024-01-23 17:32:19 +00:00
Alejandra
8e9af7932c 🔧 Add Italian to mkdocs.yml (#11016) 2024-01-23 12:31:56 -05:00
github-actions
4c077492ae 📝 Update release notes 2024-01-23 16:04:37 +00:00
Nils Lindemann
dcf8b24ece 🌐 Add German translation for docs/de/docs/benchmarks.md (#10866) 2024-01-23 11:04:13 -05:00
github-actions
6aa521aa03 📝 Update release notes 2024-01-23 16:02:56 +00:00
Hasan Sezer Taşan
aae29cac5c 🌐 Add Turkish translation for docs/tr/docs/learn/index.md (#11014) 2024-01-23 11:02:27 -05:00
github-actions
9a5181abfc 📝 Update release notes 2024-01-23 15:06:34 +00:00
mojtaba
30f31540fc 🌐 Add Persian translation for docs/fa/docs/tutorial/security/index.md (#9945) 2024-01-23 10:06:11 -05:00
github-actions
30f1a1c4ef 📝 Update release notes 2024-01-23 14:19:05 +00:00
github-actions
a12c5db74c 📝 Update release notes 2024-01-23 14:16:59 +00:00
github-actions
2341f72101 📝 Update release notes 2024-01-23 14:15:50 +00:00
Hasan Sezer Taşan
754ea10fcc 🌐 Add Turkish translation for docs/tr/docs/help/index.md (#11013) 2024-01-23 09:13:01 -05:00
github-actions
39cff8d7d6 📝 Update release notes 2024-01-23 14:12:29 +00:00
Hasan Sezer Taşan
7586688cc9 🌐 Add Turkish translation for docs/tr/docs/about/index.md (#11006) 2024-01-23 09:11:15 -05:00
github-actions
9e06513033 📝 Update release notes 2024-01-23 14:10:41 +00:00
Hasan Sezer Taşan
189f679f9b 🌐 Update Turkish translation for docs/tr/docs/benchmarks.md (#11005) 2024-01-23 09:10:30 -05:00
github-actions
6d46b60cb3 📝 Update release notes 2024-01-23 14:09:56 +00:00
github-actions
f021ccb905 📝 Update release notes 2024-01-23 14:09:28 +00:00
Matteo
aa3ed353b3 🌐 Add Italian translation for docs/it/docs/index.md (#5233) 2024-01-23 09:06:33 -05:00
Kani Kim
3351674918 🌐 Add Korean translation for docs/ko/docs/help/index.md (#10983) 2024-01-23 09:05:09 -05:00
Kani Kim
058044fdb1 🌐 Add Korean translation for docs/ko/docs/features.md (#10976) 2024-01-23 09:04:27 -05:00
DoHyun Kim
0ec0df5090 🌐 Add Korean translation for docs/ko/docs/tutorial/security/get-current-user.md (#5737) 2024-01-23 09:02:49 -05:00
github-actions
a56d32c3a4 📝 Update release notes 2024-01-23 14:01:38 +00:00
Aleksandr Andrukhov
9060c427a6 🌐 Add Russian translation for docs/ru/docs/tutorial/security/first-steps.md (#10541) 2024-01-23 09:00:11 -05:00
github-actions
0fb326fc6e 📝 Update release notes 2024-01-23 13:58:04 +00:00
github-actions
cc9c448ed4 📝 Update release notes 2024-01-23 13:57:19 +00:00
github-actions
ccdc962936 📝 Update release notes 2024-01-23 13:56:42 +00:00
Aleksandr Andrukhov
ac5e73b19d 🌐 Add Russian translation for docs/ru/docs/tutorial/handling-errors.md (#10375) 2024-01-23 08:56:29 -05:00
Aleksandr Andrukhov
672b501b98 🌐 Add Russian translation for docs/ru/docs/tutorial/encoder.md (#10374) 2024-01-23 08:56:12 -05:00
Aleksandr Andrukhov
95d5902af1 🌐 Add Russian translation for docs/ru/docs/tutorial/body-updates.md (#10373) 2024-01-23 08:55:32 -05:00
github-actions
315d8184e7 📝 Update release notes 2024-01-23 13:54:45 +00:00
Nikita
5132976253 🌐 Russian translation: updated fastapi-people.md. (#10255) 2024-01-23 08:54:17 -05:00
github-actions
280f49ea83 📝 Update release notes 2024-01-23 13:15:22 +00:00
github-actions
7c9cb476a4 📝 Update release notes 2024-01-23 13:11:16 +00:00
3w36zj6
13b908df68 🌐 Add Japanese translation for docs/ja/docs/tutorial/security/index.md (#5798) 2024-01-23 08:10:49 -05:00
github-actions
5ca3d17587 📝 Update release notes 2024-01-23 13:08:30 +00:00
Nils Lindemann
74cf1c9702 🌐 Add German translation for docs/de/docs/advanced/generate-clients.md (#10725) 2024-01-23 08:07:40 -05:00
Nils Lindemann
43a7ff782b 🌐 Add German translation for docs/de/docs/advanced/openapi-webhooks.md (#10712) 2024-01-23 08:06:03 -05:00
github-actions
2c1dd4a92b 📝 Update release notes 2024-01-23 13:05:40 +00:00
github-actions
149fa96dc7 📝 Update release notes 2024-01-23 13:05:21 +00:00
Nils Lindemann
c3914a19a7 🌐 Add German translation for docs/de/docs/advanced/custom-response.md (#10624) 2024-01-23 08:05:12 -05:00
Nils Lindemann
690edc0385 🌐 Add German translation for docs/de/docs/advanced/additional-status-codes.md (#10617) 2024-01-23 08:04:57 -05:00
github-actions
cedea4d7b5 📝 Update release notes 2024-01-23 11:27:20 +00:00
Johannes Jungbluth
2f6fdf62b9 🌐 Add German translation for docs/de/docs/tutorial/middleware.md (#10391) 2024-01-23 06:26:59 -05:00
github-actions
d2d5a5290c 📝 Update release notes 2024-01-23 11:22:48 +00:00
Nils Lindemann
9a33950344 🌐 Add German translation for introduction documents (#10497) 2024-01-23 06:22:17 -05:00
github-actions
d7c588d693 📝 Update release notes 2024-01-22 20:18:27 +00:00
github-actions
c945d686bb 📝 Update release notes 2024-01-22 20:12:06 +00:00
SwftAlpc
851daec754 🌐 Add Japanese translation for docs/ja/docs/tutorial/encoder.md (#1955) 2024-01-22 15:09:02 -05:00
github-actions
f772868a56 📝 Update release notes 2024-01-22 20:06:11 +00:00
github-actions
7514aab30b 📝 Update release notes 2024-01-22 20:02:56 +00:00
SwftAlpc
1ac6b761e1 🌐 Add Japanese translation for docs/ja/docs/tutorial/extra-data-types.md (#1932) 2024-01-22 15:01:49 -05:00
github-actions
29c8b19af8 📝 Update release notes 2024-01-22 19:58:14 +00:00
bilal alpaslan
63ffd735d1 🌐 Add Turkish translation docs/tr/docs/async.md (#5191) 2024-01-22 14:57:04 -05:00
bilal alpaslan
0a105dc285 🌐 Add Turkish translation for docs/tr/docs/project-generation.md (#5192) 2024-01-22 14:55:41 -05:00
github-actions
f8e77fb64c 📝 Update release notes 2024-01-22 19:55:21 +00:00
github-actions
22c34a3956 📝 Update release notes 2024-01-22 19:54:45 +00:00
HyeonJeong Yeo
6c3d8eb2d9 🌐 Add Korean translation for docs/ko/docs/deployment/docker.md (#5657) 2024-01-22 14:50:44 -05:00
github-actions
6f42234301 📝 Update release notes 2024-01-22 19:49:43 +00:00
gyudoza
79ab317cbd 🌐 Add Korean translation for docs/ko/docs/deployment/server-workers.md (#4935) 2024-01-22 14:49:13 -05:00
gyudoza
3f95f6fe41 🌐 Add Korean translation for docs/ko/docs/deployment/index.md (#4561) 2024-01-22 14:47:57 -05:00
github-actions
167d2524b4 📝 Update release notes 2024-01-22 19:47:31 +00:00
github-actions
d532602eed 📝 Update release notes 2024-01-22 19:46:50 +00:00
github-actions
77fe266a69 📝 Update release notes 2024-01-22 19:44:45 +00:00
jungsu.kwon
66ef70a2ba 🌐 Add Korean translation for docs/ko/docs/tutorial/path-operation-configuration.md (#3639) 2024-01-22 14:43:22 -05:00
清靈語
792ba01745 🌐 Modify the description of zh - Traditional Chinese (#10889)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-22 20:42:53 +01:00
Jeesang Kim
ea6e0ffdc0 🌐 Add Korean translation for docs/ko/docs/tutorial/static-files.md (#2957) 2024-01-22 14:42:37 -05:00
Spike Ho Yeol Lee
8ec9e30010 🌐 Add Korean translation for docs/ko/docs/tutorial/response-model.md (#2766) 2024-01-22 14:41:09 -05:00
github-actions
ef1ccb563d 📝 Update release notes 2024-01-22 19:39:50 +00:00
github-actions
adf61e5675 📝 Update release notes 2024-01-22 19:39:08 +00:00
Dahun Jeong
83944b9e26 🌐 Add Korean translation for docs/ko/docs/tutorial/body-multiple-params.md (#2461) 2024-01-22 14:37:52 -05:00
Spike Ho Yeol Lee
87a4c9ef01 🌐 Add Korean translation for docs/ko/docs/tutorial/query-params-str-validations.md (#2415) 2024-01-22 14:37:01 -05:00
github-actions
eea7635713 📝 Update release notes 2024-01-22 19:36:25 +00:00
JRIM
2a8f8d1ac0 🌐 Add Korean translation for docs/ko/docs/python-types.md (#2267) 2024-01-22 14:34:47 -05:00
github-actions
5fb87313e2 📝 Update release notes 2024-01-22 19:31:48 +00:00
Spike Ho Yeol Lee
01d774d38c 🌐 Add Korean translation for docs/ko/docs/tutorial/body-nested-models.md (#2506) 2024-01-22 14:31:27 -05:00
github-actions
896f171aa2 📝 Update release notes 2024-01-22 19:26:37 +00:00
Sebastián Ramírez
2fe1a1387b 🔨 Verify mkdocs.yml languages in CI, update docs.py (#11009) 2024-01-22 20:26:14 +01:00
github-actions
60ea8f85a1 📝 Update release notes 2024-01-22 18:43:31 +00:00
Alejandra
62e6c888b7 🔧 Update config in label-approved.yml to accept translations with 1 reviewer (#11007) 2024-01-22 19:43:10 +01:00
github-actions
510c7a56a4 📝 Update release notes 2024-01-19 23:05:10 +00:00
Kani Kim
c3019096e7 🌐 Add Korean translation for docs/ko/docs/learn/index.md (#10977) 2024-01-19 18:04:42 -05:00
github-actions
d74b3b2565 📝 Update release notes 2024-01-17 17:15:47 +00:00
Max Su
df09e0a3f6 🌐 Initialize translations for Traditional Chinese (#10505)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-17 18:15:27 +01:00
github-actions
fc8ea413eb 📝 Update release notes 2024-01-16 13:23:49 +00:00
Sebastián Ramírez
950d9ce74d 📝 Deprecate old tutorials: Peewee, Couchbase, encode/databases (#10979) 2024-01-16 14:23:25 +01:00
github-actions
d761a29908 📝 Update release notes 2024-01-16 12:11:43 +00:00
Nils Lindemann
d1e533e370 ✏️ Tweak the german translation of docs/de/docs/tutorial/index.md (#10962) 2024-01-16 07:11:15 -05:00
github-actions
ae92e563b1 📝 Update release notes 2024-01-15 21:41:21 +00:00
ChanHaeng Lee
75ea31c79e ✏️ Fix typo error in docs/ko/docs/tutorial/path-params.md (#10758) 2024-01-15 16:40:57 -05:00
github-actions
2ce4c102fb 📝 Update release notes 2024-01-15 20:42:07 +00:00
Rafal Skolasinski
8450dc204d ✏️ Fix typo in fastapi/security/oauth2.py (#10972) 2024-01-15 21:41:47 +01:00
github-actions
2c670325af 📝 Update release notes 2024-01-15 16:47:21 +00:00
github-actions
e500f99403 📝 Update release notes 2024-01-15 16:45:17 +00:00
SwftAlpc
7b462b2e69 🌐 Add Japanese translation for docs/ja/docs/tutorial/dependencies/dependencies-with-yield.md (#1961)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 16:45:09 +00:00
SwftAlpc
b518241c59 🌐 Add Japanese translation for docs/ja/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md (#1960)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 17:44:28 +01:00
github-actions
082eb21ba0 📝 Update release notes 2024-01-15 16:44:02 +00:00
SwftAlpc
c68836ae46 🌐 Add Japanese translation for docs/ja/docs/tutorial/dependencies/sub-dependencies.md (#1959)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 17:43:41 +01:00
github-actions
6f3a134f6d 📝 Update release notes 2024-01-15 16:18:40 +00:00
github-actions
94404fc1a0 📝 Update release notes 2024-01-15 16:16:10 +00:00
tokusumi
289fbc83ba 🌐 Add Japanese translation for docs/ja/docs/tutorial/background-tasks.md (#2668)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 11:12:39 -05:00
github-actions
8ad62bd837 📝 Update release notes 2024-01-15 16:10:30 +00:00
SwftAlpc
39bb4bbdfc 🌐 Add Japanese translation for docs/ja/docs/tutorial/dependencies/index.md and docs/ja/docs/tutorial/dependencies/classes-as-dependencies.md (#1958)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 11:08:16 -05:00
SwftAlpc
5c71522974 🌐 Add Japanese translation for docs/ja/docs/tutorial/response-model.md (#1938)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: atsumi <atsumi.tatsuya@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 11:01:54 -05:00
github-actions
bf9489c0ad 📝 Update release notes 2024-01-15 15:53:17 +00:00
github-actions
997281bf83 📝 Update release notes 2024-01-15 15:51:30 +00:00
github-actions
1cf1ee42fe 📝 Update release notes 2024-01-15 15:48:57 +00:00
SwftAlpc
a14907a47d 🌐 Add Japanese translation for docs/ja/docs/tutorial/body-multiple-params.md (#1903)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 10:48:41 -05:00
github-actions
eed57df6f6 📝 Update release notes 2024-01-15 15:46:53 +00:00
SwftAlpc
b73de83ca2 🌐 Add Japanese translation for docs/ja/docs/tutorial/path-params-numeric-validations.md (#1902)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-15 10:46:32 -05:00
github-actions
b21599bab0 📝 Update release notes 2024-01-15 15:46:12 +00:00
SwftAlpc
efac3a293f 🌐 Add Japanese translation for docs/ja/docs/python-types.md (#1899)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 10:45:27 -05:00
SwftAlpc
217bff20ca 🌐 Add Japanese translation for docs/ja/docs/tutorial/handling-errors.md (#1953)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 10:43:45 -05:00
SwftAlpc
88225ae231 🌐 Add Japanese translation for docs/ja/docs/tutorial/response-status-code.md (#1942)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 10:42:08 -05:00
github-actions
17511f7768 📝 Update release notes 2024-01-15 15:38:58 +00:00
github-actions
f386011d64 📝 Update release notes 2024-01-15 15:38:18 +00:00
SwftAlpc
c238292b44 🌐 Add Japanese translation for docs/ja/docs/tutorial/extra-models.md (#1941)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 16:36:32 +01:00
github-actions
79dbb11867 📝 Update release notes 2024-01-15 15:35:41 +00:00
SwftAlpc
2619bbd7cd 🌐 Add Japanese tranlsation for docs/ja/docs/tutorial/schema-extra-example.md (#1931)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 16:35:25 +01:00
SwftAlpc
88f19be7c3 🌐 Add Japanese translation for docs/ja/docs/tutorial/body-nested-models.md (#1930)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 16:34:57 +01:00
github-actions
467ab2a575 📝 Update release notes 2024-01-15 15:33:51 +00:00
SwftAlpc
15429a9c39 🌐 Add Japanese translation for docs/ja/docs/tutorial/body-fields.md (#1923)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: tokusumi <tksmtoms@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 16:33:28 +01:00
github-actions
32ae949723 📝 Update release notes 2024-01-15 15:17:54 +00:00
Pedro Augusto de Paula Barbosa
cf01195555 📝 Update HTTPException details in docs/en/docs/tutorial/handling-errors.md (#5418)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-15 16:17:34 +01:00
github-actions
2b6f12a5d0 📝 Update release notes 2024-01-15 15:14:34 +00:00
Sebastián Ramírez
63e5396a78 👷 Add changes-requested handling in GitHub Action issue manager (#10971) 2024-01-15 16:13:48 +01:00
github-actions
69dc735fc2 📝 Update release notes 2024-01-15 10:32:42 +00:00
Sebastián Ramírez
dcc952d699 Include HTTP 205 in status codes with no body (#10969) 2024-01-15 11:32:16 +01:00
github-actions
e90fc7bed4 📝 Update release notes 2024-01-13 15:10:47 +00:00
Emmett Butler
f18eadb7de Refactor tests for duplicate operation ID generation for compatibility with other tools running the FastAPI test suite (#10876)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-13 16:10:26 +01:00
github-actions
61a08d0c60 📝 Update release notes 2024-01-13 14:31:58 +00:00
Evgenii
de0126d145 ♻️ Simplify string format with f-strings in fastapi/utils.py (#10576)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-13 15:31:38 +01:00
github-actions
cca6203c18 📝 Update release notes 2024-01-13 12:19:28 +00:00
Nils Lindemann
83e386519d ✏️ A few tweaks in docs/de/docs/tutorial/first-steps.md (#10959) 2024-01-13 07:16:22 -05:00
github-actions
b24c4870d8 📝 Update release notes 2024-01-13 12:10:29 +00:00
Nils Lindemann
bc13faa15d ✏️ Fix link in docs/en/docs/advanced/async-tests.md (#10960) 2024-01-13 07:07:15 -05:00
github-actions
5377c594da 📝 Update release notes 2024-01-13 12:00:11 +00:00
Juan José López Lira
a37ac3819e ✏️ Fix typos for Spanish documentation (#10957) 2024-01-13 06:57:27 -05:00
github-actions
4299e712fb 📝 Update release notes 2024-01-13 11:51:55 +00:00
fhabers21
c3e2aa9dc2 🌐 Add German translation for docs/de/docs/tutorial/index.md (#9502)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-13 06:50:36 -05:00
github-actions
cc5711e6f1 📝 Update release notes 2024-01-13 11:49:51 +00:00
Ahmed Ashraf
1caee0f105 ✏️ Fix Pydantic method name in docs/en/docs/advanced/path-operation-advanced-configuration.md (#10826)
Co-authored-by: Ahmed Ashraf <root@xps>
2024-01-13 06:49:05 -05:00
github-actions
1ce27fd743 📝 Update release notes 2024-01-13 01:00:55 +00:00
Marcelo Trylesinski
fad1a464e7 🔧 Group dependencies on dependabot updates (#10952) 2024-01-13 02:00:31 +01:00
github-actions
26e57903d1 📝 Update release notes 2024-01-12 15:14:18 +00:00
dependabot[bot]
b0cd4f915b ⬆ Bump actions/setup-python from 4 to 5 (#10764)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 16:13:58 +01:00
github-actions
bc7d026b6c 📝 Update release notes 2024-01-12 15:04:40 +00:00
github-actions
c9e46ae12c 📝 Update release notes 2024-01-12 15:02:38 +00:00
dependabot[bot]
a293709998 ⬆ Bump pypa/gh-action-pypi-publish from 1.8.10 to 1.8.11 (#10731)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.10 to 1.8.11.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.10...v1.8.11)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 10:01:52 -05:00
Jiri Daněk
25646a5070 🔧 Fix Ruff configuration unintentionally enabling and re-disabling mccabe complexity check (#10893)
Fix mistake in Ruff configuration unintentionally enabling mccabe complexity check

Enabling "C" turns on complexity checks (C90, mccabe), which is unintended
Instead, enable "C4" to get flake8-comprehensions checks

See docs at https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-12 16:01:06 +01:00
github-actions
0ce4f80ac9 📝 Update release notes 2024-01-12 15:00:39 +00:00
dependabot[bot]
91666b3556 ⬆ Bump dawidd6/action-download-artifact from 2.28.0 to 3.0.0 (#10777)
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 2.28.0 to 3.0.0.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v2.28.0...v3.0.0)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-12 10:00:18 -05:00
github-actions
22e5d9e27f 📝 Update release notes 2024-01-12 14:52:20 +00:00
ooknimm
be0bd34446 Re-enable test in tests/test_tutorial/test_header_params/test_tutorial003.py after fix in Starlette (#10904)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-12 15:52:00 +01:00
github-actions
44f3ebce6e 📝 Update release notes 2024-01-12 14:38:40 +00:00
Sebastián Ramírez
0aee526de9 🔧 Add support for translations to languages with a longer code name, like zh-hant (#10950) 2024-01-12 14:38:17 +00:00
github-actions
4f9ad80f5d 📝 Update release notes 2024-01-12 14:15:52 +00:00
Nils Lindemann
c81ab17a59 🌐 Add German translation for docs/de/docs/tutorial/background-tasks.md (#10566) 2024-01-12 09:15:29 -05:00
github-actions
ca33b6edac 📝 Update release notes 2024-01-12 14:10:54 +00:00
Delitel-WEB
58e2f8b1d9 ✏️ Fix typo in docs/ru/docs/index.md (#10672) 2024-01-12 09:10:31 -05:00
github-actions
38915783fc 📝 Update release notes 2024-01-12 14:03:51 +00:00
Jacob McDonald
7e0e16fa36 📝 Add warning about lifespan functions and backwards compatibility with events (#10734)
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
2024-01-12 15:03:25 +01:00
github-actions
dc704036a2 📝 Update release notes 2024-01-12 13:40:15 +00:00
theoohoho
f1329abf99 ✏️ Fix broken link in docs/tutorial/sql-databases.md in several languages (#10716) 2024-01-12 08:39:54 -05:00
github-actions
753c8136d8 📝 Update release notes 2024-01-12 11:15:04 +00:00
github-actions
6a4aed45f0 📝 Update release notes 2024-01-12 11:13:22 +00:00
HiemalBeryl
4c231854dc ✏️ Fix typos in docs/zh/docs/tutorial/extra-data-types.md (#10727) 2024-01-12 12:13:04 +01:00
Aleksandr Andrukhov
3ca38568c1 🌐 Add Russian translation for docs/ru/docs/tutorial/dependencies/classes-as-dependencies.md (#10410)
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2024-01-12 12:12:19 +01:00
github-actions
e0eaaee749 📝 Update release notes 2024-01-12 11:11:15 +00:00
Turabek Gaybullaev
ea84587a2f ✏️ Remove broken links from external_links.yml (#10943) 2024-01-12 12:10:55 +01:00
github-actions
5f37d3870b 📝 Update release notes 2024-01-11 22:25:58 +00:00
Ezzeddin Abdullah
0c796747a3 📝 Update template docs with more info about url_for (#5937)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-11 23:25:37 +01:00
github-actions
22e68b151d 📝 Update release notes 2024-01-11 21:21:57 +00:00
Piotr Szaciłowski
fd97e8efe4 📝 Update usage of Token model in security docs (#9313)
Co-authored-by: Alejandra Sánchez <ing.alejandrasanchezv@gmail.com>
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>
2024-01-11 16:21:35 -05:00
github-actions
53a3dd7408 📝 Update release notes 2024-01-11 20:18:31 +00:00
Pedro Augusto de Paula Barbosa
d192ddacec ✏️ Update highlighted line in docs/en/docs/tutorial/bigger-applications.md (#5490)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
2024-01-11 21:18:07 +01:00
github-actions
cbcd3fe863 📝 Update release notes 2024-01-11 20:01:57 +00:00
Ankit Anchlia
b62e379a55 📝 Add External Link: Explore How to Effectively Use JWT With FastAPI (#10212)
Co-authored-by: Ankit <aanchlia@bluemoonforms.com>
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
2024-01-11 20:59:29 +01:00
github-actions
99769b9669 📝 Update release notes 2024-01-11 19:57:48 +00:00
Hungtsetse
f74aeb0067 📝 Add hyperlink to docs/en/docs/tutorial/static-files.md (#10243) 2024-01-11 14:56:09 -05:00
github-actions
4dde172a96 📝 Update release notes 2024-01-11 19:52:37 +00:00
Nicoló Lino
e6759aa604 📝 Add External Link: Instrument a FastAPI service adding tracing with OpenTelemetry and send/show traces in Grafana Tempo (#9440)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
2024-01-11 14:52:15 -05:00
github-actions
0be64abac7 📝 Update release notes 2024-01-11 17:43:08 +00:00
Nils Lindemann
0380ca3e69 📝 Review and rewording of en/docs/contributing.md (#10480)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-11 21:42:43 +04:00
github-actions
3325635eed 📝 Update release notes 2024-01-11 17:29:48 +00:00
Mikhail Rozhkov
abe7db6b24 📝 Add External Link: ML serving and monitoring with FastAPI and Evidently (#9701)
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>
2024-01-11 21:29:24 +04:00
github-actions
6761fc1fa4 📝 Update release notes 2024-01-11 16:31:38 +00:00
malicious
838e9c964e 📝 Reword in docs, from "have in mind" to "keep in mind" (#10376)
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
2024-01-11 20:31:18 +04:00
github-actions
facdc91629 📝 Update release notes 2024-01-11 16:07:29 +00:00
Jeny Sadadia
1369c45c2e 📝 Add External Link: Talk by Jeny Sadadia (#10265)
Signed-off-by: Jeny Sadadia <jeny.sadadia@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-11 16:07:05 +00:00
github-actions
fedee4d028 📝 Update release notes 2024-01-11 15:59:47 +00:00
Nils Lindemann
6bda1326a4 📝 Add location info to tutorial/bigger-applications.md (#10552) 2024-01-11 16:59:27 +01:00
Sebastián Ramírez
cb95d1cb89 🔖 Release version 0.109.0 2024-01-11 16:32:00 +01:00
github-actions
7c1aeb5db2 📝 Update release notes 2024-01-11 15:30:35 +00:00
Sebastián Ramírez
5e583199b3 ⬆️ Upgrade Starlette to >=0.35.0,<0.36.0 (#10938) 2024-01-11 16:29:54 +01:00
github-actions
c3e0625423 📝 Update release notes 2024-01-11 14:35:15 +00:00
s111d
c46eba8004 ✏️ Fix typo in docs/en/docs/alternatives.md (#10931)
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
2024-01-11 09:33:57 -05:00
github-actions
5b1e6865c5 📝 Update release notes 2024-01-11 14:33:27 +00:00
Nils Lindemann
69cb005f61 📝 Replace email with username in docs_src/security/tutorial007 code examples (#10649) 2024-01-11 09:33:05 -05:00
github-actions
0da980cb0b 📝 Update release notes 2024-01-10 21:00:51 +00:00
Nils Lindemann
135dcba746 📝 Add VS Code tutorial link (#10592)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-11 01:00:32 +04:00
github-actions
21145d8e9f 📝 Update release notes 2024-01-10 20:56:59 +00:00
Aliaksei Urbanski
07f8d31ec9 Add support for Python 3.12 (#10666)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-10 15:55:45 -05:00
github-actions
91d7fb6d25 📝 Update release notes 2024-01-10 19:14:15 +00:00
Sebastián Ramírez
b584faffee 📝 Add notes about Pydantic v2's new .model_dump() (#10929) 2024-01-10 19:13:55 +00:00
github-actions
1334485435 📝 Update release notes 2024-01-10 18:15:28 +00:00
Sungyun Hur
843bc85155 📝 Fix broken link in docs/en/docs/tutorial/sql-databases.md (#10765)
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
2024-01-10 13:15:04 -05:00
github-actions
1cd23a1dbc 📝 Update release notes 2024-01-10 17:43:56 +00:00
Fahad Md Kamal
06bf7781df 🌐 Add Bengali translation for docs/bn/docs/index.md (#9177)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-10 18:43:35 +01:00
github-actions
7e0cdf2510 📝 Update release notes 2024-01-10 17:19:42 +00:00
Sebastián Ramírez
84cd488df1 📝 Add External Link: FastAPI application monitoring made easy (#10917)
Co-authored-by: Simon Gurcke <simon@gurcke.de>
2024-01-10 21:19:21 +04:00
github-actions
958425a899 📝 Update release notes 2024-01-09 20:37:29 +00:00
Craig Blaszczyk
7eeacc9958 Generate automatic language names for docs translations (#5354)
Co-authored-by: Craig Blaszczyk <craig@boughtbymany.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-09 20:37:09 +00:00
github-actions
3b9a2bcb1b 📝 Update release notes 2024-01-09 18:35:49 +00:00
github-actions
f73be1d599 📝 Update release notes 2024-01-09 18:33:22 +00:00
github-actions
dd6cf5d710 📝 Update release notes 2024-01-09 18:32:18 +00:00
github-actions
aa6586d51a 📝 Update release notes 2024-01-09 18:24:21 +00:00
s111d
f43fc82267 ✏️ Fix typos in docs/en/docs/alternatives.md and docs/en/docs/tutorial/dependencies/index.md (#10906)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-09 22:22:46 +04:00
Sebastián Ramírez
0108b002f3 👥 Update FastAPI People (#10871)
Co-authored-by: github-actions <github-actions@github.com>
2024-01-09 13:20:37 -05:00
Dmitry Volodin
f226040d28 ✏️ Fix typos in docs/en/docs/tutorial/dependencies/dependencies-with-yield.md (#10834)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-09 22:19:59 +04:00
github-actions
cbd53f3bc8 📝 Update release notes 2024-01-09 18:15:02 +00:00
Takuma Yamamoto
e628e1928e ✏️ Update Python version in index.md in several languages (#10711)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-09 18:13:02 +00:00
github-actions
809b21c849 📝 Update release notes 2024-01-09 18:12:12 +00:00
John Philip
7dd944deda 📝 Add article: "Building a RESTful API with FastAPI: Secure Signup and Login Functionality Included" (#9733)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-09 21:49:58 +04:00
Andrew Chang-DeWitt
6f43539d87 📝 Add warning about lifecycle events with AsyncClient (#4167)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2024-01-09 21:45:52 +04:00
github-actions
d62b3ea69c 📝 Update release notes 2024-01-09 17:32:21 +00:00
github-actions
d2c7ffb447 📝 Update release notes 2024-01-09 17:31:25 +00:00
Aleksandr Andrukhov
33e57e6f02 🌐 Add Russian translation for docs/ru/docs/tutorial/request-forms-and-files.md (#10347)
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
2024-01-09 21:06:10 +04:00
Rostyslav
e986894344 🌐 Add Ukrainian translation for docs/uk/docs/index.md (#10362)
Co-authored-by: Alejandra <90076947+alejsdev@users.noreply.github.com>
2024-01-09 21:04:42 +04:00
github-actions
43489beb98 📝 Update release notes 2024-01-09 17:00:36 +00:00
github-actions
5e5cabefe1 📝 Update release notes 2024-01-09 16:51:05 +00:00
github-actions
6c15776406 📝 Update release notes 2024-01-09 16:50:06 +00:00
github-actions
c2dc0252b0 📝 Update release notes 2024-01-09 16:38:21 +00:00
github-actions
04dbcf416c 📝 Update release notes 2024-01-09 16:31:04 +00:00
Clarence
ed3e79be77 ✏️ Fix typos in /docs/reference/exceptions.md and /en/docs/reference/status.md (#10809) 2024-01-09 17:30:58 +01:00
Sumin Kim
6efd537204 ✏️ Update Python version in docs/ko/docs/index.md (#10680) 2024-01-09 17:23:09 +01:00
Kay Jan
aa53a48fe3 ✏️ Fix typo in openapi-callbacks.md (#10673) 2024-01-09 17:21:54 +01:00
Amir Khorasani
7d8241acb9 🌐 Add Persian translation for docs/fa/docs/features.md (#5887)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Amin Alaee <mohammadamin.alaee@gmail.com>
2024-01-09 20:14:01 +04:00
Sepehr Shirkhanlu
60e1259ca4 ✏️ Fix typo in fastapi/routing.py (#10520)
Fix: https://github.com/tiangolo/fastapi/discussions/10493
2024-01-09 17:10:37 +01:00
github-actions
cee422f073 📝 Update release notes 2024-01-09 16:09:04 +00:00
github-actions
9ddc71e317 📝 Update release notes 2024-01-09 16:08:31 +00:00
github-actions
d305a67a81 📝 Update release notes 2024-01-09 16:07:49 +00:00
github-actions
8f70f8c43b 📝 Update release notes 2024-01-09 16:03:03 +00:00
github-actions
11a5993c8c 📝 Update release notes 2024-01-09 16:01:13 +00:00
_Shuibei
9f7902925a 🌐 Add Chinese translation for docs/zh/docs/advanced/additional-responses.md (#10325)
Co-authored-by: unknown <lemonc2021@foxmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-09 16:53:39 +01:00
Aleksandr Andrukhov
a64b2fed91 🌐 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 (#10311) 2024-01-09 16:52:07 +01:00
Aleksandr Andrukhov
933668b42e 🌐 Add Russian translation for docs/ru/docs/tutorial/request-files.md (#10332)
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
Co-authored-by: oubush <oubush@users.noreply.github.com>
2024-01-09 10:51:54 -05:00
github-actions
c5bbcb8c9c 📝 Update release notes 2024-01-09 15:49:16 +00:00
github-actions
f27e818edb 📝 Update release notes 2024-01-09 15:47:49 +00:00
github-actions
fe620a6c12 📝 Update release notes 2024-01-09 15:46:50 +00:00
xzmeng
179c8a0763 🌐 Add Chinese translation for docs/zh/docs/deployment/server-workers.md (#10292)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Big Yellow Dog <dognasus@outlook.com>
2024-01-09 16:46:41 +01:00
xzmeng
4023510e4c 🌐 Add Chinese translation for docs/zh/docs/deployment/cloud.md (#10291)
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>
2024-01-09 16:44:17 +01:00
github-actions
d29709fee8 📝 Update release notes 2024-01-09 15:43:37 +00:00
github-actions
623ee4460b 📝 Update release notes 2024-01-09 15:41:08 +00:00
xzmeng
da9bd0ee4c 🌐 Add Chinese translation for docs/zh/docs/deployment/manually.md (#10279)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Big Yellow Dog <dognasus@outlook.com>
2024-01-09 16:39:41 +01:00
xzmeng
5eab5dbed6 🌐 Add Chinese translation for docs/zh/docs/deployment/https.md (#10277)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Big Yellow Dog <dognasus@outlook.com>
Co-authored-by: Lion <121552599+socket-socket@users.noreply.github.com>
2024-01-09 16:38:25 +01:00
xzmeng
152171e455 🌐 Add Chinese translation for docs/zh/docs/deployment/index.md (#10275)
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>
2024-01-09 16:37:29 +01:00
github-actions
271b4f3144 📝 Update release notes 2024-01-09 15:37:13 +00:00
fhabers21
031000fc6e 🌐 Add German translation for docs/de/docs/tutorial/first-steps.md (#9530)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Georg Wicke-Arndt <g.wicke-arndt@outlook.com>
2024-01-09 16:36:32 +01:00
github-actions
c471c93113 📝 Update release notes 2024-01-09 15:36:04 +00:00
Hasan Sezer Taşan
1021152f0a 🌐 Update Turkish translation for docs/tr/docs/index.md (#10444) 2024-01-09 10:35:44 -05:00
github-actions
b4ad143e37 📝 Update release notes 2024-01-09 15:33:53 +00:00
KAZAMA-DREAM
cb53749798 🌐 Add Chinese translation for docs/zh/docs/learn/index.md (#10479)
Co-authored-by: KAZAMA <wyy1778789301@163.com>
2024-01-09 10:33:25 -05:00
github-actions
01b106c290 📝 Update release notes 2024-01-09 15:31:54 +00:00
Aleksandr Andrukhov
3256c3ff07 🌐 Add Russian translation for docs/ru/docs/learn/index.md (#10539)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-09 10:31:45 -05:00
github-actions
d6b4c6c65c 📝 Update release notes 2024-01-09 15:31:14 +00:00
Royc30ne
0f4b6294bf 🌐 Update SQLAlchemy instruction in Chinese translation docs/zh/docs/tutorial/sql-databases.md (#9712)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-09 16:29:37 +01:00
github-actions
0a3dc7d107 📝 Update release notes 2024-01-09 15:28:54 +00:00
Hasan Sezer Taşan
23ad827597 🌐 Add Turkish translation for docs/tr/docs/external-links.md (#10549) 2024-01-09 10:28:47 -05:00
pablocm83
4fa251beb5 🌐 Add Spanish translation for docs/es/docs/learn/index.md (#10885)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-09 19:26:26 +04:00
ArtemKhymenko
3af6766e26 🌐 Add Ukrainian translation for docs/uk/docs/tutorial/body-fields.md (#10670)
Co-authored-by: Maksym Zavalniuk <mezgoodle@gmail.com>
Co-authored-by: Rostyslav <rostik1410@users.noreply.github.com>
2024-01-09 10:25:48 -05:00
github-actions
ce9aba258e 📝 Update release notes 2024-01-09 15:22:55 +00:00
github-actions
f9cbaa5f39 📝 Update release notes 2024-01-09 15:18:47 +00:00
David Takacs
eecc7a8113 🌐 Add Hungarian translation for /docs/hu/docs/index.md (#10812)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Peter Panko <prike18@gmail.com>
2024-01-09 16:16:04 +01:00
Hasan Sezer Taşan
2090e9a3e2 🌐 Add Turkish translation for docs/tr/docs/newsletter.md (#10550) 2024-01-09 16:14:23 +01:00
github-actions
5b63406aa5 📝 Update release notes 2024-01-09 15:12:19 +00:00
github-actions
ca10d3927b 📝 Update release notes 2024-01-09 15:11:39 +00:00
github-actions
631601787b 📝 Update release notes 2024-01-09 15:11:10 +00:00
pablocm83
d129910323 🌐 Add Spanish translation for docs/es/docs/help/index.md (#10907) 2024-01-09 16:09:47 +01:00
pablocm83
e10bdb82cc 🌐 Add Spanish translation for docs/es/docs/about/index.md (#10908)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-09 16:09:12 +01:00
pablocm83
7111d69f28 🌐 Add Spanish translation for docs/es/docs/resources/index.md (#10909) 2024-01-09 16:08:24 +01:00
github-actions
635d1a2d6d 📝 Update release notes 2024-01-09 15:04:35 +00:00
Sebastián Ramírez
423cdd24cc 👷 Upgrade custom GitHub Action comment-docs-preview-in-pr (#10916) 2024-01-09 19:02:53 +04:00
github-actions
7fbb7963d3 📝 Update release notes 2024-01-09 14:57:58 +00:00
Sebastián Ramírez
78ff6e3efd ⬆️ Upgrade GitHub Action latest-changes (#10915) 2024-01-09 18:57:33 +04:00
github-actions
fe694766ae 📝 Update release notes 2024-01-09 14:45:35 +00:00
Tristan Marion
a1ea708044 📝 Replace HTTP code returned in case of existing user error in docs for testing (#4482)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-09 18:44:08 +04:00
github-actions
897cde9fe2 📝 Update release notes 2024-01-09 14:37:53 +00:00
github-actions
ed628ddb92 📝 Update release notes 2024-01-09 14:37:20 +00:00
Moustapha Sall
4491ea6882 📝 Update example source files for SQL databases with SQLAlchemy (#9508)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2024-01-09 15:35:33 +01:00
Keshav Malik
57d4d93841 📝 Add blog for FastAPI & Supabase (#6018)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2024-01-09 18:32:46 +04:00
github-actions
136fe2b70f 📝 Update release notes 2024-01-09 14:30:16 +00:00
Andrey Otto
e9ffa20c8e 📝 Update code examples in docs for body, replace name create_item with update_item when appropriate (#5913) 2024-01-09 18:28:58 +04:00
github-actions
d5498274f9 📝 Update release notes 2024-01-09 14:21:30 +00:00
Sebastián Ramírez
3c7685273f 👷 Upgrade GitHub Action label-approved (#10913) 2024-01-09 18:21:10 +04:00
github-actions
04016d3bf9 📝 Update release notes 2024-01-08 18:50:12 +00:00
Sebastián Ramírez
1780c21e7a ⬆️ Upgrade GitHub Action label-approved (#10905) 2024-01-08 22:49:53 +04:00
Sebastián Ramírez
040ad986d4 ✏️ Fix typo in release notes 2023-12-26 21:47:18 +01:00
github-actions
84d400b916 📝 Update release notes 2023-12-26 20:37:55 +00:00
Sebastián Ramírez
dd790c34ff ✏️ Fix typo in dependencies with yield source examples (#10847) 2023-12-26 21:37:34 +01:00
Sebastián Ramírez
fe0249a23e 🔖 Release version 0.108.0 2023-12-26 21:17:18 +01:00
github-actions
43e2223804 📝 Update release notes 2023-12-26 20:12:59 +00:00
Sebastián Ramírez
c55f90df32 ⬆️ Upgrade Starlette to >=0.29.0,<0.33.0, update docs and usage of templates with new Starlette arguments (#10846)
* 📝 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
2023-12-26 21:12:34 +01:00
Sebastián Ramírez
f933fd6ff8 🔖 Release version 0.107.0 2023-12-26 20:04:08 +01:00
github-actions
9090bf4084 📝 Update release notes 2023-12-26 19:03:31 +00:00
Adrian Garcia Badaracco
d633953f13 ⬆️ Upgrade Starlette to 0.28.0 (#9636)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-12-26 20:03:07 +01:00
github-actions
a751032c09 📝 Update release notes 2023-12-26 17:23:45 +00:00
Alejandra
505ae06c0b 📝 Add docs: Node.js script alternative to update OpenAPI for generated clients (#10845) 2023-12-26 18:23:20 +01:00
github-actions
4de60e153a 📝 Update release notes 2023-12-26 17:14:13 +00:00
Alejandra
8b5843ebcd 📝 Restructure Docs section in Contributing page (#10844)
📝 Restructure Docs section in Contributing page
2023-12-26 18:13:50 +01:00
Sebastián Ramírez
5826c4f31f 📝 Tweak release notes 2023-12-25 19:06:04 +01:00
Sebastián Ramírez
91510db620 🔖 Release version 0.106.0 2023-12-25 19:01:26 +01:00
Sebastián Ramírez
bcd5a424cd 📝 Update release notes 2023-12-25 19:00:47 +01:00
github-actions
678bed2fc9 📝 Update release notes 2023-12-25 17:57:54 +00:00
Sebastián Ramírez
a4aa79e0b4 Add support for raising exceptions (including HTTPException) in dependencies with yield in the exit code, do not support them in background tasks (#10831)
* ♻️ 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
2023-12-25 18:57:35 +01:00
github-actions
e7756ae7dc 📝 Update release notes 2023-12-20 17:06:01 +00:00
Sebastián Ramírez
dc2fdd56af 👥 Update FastAPI People (#10567)
Co-authored-by: github-actions <github-actions@github.com>
2023-12-20 18:05:37 +01:00
Sebastián Ramírez
36c2667768 📝 Update release notes 2023-12-12 00:34:36 +00:00
Sebastián Ramírez
d8185efb6e 🔖 Release version 0.105.0 2023-12-12 00:32:48 +00:00
github-actions
fc51d7e3c7 📝 Update release notes 2023-12-12 00:29:29 +00:00
Sebastián Ramírez
b98c65cb36 🔥 Remove unused NoneType (#10774) 2023-12-12 00:29:03 +00:00
github-actions
ba99214417 📝 Update release notes 2023-12-12 00:23:15 +00:00
Sebastián Ramírez
6f5aa81c07 Add support for multiple Annotated annotations, e.g. Annotated[str, Field(), Query()] (#10773) 2023-12-12 00:22:47 +00:00
github-actions
73dcc40f09 📝 Update release notes 2023-12-06 11:34:10 +00:00
Sebastián Ramírez
33493ce694 🔧 Update sponsors, add PropelAuth (#10760) 2023-12-06 12:33:48 +01:00
github-actions
01e570c56d 📝 Update release notes 2023-12-04 11:11:17 +00:00
Sebastián Ramírez
ca03379b65 👷 Update build docs, verify README on CI (#10750) 2023-12-04 12:10:54 +01:00
github-actions
8cf2fa0fe4 📝 Update release notes 2023-11-30 20:48:22 +00:00
Sebastián Ramírez
99a2ec981b 📝 Tweak default suggested configs for generating clients (#10736) 2023-11-30 21:48:01 +01:00
github-actions
6fb951bae2 📝 Update release notes 2023-11-28 12:10:38 +00:00
Sebastián Ramírez
13cef7a21a 🔧 Update sponsors, remove Fern (#10729) 2023-11-28 13:10:12 +01:00
github-actions
e9ce31e96b 📝 Update release notes 2023-11-28 10:52:59 +00:00
Sebastián Ramírez
1560879a84 🔧 Update sponsors, add Scalar (#10728) 2023-11-28 10:52:35 +00:00
github-actions
ac93277d3b 📝 Update release notes 2023-11-18 13:47:35 +00:00
Sebastián Ramírez
71d51a9953 🔧 Update sponsors, add Codacy (#10677) 2023-11-18 14:47:04 +01:00
github-actions
81bab77617 📝 Update release notes 2023-11-18 13:38:23 +00:00
Sebastián Ramírez
781984b226 🔧 Update sponsors, add Reflex (#10676) 2023-11-18 14:38:01 +01:00
github-actions
480620372a 📝 Update release notes 2023-11-04 02:03:01 +00:00
Sebastián Ramírez
b04d07c933 📝 Update release notes, move and check latest-changes (#10588) 2023-11-04 06:02:18 +04:00
github-actions
46335068d2 📝 Update release notes 2023-11-04 01:53:13 +00:00
Sebastián Ramírez
4f89886b00 👷 Upgrade latest-changes GitHub Action (#10587) 2023-11-04 05:52:42 +04:00
Sebastián Ramírez
1c25e2d8dc 📝 Update release notes 2023-10-30 15:12:57 +04:00
Sebastián Ramírez
7e5afe2cb9 🔖 Release version 0.104.1 2023-10-30 14:04:54 +04:00
Sebastián Ramírez
6c53ddd084 📝 Update release notes 2023-10-30 14:04:14 +04:00
github-actions
0f1ddf5f69 📝 Update release notes 2023-10-30 09:59:37 +00:00
Alejandra Klachquin
758a8f29e1 📌 Pin Swagger UI version to 5.9.0 temporarily to handle a bug crashing it in 5.9.1 (#10529)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-10-30 13:58:58 +04:00
github-actions
e4b21c6eab 📝 Update release notes 2023-10-30 08:08:48 +00:00
Koke
759378d67f ✏️ Update Pydantic links to dotenv support (#10511) 2023-10-30 12:00:16 +04:00
github-actions
e7204ac7bf 📝 Update release notes 2023-10-30 07:52:04 +00:00
github-actions
7702c5af36 📝 Update release notes 2023-10-30 07:51:12 +00:00
github-actions
0066578bbe 📝 Update release notes 2023-10-30 07:42:04 +00:00
Hasnat Sajid
6b903ff1fb ✏️ Update links in docs/en/docs/async.md and docs/zh/docs/async.md to make them relative (#10498) 2023-10-30 11:07:15 +04:00
Hasnat Sajid
cbc8f18664 ✏️ Fix links in docs/em/docs/async.md (#10507) 2023-10-30 11:05:01 +04:00
Dmitry
fbe6ba6df1 ✏️ Fix typo in docs/em/docs/index.md, Python 3.8 (#10521)
typo in index page

7️⃣ ->  8️⃣
2023-10-30 11:01:00 +04:00
github-actions
b84f9f6ecb 📝 Update release notes 2023-10-29 09:49:57 +00:00
dependabot[bot]
0b83491843 ⬆ Bump pillow from 9.5.0 to 10.1.0 (#10446)
Bumps [pillow](https://github.com/python-pillow/Pillow) from 9.5.0 to 10.1.0.
- [Release notes](https://github.com/python-pillow/Pillow/releases)
- [Changelog](https://github.com/python-pillow/Pillow/blob/main/CHANGES.rst)
- [Commits](https://github.com/python-pillow/Pillow/compare/9.5.0...10.1.0)

---
updated-dependencies:
- dependency-name: pillow
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-29 13:49:21 +04:00
github-actions
38db1fe074 📝 Update release notes 2023-10-29 09:33:47 +00:00
github-actions
378e590757 📝 Update release notes 2023-10-29 09:33:30 +00:00
dependabot[bot]
290191421b ⬆ Update mkdocs-material requirement from <9.0.0,>=8.1.4 to >=8.1.4,<10.0.0 (#5862)
⬆ Update mkdocs-material requirement

Updates the requirements on [mkdocs-material](https://github.com/squidfunk/mkdocs-material) to permit the latest version.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/8.1.4...9.0.3)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-29 09:33:11 +00:00
dependabot[bot]
e0c5beb5c8 ⬆ Bump mkdocs-material from 9.1.21 to 9.4.7 (#10545)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.21 to 9.4.7.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.21...9.4.7)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-29 13:32:50 +04:00
github-actions
072c701b0e 📝 Update release notes 2023-10-29 09:12:56 +00:00
Sebastián Ramírez
e45cbb7e5e 👷 Install MkDocs Material Insiders only when secrets are available, for Dependabot (#10544) 2023-10-29 13:12:11 +04:00
github-actions
2754d4e0fe 📝 Update release notes 2023-10-25 08:25:52 +00:00
Sebastián Ramírez
f7e338dcd8 🔧 Update sponsors badges, Databento (#10519) 2023-10-25 12:25:03 +04:00
github-actions
223970e03c 📝 Update release notes 2023-10-24 20:26:43 +00:00
Sebastián Ramírez
2e14c69c31 👷 Adopt Ruff format (#10517)
* 🔧 Update pre-commit, use ruff format

* ⬆️ Upgrade dependencies, use Ruff for formatting

* 🔧 Update Ruff config

* 🔨 Update lint and format scripts, use Ruff

* 🎨 Format internals with Ruff

* 🎨 Format docs scripts

* 🎨 Format tests

* 🎨 Format extra commas in src for docs

* 📝 Update docs mentioning `@lru_cache()`, use `@lru_cache` instead to keep consistency with the format

* 🎨 Update src for docs, use plain `@lru_cache`

* 🎨 Update src for docs format and docs references
2023-10-25 00:26:06 +04:00
github-actions
4ef7a40eae 📝 Update release notes 2023-10-22 10:04:16 +00:00
Sebastián Ramírez
e0a5edaaa3 🔧 Add CITATION.cff file for academic citations (#10496) 2023-10-22 14:03:38 +04:00
github-actions
f9b53ae778 📝 Update release notes 2023-10-22 07:35:50 +00:00
Sebastián Ramírez
e8bd645fa9 📝 Update data structure and render for external-links (#10495)
* 📝 Update data structure and render for external-links

* 📝 Update translations for external links
2023-10-22 11:35:13 +04:00
github-actions
808e3bb9d5 📝 Update release notes 2023-10-21 07:11:00 +00:00
Sebastián Ramírez
9bfbacfe98 🐛 Fix overriding MKDocs theme lang in hook (#10490) 2023-10-21 11:10:18 +04:00
github-actions
ab65486e75 📝 Update release notes 2023-10-20 09:21:13 +00:00
worldworm
9b3e166b43 ✏️ Fix link to SPDX license identifier in docs/en/docs/tutorial/metadata.md (#10433)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-10-20 13:19:31 +04:00
github-actions
07a9b240e9 📝 Update release notes 2023-10-20 09:13:35 +00:00
Giulio Davide Carparelli
89e03bad16 📝 Update example validation error from Pydantic v1 to match Pydantic v2 in docs/en/docs/tutorial/path-params.md (#10043) 2023-10-20 13:08:42 +04:00
github-actions
f41eb5e005 📝 Update release notes 2023-10-20 09:03:34 +00:00
github-actions
eb017270fc 📝 Update release notes 2023-10-20 09:00:53 +00:00
Heinz-Alexander Fuetterer
ae84ff6e44 ✏️ Fix typos in emoji docs and in some source examples (#10438) 2023-10-20 13:00:44 +04:00
github-actions
f785a6ce90 📝 Update release notes 2023-10-20 09:00:11 +00:00
Surav Shrestha
6dac39dbca ✏️ Fix typo in docs/en/docs/reference/dependencies.md (#10465) 2023-10-20 12:58:51 +04:00
yogabonito
4bd1430677 ✏️ Fix typos and rewordings in docs/en/docs/tutorial/body-nested-models.md (#10468) 2023-10-20 12:58:03 +04:00
github-actions
cda5e770ab 📝 Update release notes 2023-10-20 08:56:08 +00:00
yogabonito
57a030175e 📝 Update docs, remove references to removed pydantic.Required in docs/en/docs/tutorial/query-params-str-validations.md (#10469) 2023-10-20 12:55:30 +04:00
github-actions
968afca058 📝 Update release notes 2023-10-20 08:53:37 +00:00
Tiago Silva
6eb30959bc ✏️ Fix typo in docs/en/docs/reference/index.md (#10467)
Fix small typo in reference/index.md
2023-10-20 12:52:59 +04:00
github-actions
dcbe7f7ac0 📝 Update release notes 2023-10-20 08:39:45 +00:00
Sebastián Ramírez
dc7838eec3 🔥 Drop/close Gitter chat. Questions should go to GitHub Discussions, free conversations to Discord. (#10485) 2023-10-20 12:39:03 +04:00
github-actions
7670a132b3 📝 Update release notes 2023-10-20 08:28:05 +00:00
Sebastián Ramírez
c13aa9ed5f 🔥 Remove unnecessary duplicated docstrings (#10484) 2023-10-20 12:27:26 +04:00
Sebastián Ramírez
38f191dcd3 🔖 Release version 0.104.0 2023-10-18 16:51:07 +04:00
Sebastián Ramírez
76e547f254 📝 Update release notes 2023-10-18 16:50:22 +04:00
github-actions
f056d001e5 📝 Update release notes 2023-10-18 12:37:29 +00:00
Sebastián Ramírez
05ca41cfd1 Add reference (code API) docs with PEP 727, add subclass with custom docstrings for BackgroundTasks, refactor docs structure (#10392)
*  Add mkdocstrings and griffe-typingdoc to dependencies

* 🔧 Add mkdocstrings configs to MkDocs

* 📝 Add first WIP reference page

* ⬆️ Upgrade typing-extensions to the minimum version including Doc()

* 📝 Add docs to FastAPI parameters

* 📝 Add docstrings for OpenAPI docs utils

* 📝 Add docstrings for security utils

* 📝 Add docstrings for UploadFile

* 📝 Update docstrings in FastAPI class

* 📝 Add docstrings for path operation methods

* 📝 Add docstring for jsonable_encoder

* 📝 Add docstrings for exceptions

* 📝 Add docstsrings for parameter functions

* 📝 Add docstrings for responses

* 📝 Add docstrings for APIRouter

* ♻️ Sub-class BackgroundTasks to document it with docstrings

* 📝 Update usage of background tasks in dependencies

*  Update tests with new deprecation warnings

* 📝 Add new reference docs

* 🔧 Update MkDocs with new reference docs

*  Update pytest fixture, deprecation is raised only once

* 🎨 Update format for types in exceptions.py

* ♻️ Update annotations in BackgroundTask, `Annotated` can't take ParamSpec's P.args or P.kwargs

* ✏️ Fix typos caught by @pawamoy

* 🔧 Update and fix MkDocstrings configs from @pawamoy tips

* 📝 Update reference docs

* ✏️ Fix typos found by @pawamoy

*  Add HTTPX as a dependency for docs, for the TestClient

* 🔧 Update MkDocs config, rename websockets reference

* 🔇 Add type-ignores for Doc as the stubs haven't been released for mypy

* 🔥 Remove duplicated deprecated notice

* 🔇 Remove typing error for unreleased stub in openapi/docs.py

*  Add tests for UploadFile for coverage

* ⬆️ Upgrade griffe-typingdoc==0.2.2

* 📝 Refactor docs structure

* 🔨 Update README generation with new index frontmatter and style

* 🔨 Update generation of languages, remove from top menu, keep in lang menu

* 📝 Add OpenAPI Pydantic models

* 🔨 Update docs script to not translate Reference and Release Notes

* 🔧 Add reference for OpenAPI models

* 🔧 Update MkDocs config for mkdocstrings insiders

* 👷 Install mkdocstring insiders in CI for docs

* 🐛 Fix MkDocstrings insiders install URL

*  Move dependencies shared by docs and tests to its own requirements file

* 👷 Update cache keys for test and docs dependencies

* 📝 Remove no longer needed __init__ placeholder docstrings

* 📝 Move docstring for APIRouter to the class level (not __init__ level)

* 🔥 Remove no longer needed dummy placeholder __init__ docstring
2023-10-18 16:36:40 +04:00
github-actions
3fa44aabe3 📝 Update release notes 2023-10-17 07:20:59 +00:00
github-actions
912e4bb906 📝 Update release notes 2023-10-17 07:20:20 +00:00
dependabot[bot]
89e7417652 ⬆ Bump dawidd6/action-download-artifact from 2.27.0 to 2.28.0 (#10268)
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 2.27.0 to 2.28.0.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v2.27.0...v2.28.0)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 11:20:09 +04:00
dependabot[bot]
d03373f3e8 ⬆ Bump actions/checkout from 3 to 4 (#10208)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 11:19:41 +04:00
github-actions
e5fd92a7ab 📝 Update release notes 2023-10-17 07:19:26 +00:00
dependabot[bot]
6b0c77e554 ⬆ Bump pypa/gh-action-pypi-publish from 1.8.6 to 1.8.10 (#10061)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.6 to 1.8.10.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.8.6...v1.8.10)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-17 11:18:40 +04:00
github-actions
4ef8c3286d 📝 Update release notes 2023-10-17 05:59:55 +00:00
Sebastián Ramírez
2ba7586ff3 ⬆️ Drop support for Python 3.7, require Python 3.8 or above (#10442)
* 📝 Update docs, require Python 3.8+, drop 3.7

* 🔧 Update pyproject.toml, drop support for Python 3.7, require Python 3.8+

* 👷 Update CI GitHub Actions, drop support for Python 3.7, require 3.8+

* 📝 Update docs' references to Python 3.6 and 3.7, use Python 3.8
2023-10-17 09:59:11 +04:00
github-actions
c1adce4fe9 📝 Update release notes 2023-10-04 22:52:00 +00:00
Sebastián Ramírez
89789c80ae 🔧 Update sponsors, Bump.sh images (#10381) 2023-10-04 22:51:10 +00:00
github-actions
cb4f0e57ce 📝 Update release notes 2023-10-02 23:12:28 +00:00
Sebastián Ramírez
568b35f3df 👥 Update FastAPI People (#10363)
Co-authored-by: github-actions <github-actions@github.com>
2023-10-02 18:11:52 -05:00
Sebastián Ramírez
1bf5e7a10e 🔖 Release 0.103.2 2023-09-28 14:57:42 -05:00
Sebastián Ramírez
fcda32d231 📝 Update release notes 2023-09-28 14:56:50 -05:00
Sebastián Ramírez
d0b17dd49c ⬆️ Upgrade Python version in Docker images for GitHub Actions (#10350) 2023-09-28 14:51:39 -05:00
github-actions
d769da3c38 📝 Update release notes 2023-09-28 19:42:38 +00:00
Sebastián Ramírez
2f50ae8825 🔧 Update sponsors, remove Flint (#10349) 2023-09-28 14:41:17 -05:00
github-actions
831b5d5402 📝 Update release notes 2023-09-28 04:15:17 +00:00
Sebastián Ramírez
bc935e08b6 ⬆️ Upgrade compatibility with Pydantic v2.4, new renamed functions and JSON Schema input/output models with default values (#10344)
* 🚚 Refactor deprecated import general_plain_validator_function to with_info_plain_validator_function

* 🚚 Rename deprecated FieldValidationInfo to ValidationInfo

*  Update tests with new defaults for JSON Schema for default values

* ♻️ Add Pydantic v1 version of with_info_plain_validator_function

* 👷 Invalidate cache

*  Fix tests for Pydantic v1

*  Tweak tests coverage for older Pydantic v2 versions
2023-09-27 23:14:40 -05:00
github-actions
b944b55dfc 📝 Update release notes 2023-09-27 23:02:35 +00:00
Sebastián Ramírez
74cf05117b 🔧 Rename label "awaiting review" to "awaiting-review" to simplify search queries (#10343) 2023-09-27 18:01:46 -05:00
github-actions
1c4a9e91b6 📝 Update release notes 2023-09-27 20:55:18 +00:00
ArtemKhymenko
b2f8ac6a83 🌐 Add Ukrainian translation for docs/uk/docs/tutorial/extra-data-types.md (#10132)
Co-authored-by: ArtemKhymenko <ak@workconsult.ua>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Rostyslav <rostik1410@users.noreply.github.com>
2023-09-27 15:53:36 -05:00
github-actions
99ffbcdee0 📝 Update release notes 2023-09-27 20:53:18 +00:00
Samuel Rigaud
69f82e5222 🌐 Fix typos in French translations for docs/fr/docs/advanced/path-operation-advanced-configuration.md, docs/fr/docs/alternatives.md, docs/fr/docs/async.md, docs/fr/docs/features.md, docs/fr/docs/help-fastapi.md, docs/fr/docs/index.md, docs/fr/docs/python-types.md, docs/fr/docs/tutorial/body.md, docs/fr/docs/tutorial/first-steps.md, docs/fr/docs/tutorial/query-params.md (#10154)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-09-27 15:52:31 -05:00
github-actions
27870e20f5 📝 Update release notes 2023-09-27 20:48:01 +00:00
mkdir700
1453cea404 🌐 Add Chinese translation for docs/zh/docs/async.md (#5591)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Jedore <jedore_fight@189.cn>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: 吴定焕 <108172295+wdh99@users.noreply.github.com>
2023-09-27 15:47:21 -05:00
github-actions
073e7fc950 📝 Update release notes 2023-09-25 23:08:51 +00:00
jaystone776
0e2ca1cacb 🌐 Update Chinese translation for docs/tutorial/security/simple-oauth2.md (#3844)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-25 18:06:09 -05:00
github-actions
255e743f98 📝 Update release notes 2023-09-25 23:05:48 +00:00
Sion Shin
c89549c703 🌐 Add Korean translation for docs/ko/docs/deployment/cloud.md (#10191)
Co-authored-by: Joona Yoon <joonas-yoon@users.noreply.github.com>
2023-09-25 18:02:59 -05:00
github-actions
14e0914fcf 📝 Update release notes 2023-09-25 23:02:43 +00:00
Yusuke Tamura
3106a3a50e 🌐 Add Japanese translation for docs/ja/docs/deployment/https.md (#10298)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-25 18:01:57 -05:00
github-actions
c75cdc6d9a 📝 Update release notes 2023-09-25 23:00:56 +00:00
Aleksandr Andrukhov
cb410d3015 🌐 Fix typo in Russian translation for docs/ru/docs/tutorial/body-fields.md (#10224)
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-09-25 18:00:09 -05:00
github-actions
69a7c99b44 📝 Update release notes 2023-09-22 23:39:37 +00:00
Raman Bazhanau
89246313aa 🌐 Add Polish translation for docs/pl/docs/help-fastapi.md (#10121)
Co-authored-by: Igor Sulim <30448496+isulim@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Antek S. <antoni.szych@gmail.com>
2023-09-22 18:38:53 -05:00
github-actions
79399e43df 📝 Update release notes 2023-09-22 23:37:34 +00:00
Aleksandr Andrukhov
84794221d9 🌐 Add Russian translation for docs/ru/docs/tutorial/header-params.md (#10226)
Co-authored-by: Artem Golicyn <86262613+AGolicyn@users.noreply.github.com>
Co-authored-by: Nikita <omegastrikeclan@yandex.ru>
2023-09-22 18:36:59 -05:00
github-actions
f4bc0d8205 📝 Update release notes 2023-09-22 23:31:21 +00:00
xzmeng
2fcd8ce8ec 🌐 Add Chinese translation for docs/zh/docs/deployment/versions.md (#10276)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Big Yellow Dog <dognasus@outlook.com>
2023-09-22 18:30:46 -05:00
github-actions
46d1da08da 📝 Update release notes 2023-09-15 08:39:26 +00:00
Sebastián Ramírez
571c7a7aba 🔧 Update sponsors, enable Svix (revert #10228) (#10253)
* 🔧 Update sponsors, remove Svix (revert #10228)

This reverts commit e0a99e24b8.

* 🔧 Tweak and update sponsors data
2023-09-15 10:38:48 +02:00
github-actions
c6437d555d 📝 Update release notes 2023-09-10 10:37:04 +00:00
Sebastián Ramírez
e0a99e24b8 🔧 Update sponsors, remove Svix (#10228) 2023-09-10 12:36:28 +02:00
github-actions
a10c35673d 📝 Update release notes 2023-09-10 10:19:02 +00:00
Sebastián Ramírez
766dfb5b38 🔧 Update sponsors, add Bump.sh (#10227) 2023-09-10 12:18:26 +02:00
Sebastián Ramírez
bfde8f3ef2 🔖 Release version 0.103.1 2023-09-02 19:10:19 +02:00
Sebastián Ramírez
ce8ee1410a 📝 Update release notes 2023-09-02 19:09:47 +02:00
github-actions
118010ad5e 📝 Update release notes 2023-09-02 17:06:22 +00:00
github-actions
8562cae44b 📝 Update release notes 2023-09-02 17:05:59 +00:00
Sebastián Ramírez
e1a1a367a7 📌 Pin AnyIO to < 4.0.0 to handle an incompatibility while upgrading to Starlette 0.31.1 (#10194) 2023-09-02 19:03:43 +02:00
Pablo Dorrío Vázquez
c502197d7c ✏️ Fix validation parameter name in docs, from regex to pattern (#10085) 2023-09-02 19:02:26 +02:00
github-actions
7f1dedac2c 📝 Update release notes 2023-09-02 17:01:44 +00:00
Alex Rocha
23511f1fdf 🌐 Remove duplicate line in translation for docs/pt/docs/tutorial/path-params.md (#10126) 2023-09-02 19:01:06 +02:00
github-actions
7802454131 📝 Update release notes 2023-09-02 16:56:04 +00:00
Yusuke Tamura
caf0b688cd ✏️ Fix indent format in docs/en/docs/deployment/server-workers.md (#10066)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-02 18:55:26 +02:00
github-actions
a6d893fe98 📝 Update release notes 2023-09-02 16:16:38 +00:00
Olaoluwa Afolabi
1711c1e95f 🌐 Add Yoruba translation for docs/yo/docs/index.md (#10033)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-09-02 18:12:44 +02:00
github-actions
34028290f5 📝 Update release notes 2023-09-02 16:03:22 +00:00
github-actions
aa43afa4c0 📝 Update release notes 2023-09-02 16:00:21 +00:00
Rahul Salgare
0242ca7566 ✏️ Fix Pydantic examples in tutorial for Python types (#9961)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-09-02 17:56:35 +02:00
Hasnat Sajid
0ea23e2a8d ✏️ Fix link to Pydantic docs in docs/en/docs/tutorial/extra-data-types.md (#10155)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-09-02 17:55:41 +02:00
github-actions
7fe952f522 📝 Update release notes 2023-09-02 15:54:22 +00:00
github-actions
28bf4abf1f 📝 Update release notes 2023-09-02 15:50:11 +00:00
github-actions
1866abffc1 📝 Update release notes 2023-09-02 15:49:31 +00:00
Rostyslav
e6c4785959 🌐 Add Ukrainian translation for docs/uk/docs/python-types.md (#10080)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-09-02 17:48:03 +02:00
Nguyễn Khắc Thành
8979166bc3 🌐 Add Vietnamese translations for docs/vi/docs/tutorial/first-steps.md and docs/vi/docs/tutorial/index.md (#10088)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-09-02 17:44:17 +02:00
Poupapaa
2e32957198 ✏️ Fix typo in docs/en/docs/tutorial/handling-errors.md (#10170)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-09-02 17:43:16 +02:00
github-actions
b2562c5c73 📝 Update release notes 2023-09-02 15:41:53 +00:00
github-actions
a55f3204ef 📝 Update release notes 2023-09-02 15:37:56 +00:00
Ahsan Sheraz
9fc33f8565 ✏️ Fix typos in comment in fastapi/applications.py (#10045) 2023-09-02 17:37:40 +02:00
github-actions
59cbeccac0 📝 Update release notes 2023-09-02 15:36:34 +00:00
Ragul K
4e93f8e0bc ✏️ Fix typo in docs/en/docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md (#10172)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-09-02 17:32:48 +02:00
whysage
ad76dd1aa8 🌐 Add Ukrainian translation for docs/uk/docs/alternatives.md (#10060)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-09-02 17:32:30 +02:00
github-actions
48f6ccfe7d 📝 Update release notes 2023-09-02 15:31:37 +00:00
Rostyslav
1d688a062e 🌐 Add Ukrainian translation for docs/uk/docs/tutorial/index.md (#10079) 2023-09-02 17:29:36 +02:00
github-actions
8cb33e9b47 📝 Update release notes 2023-09-02 15:24:05 +00:00
xzmeng
d8f2f39f6d ✏️ Fix typos in docs/en/docs/how-to/separate-openapi-schemas.md and docs/en/docs/tutorial/schema-extra-example.md (#10189) 2023-09-02 17:22:24 +02:00
github-actions
82ff9a6920 📝 Update release notes 2023-09-02 15:19:08 +00:00
PieCat
bf952d345c 🌐 Add Chinese translation for docs/zh/docs/advanced/generate-clients.md (#9883)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: xzmeng <aumo@foxmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-09-02 17:18:30 +02:00
github-actions
ee0b28a398 📝 Update release notes 2023-09-01 23:33:31 +00:00
Sebastián Ramírez
4bfe83bd27 👥 Update FastAPI People (#10186)
Co-authored-by: github-actions <github-actions@github.com>
2023-09-02 01:32:40 +02:00
github-actions
7a63d11093 📝 Update release notes 2023-09-01 21:36:46 +00:00
Sebastián Ramírez
37d46e6b6c Add missing test for OpenAPI examples, it was missing in coverage (#10188)
 Add missing test for OpenAPI examples, it seems it was discovered in coverage by an upgrade in AnyIO
2023-09-01 23:36:08 +02:00
Sebastián Ramírez
a3f1689d78 📝 Update release notes 2023-08-26 20:14:42 +02:00
Sebastián Ramírez
415eb1405a 🔖 Release version 0.103.0 2023-08-26 20:10:27 +02:00
Sebastián Ramírez
bd32bca55c 📝 Update release notes 2023-08-26 20:09:59 +02:00
github-actions
df16699dd8 📝 Update release notes 2023-08-26 18:03:56 +00:00
Sebastián Ramírez
1b714b3177 Add support for openapi_examples in all FastAPI parameters (#10152)
* ♻️ Refactor model for OpenAPI Examples to use a reusable TypedDict

*  Add support for openapi_examples in parameters

* 📝 Add new docs examples for new parameter openapi_examples

* 📝 Update docs for Schema Extra to include OpenAPI examples

*  Add tests for new source examples, for openapi_examples

*  Add tests for openapi_examples corner cases and all parameters

* 💡 Tweak and ignore type annotation checks for custom TypedDict
2023-08-26 20:03:13 +02:00
github-actions
5f855b1179 📝 Update release notes 2023-08-26 13:20:54 +00:00
Sebastián Ramírez
594b1ae0c3 📝 Add note to docs about Separate Input and Output Schemas with FastAPI version (#10150) 2023-08-26 15:20:04 +02:00
Sebastián Ramírez
f3ab547c0c 📝 Update release notes 2023-08-25 21:23:44 +02:00
Sebastián Ramírez
9cf9e1084d 🔖 Release version 0.102.0 2023-08-25 21:18:38 +02:00
Sebastián Ramírez
859d40407c 📝 Update release notes 2023-08-25 21:18:09 +02:00
github-actions
098778e07f 📝 Update release notes 2023-08-25 19:11:02 +00:00
Sebastián Ramírez
ea43f227e5 Add support for disabling the separation of input and output JSON Schemas in OpenAPI with Pydantic v2 (#10145)
* 📝 Add docs for Separate OpenAPI Schemas for Input and Output

* 🔧 Add new docs page to MkDocs config

*  Add separate_input_output_schemas parameter to FastAPI class

* 📝 Add source examples for separating OpenAPI schemas

*  Add tests for separated OpenAPI schemas

* 📝 Add source examples for Python 3.10, 3.9, and 3.7+

* 📝 Update docs for Separate OpenAPI Schemas with new multi-version examples

*  Add and update tests for different Python versions

*  Add tests for corner cases with separate_input_output_schemas

* 📝 Update tutorial to use Union instead of Optional

* 🐛 Fix type annotations

* 🐛 Fix correct import in test

* 💄 Add CSS to simulate browser windows for screenshots

*  Add playwright as a dev dependency to automate generating screenshots

* 🔨 Add Playwright scripts to generate screenshots for new docs

* 📝 Update docs, tweak text to match screenshots

* 🍱 Add screenshots for new docs
2023-08-25 21:10:22 +02:00
github-actions
10a127ea4a 📝 Update release notes 2023-08-19 19:54:40 +00:00
Sebastián Ramírez
8cd7cfc2b6 📝 Add new docs section, How To - Recipes, move docs that don't have to be read by everyone to How To (#10114)
* 📝 Start How To docs section, move Peewee, remove Peewee from dependencies

* 🚚 Move em files to new locations

* 🚚 Move and re-structure advanced docs, move relevant to How To

* 🔧 Update MkDocs config, new files in How To

* 📝 Move docs for Conditional OpenAPI for Japanese to How To

* 📝 Move example source files for Extending OpenAPI into each of the new sections

*  Update tests with new locations for source files

* 🔥 Remove init from Peewee examples
2023-08-19 21:54:04 +02:00
github-actions
3971c44a38 📝 Update release notes 2023-08-19 18:48:35 +00:00
Sebastián Ramírez
7a06de2bb9 ♻️ Refactor tests for new Pydantic 2.2.1 (#10115) 2023-08-19 20:47:59 +02:00
github-actions
b406dd9174 📝 Update release notes 2023-08-19 14:09:02 +00:00
Sebastián Ramírez
8e38261787 📝 Update Advanced docs, add links to sponsor courses (#10113) 2023-08-19 16:08:16 +02:00
github-actions
486cd139a9 📝 Update release notes 2023-08-19 13:51:12 +00:00
Sebastián Ramírez
08feaf0cc4 📝 Update docs for generating clients (#10112) 2023-08-19 15:49:54 +02:00
github-actions
0fe434ca68 📝 Update release notes 2023-08-19 13:34:10 +00:00
Sebastián Ramírez
d1c0e5a89f 📝 Tweak MkDocs and add redirects (#10111) 2023-08-19 13:33:32 +00:00
github-actions
e04953a9e0 📝 Update release notes 2023-08-19 13:12:09 +00:00
Sebastián Ramírez
d4201a49bc 📝 Restructure docs for cloud providers, include links to sponsors (#10110) 2023-08-19 15:11:35 +02:00
github-actions
a6ae5af7d6 📝 Update release notes 2023-08-17 08:52:40 +00:00
Sebastián Ramírez
e93d15cf9a 🔧 Update sponsors, add Speakeasy (#10098) 2023-08-17 10:51:58 +02:00
Sebastián Ramírez
63e7edb295 🔖 Release version 0.101.1 2023-08-14 12:03:14 +02:00
Sebastián Ramírez
50b6ff7da6 📝 Update release notes 2023-08-14 12:02:43 +02:00
github-actions
d46cd0b1f0 📝 Update release notes 2023-08-14 09:50:40 +00:00
Sebastián Ramírez
5e8f7f13d7 Add ResponseValidationError printable details, to show up in server error logs (#10078) 2023-08-14 11:49:57 +02:00
github-actions
dafaf6a34c 📝 Update release notes 2023-08-14 09:17:05 +00:00
github-actions
87cc40e483 📝 Update release notes 2023-08-14 09:15:26 +00:00
Yusuke Tamura
25059a7717 🌐 Add Japanese translation for docs/ja/docs/deployment/concepts.md (#10062)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-14 11:14:37 +02:00
Yusuke Tamura
2a5cc5fff3 🌐 Add Japanese translation for docs/ja/docs/deployment/server-workers.md (#10064)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-14 11:13:28 +02:00
github-actions
014262c203 📝 Update release notes 2023-08-14 09:13:05 +00:00
Yusuke Tamura
9d6ce823c1 🌐 Update Japanese translation for docs/ja/docs/deployment/docker.md (#10073)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-14 11:12:14 +02:00
github-actions
48d203a1e7 📝 Update release notes 2023-08-14 09:10:51 +00:00
Rostyslav
47166ed56c 🌐 Add Ukrainian translation for docs/uk/docs/fastapi-people.md (#10059) 2023-08-14 11:10:06 +02:00
github-actions
78f38c6bfd 📝 Update release notes 2023-08-10 15:59:15 +00:00
Rostyslav
e6afc5911b 🌐 Add Ukrainian translation for docs/uk/docs/tutorial/cookie-params.md (#10032) 2023-08-10 17:58:13 +02:00
github-actions
5c2a155809 📝 Update release notes 2023-08-10 15:55:32 +00:00
Vladislav Kramorenko
fe3eaf63e6 🌐 Add Russian translation for docs/ru/docs/deployment/docker.md (#9971)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Yois4101 <119609381+Yois4101@users.noreply.github.com>
2023-08-10 17:53:26 +02:00
github-actions
1f0d9086b3 📝 Update release notes 2023-08-10 15:53:06 +00:00
Nguyễn Khắc Thành
f0ab797de4 🌐 Add Vietnamese translation for docs/vi/docs/python-types.md (#10047)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-08-10 17:52:25 +02:00
github-actions
82fafcc7ea 📝 Update release notes 2023-08-09 17:05:31 +00:00
Sebastián Ramírez
87398723f9 🔧 Add sponsor Porter (#10051) 2023-08-09 19:04:49 +02:00
github-actions
01383a57cb 📝 Update release notes 2023-08-09 13:27:14 +00:00
Sebastián Ramírez
14c96ef31b 🔧 Update sponsors, add Jina back as bronze sponsor (#10050) 2023-08-09 15:26:33 +02:00
github-actions
942ee69d85 📝 Update release notes 2023-08-05 08:46:58 +00:00
github-actions
6df10c9753 📝 Update release notes 2023-08-05 08:44:36 +00:00
github-actions
0f4a962c20 📝 Update release notes 2023-08-05 08:43:01 +00:00
Russ Biggs
bdd991244d ✏️ Fix typo in deprecation warnings in fastapi/params.py (#9854)
fix typo for deprecation warnings depreacated -> deprecated
2023-08-05 10:41:21 +02:00
Francis Bergin
69d5ebf34d ✏️ Fix typo in release notes (#9835) 2023-08-05 10:40:24 +02:00
ElliottLarsen
5e59acd35b ✏️ Fix typos in comments on internal code in fastapi/concurrency.py and fastapi/routing.py (#9590)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2023-08-05 10:39:38 +02:00
github-actions
bb7bbafb5f 📝 Update release notes 2023-08-05 08:38:32 +00:00
github-actions
87e126be2e 📝 Update release notes 2023-08-05 08:36:27 +00:00
Adejumo Ridwan Suleiman
33e77b6e25 📝 Add external article: Build an SMS Spam Classifier Serverless Database with FaunaDB and FastAPI (#9847) 2023-08-05 10:36:05 +02:00
github-actions
51f5497f3f 📝 Update release notes 2023-08-05 08:35:55 +00:00
Vicente Merino
0b496ea1f8 📝 Fix typo in docs/en/docs/contributing.md (#9878)
Co-authored-by: Vicente Merino <vmerino@rexmas.com>
2023-08-05 10:34:07 +02:00
Reza Rohani
b76112f1a5 📝 Fix code highlighting in docs/en/docs/tutorial/bigger-applications.md (#9806)
Update bigger-applications.md
2023-08-05 10:33:08 +02:00
github-actions
f2e80fae09 📝 Update release notes 2023-08-05 08:28:26 +00:00
github-actions
d86a695db9 📝 Update release notes 2023-08-05 08:26:40 +00:00
Aleksandr Pavlov
1c919dee3c 🌐 Add Russian translation for docs/ru/docs/tutorial/dependencies/global-dependencies.md (#9970)
Co-authored-by: dedkot <dedkot01@gmail.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-08-05 10:26:03 +02:00
Ahsan Sheraz
5891be5ff1 🌐 Add Urdu translation for docs/ur/docs/benchmarks.md (#9974) 2023-08-05 10:24:21 +02:00
github-actions
abfcb59fd0 📝 Update release notes 2023-08-05 08:23:39 +00:00
github-actions
0148c9508c 📝 Update release notes 2023-08-05 08:23:14 +00:00
dependabot[bot]
8f316be088 ⬆ Bump mypy from 1.4.0 to 1.4.1 (#9756)
Bumps [mypy](https://github.com/python/mypy) from 1.4.0 to 1.4.1.
- [Commits](https://github.com/python/mypy/compare/v1.4.0...v1.4.1)

---
updated-dependencies:
- dependency-name: mypy
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-05 10:22:58 +02:00
dependabot[bot]
d48a184dd8 ⬆ Bump mkdocs-material from 9.1.17 to 9.1.21 (#9960)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.17 to 9.1.21.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.17...9.1.21)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-05 10:22:39 +02:00
Sebastián Ramírez
8adbafc076 🔖 Release version 0.101.0 2023-08-04 23:00:17 +02:00
Sebastián Ramírez
4b5277744a 📝 Update release notes 2023-08-04 22:59:44 +02:00
github-actions
89a7cea561 📝 Update release notes 2023-08-04 20:58:08 +00:00
Sebastián Ramírez
77d1f69b1f 📌 Do not allow Pydantic 2.1.0 that breaks (require 2.1.1) (#10012) 2023-08-04 22:57:30 +02:00
Sebastián Ramírez
944c591803 📝 Update release notes 2023-08-04 22:50:34 +02:00
github-actions
1c20514738 📝 Update release notes 2023-08-04 20:47:42 +00:00
Sebastián Ramírez
19a2c3bb54 Enable Pydantic's serialization mode for responses, add support for Pydantic's computed_field, better OpenAPI for response models, proper required attributes, better generated clients (#10011)
*  Enable Pydantic's serialization mode for responses

*  Update tests with new Pydantic v2 serialization mode

*  Add a test for Pydantic v2's computed_field
2023-08-04 22:47:07 +02:00
github-actions
d943e02232 📝 Update release notes 2023-08-04 18:19:22 +00:00
Sebastián Ramírez
ebdf952545 👷 Add GitHub Actions step dump context to debug external failures (#10008) 2023-08-04 20:18:38 +02:00
github-actions
b3a1f91004 📝 Update release notes 2023-08-04 17:48:24 +00:00
Sebastián Ramírez
86e4e9f8f9 🔧 Restore MkDocs Material pin after the fix (#10001) 2023-08-04 19:47:42 +02:00
github-actions
3af7265a43 📝 Update release notes 2023-08-03 16:00:19 +00:00
Sebastián Ramírez
059fb12892 🔧 Update the Question template to ask for the Pydantic version (#10000) 2023-08-03 17:59:41 +02:00
github-actions
10b4c31f06 📝 Update release notes 2023-08-03 15:47:35 +00:00
David Montague
25694f5ae1 Fix tests for compatibility with pydantic 2.1.1 (#9943)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-08-03 17:46:57 +02:00
github-actions
94c48cfc8c 📝 Update release notes 2023-08-03 15:25:10 +00:00
Sebastián Ramírez
4ab0363ad7 Remove direct dependency on MkDocs, Material for MkDocs defines its own dependency (#9986) 2023-08-03 17:24:31 +02:00
github-actions
a73cdaed35 📝 Update release notes 2023-08-03 14:25:48 +00:00
Sebastián Ramírez
3fa6cfbcc5 👥 Update FastAPI People (#9999)
Co-authored-by: github-actions <github-actions@github.com>
2023-08-03 16:25:11 +02:00
github-actions
ad1d7f539e 📝 Update release notes 2023-08-03 14:13:59 +00:00
Sebastián Ramírez
89537a0497 🐳 Update Dockerfile with compatibility versions, to upgrade later (#9998) 2023-08-03 16:12:28 +02:00
github-actions
3829129245 📝 Update release notes 2023-08-02 18:58:29 +00:00
Sebastián Ramírez
53220b9832 Add pydantic-settings to FastAPI People dependencies (#9988) 2023-08-02 20:57:48 +02:00
github-actions
165f29fe5e 📝 Update release notes 2023-08-02 15:57:57 +00:00
Sebastián Ramírez
1e6bfa1f39 ♻️ Update FastAPI People logic with new Pydantic (#9985) 2023-08-02 17:57:20 +02:00
github-actions
b473cdd88d 📝 Update release notes 2023-08-02 15:29:13 +00:00
Irfanuddin Shafi Ahmed
37818f553d Fix test error in Windows for jsonable_encoder (#9840)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2023-08-02 17:28:34 +02:00
github-actions
2d8a776836 📝 Update release notes 2023-08-02 15:15:10 +00:00
Nikita
88d96799b1 🌐 Add Russian translation for docs/ru/docs/tutorial/security/index.md (#9963)
Co-authored-by: dedkot <dedkot01@gmail.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-08-02 17:14:19 +02:00
github-actions
01f91fdb57 📝 Update release notes 2023-08-01 21:40:00 +00:00
Sebastián Ramírez
c2a33f1087 🍱 Update sponsors, Fern badge (#9982) 2023-08-01 23:39:22 +02:00
github-actions
6c8c3b788b 📝 Update release notes 2023-08-01 09:20:23 +00:00
Sebastián Ramírez
d2169fbad9 👷 Deploy docs to Cloudflare Pages (#9978) 2023-08-01 11:19:44 +02:00
github-actions
74de15d0df 📝 Update release notes 2023-07-31 21:49:56 +00:00
Sebastián Ramírez
1da0a7afbd 🔧 Update sponsor Fern (#9979) 2023-07-31 23:49:19 +02:00
github-actions
d38e86ef20 📝 Update release notes 2023-07-31 19:54:46 +00:00
Sebastián Ramírez
a0b987224a 👷 Update CI debug mode with Tmate (#9977) 2023-07-31 21:54:07 +02:00
github-actions
cd6d75e451 📝 Update release notes 2023-07-28 12:16:16 +00:00
Sebastián Ramírez
076bdea671 🌐 Remove Vietnamese note about missing translation (#9957) 2023-07-28 14:15:29 +02:00
Sebastián Ramírez
8d27236648 🔖 Release version 0.100.1 2023-07-27 21:16:01 +02:00
Sebastián Ramírez
effa578b8d 📝 Update release notes 2023-07-27 21:15:16 +02:00
github-actions
bec5530ac8 📝 Update release notes 2023-07-27 19:14:48 +00:00
Orest Furda
7b3d770d65 🌐 Add Ukrainian translation for docs/uk/docs/tutorial/body.md (#4574)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-27 21:09:34 +02:00
github-actions
643d8e41c4 📝 Update release notes 2023-07-27 19:08:23 +00:00
github-actions
c52c940066 📝 Update release notes 2023-07-27 19:04:24 +00:00
Nguyễn Khắc Thành
1d088eaf18 🌐 Add Vietnamese translation for docs/vi/docs/features.md and docs/vi/docs/index.md (#3006)
Co-authored-by: Nguyen Khac Thanh <nkthanh@Nguyens-MacBook-Pro.local>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-07-27 21:01:57 +02:00
github-actions
77cfb3c822 📝 Update release notes 2023-07-27 18:59:56 +00:00
Nina Hwang
55871036db 🌐 Add Korean translation for docs/ko/docs/async.md (#4179)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-27 20:59:18 +02:00
github-actions
e334065d10 📝 Update release notes 2023-07-27 18:57:37 +00:00
github-actions
5d3f51c8bc 📝 Update release notes 2023-07-27 18:56:19 +00:00
吴定焕
e081145c7d 🌐 Add Chinese translation for docs/zh/docs/tutorial/background-tasks.md (#9812)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-07-27 20:55:40 +02:00
github-actions
a52875c656 📝 Update release notes 2023-07-27 18:54:32 +00:00
Sebastián Ramírez
570ca011f9 🔧 Update sponsors, add Fern (#9956) 2023-07-27 20:53:51 +02:00
Sam Courtemanche
04b9a67cbb 🌐 Add French translation for docs/fr/docs/tutorial/query-params-str-validations.md (#4075)
Co-authored-by: Julian Maurin <julian.maurin.perso@pm.me>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-07-27 20:53:21 +02:00
github-actions
02ed00cc47 📝 Update release notes 2023-07-27 18:53:03 +00:00
github-actions
35707a1b29 📝 Update release notes 2023-07-27 18:51:59 +00:00
Julian Maurin
e79dc9697c 🌐 Add French translation for docs/fr/docs/tutorial/index.md (#2234)
Co-authored-by: Ruidy <ruidy.nemausat@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-07-27 20:51:55 +02:00
Julian Maurin
2dcf78f295 🌐 Add French translation for docs/fr/docs/contributing.md (#2132)
Co-authored-by: Ruidy <ruidy.nemausat@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-07-27 20:51:07 +02:00
github-actions
d7c6894b8b 📝 Update release notes 2023-07-27 18:50:16 +00:00
Clément Sauvage
3ffebbcf01 🌐 Add French translation for docs/fr/docs/benchmarks.md (#2155)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sam Courtemanche <smlep.pro@gmail.com>
Co-authored-by: Ruidy <ruidy.nemausat@gmail.com>
2023-07-27 20:49:56 +02:00
mahone3297
943baa387f 🌐 Update Chinese translations with new source files (#9738)
Co-authored-by: mkdir700 <mkdir700@gmail.com>
2023-07-27 20:49:03 +02:00
github-actions
6a95a3a8e7 📝 Update release notes 2023-07-27 18:48:28 +00:00
dedkot
608cc4fea3 🌐 Add Russian translation for docs/tutorial/request-forms.md (#9841) 2023-07-27 20:47:42 +02:00
github-actions
39318a39f4 📝 Update release notes 2023-07-27 18:43:30 +00:00
Creat55
703a1f200a 🌐 Update Chinese translation for docs/zh/docs/tutorial/handling-errors.md (#9485)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-07-27 20:42:48 +02:00
github-actions
7cdea41431 📝 Update release notes 2023-07-27 18:23:13 +00:00
Marcelo Trylesinski
6c99e90a6b 🐛 Replace MultHostUrl to AnyUrl for compatibility with older versions of Pydantic v1 (#9852) 2023-07-27 20:22:23 +02:00
github-actions
f7e3559bd5 📝 Update release notes 2023-07-09 15:45:55 +00:00
github-actions
2d69531509 📝 Update release notes 2023-07-09 15:44:58 +00:00
Sebastián Ramírez
fe91def515 👷 Update FastAPI People token (#9844) 2023-07-09 17:44:40 +02:00
Sebastián Ramírez
73c39745d8 👥 Update FastAPI People (#9775)
Co-authored-by: github-actions <github-actions@github.com>
2023-07-09 17:44:21 +02:00
github-actions
ea92dcaa01 📝 Update release notes 2023-07-09 15:40:19 +00:00
Sebastián Ramírez
9213b72115 👷 Update MkDocs Material token (#9843) 2023-07-09 17:39:42 +02:00
github-actions
eaa14e18d3 📝 Update release notes 2023-07-09 14:37:16 +00:00
Sebastián Ramírez
69df2fa1e5 👷 Update token for latest changes (#9842) 2023-07-09 16:34:45 +02:00
github-actions
c165be380f 📝 Update release notes 2023-07-07 18:15:42 +00:00
Sebastián Ramírez
5f85e2cf58 📝 Update links for self-hosted Swagger UI, point to v5, for OpenAPI 31.0 (#9834)
📝 Update links for self-hosted Swagger UI, point to v5, for OpenAPI 3.1.0
2023-07-07 20:15:08 +02:00
Sebastián Ramírez
f8356d9fff 🔖 Release version 0.100.0 2023-07-07 19:25:59 +02:00
Sebastián Ramírez
179e409159 📝 Update release notes 2023-07-07 19:14:54 +02:00
github-actions
bb7e5b7261 📝 Update release notes 2023-07-07 17:12:58 +00:00
Sebastián Ramírez
0976185af9 Add support for Pydantic v2 (#9816)
*  Pydantic v2 migration, initial implementation (#9500)

*  Add compat layer, for Pydantic v1 and v2

*  Re-export Pydantic needed internals from compat, to later patch them for v1

* ♻️ Refactor internals to use new compatibility layers and run with Pydantic v2

* 📝 Update examples to run with Pydantic v2

*  Update tests to use Pydantic v2

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

*  Temporarily disable Peewee tests, afterwards I'll enable them only for Pydantic v1

* 🐛 Fix JSON Schema generation and OpenAPI ref template

* 🐛 Fix model field creation with defaults from Pydantic v2

* 🐛 Fix body field creation, with new FieldInfo

*  Use and check new ResponseValidationError for server validation errors

*  Fix test_schema_extra_examples tests with ResponseValidationError

*  Add dirty-equals to tests for compatibility with Pydantic v1 and v2

*  Add util to regenerate errors with custom loc

*  Generate validation errors with loc

*  Update tests for compatibility with Pydantic v1 and v2

*  Update tests for Pydantic v2 in tests/test_filter_pydantic_sub_model.py

*  Refactor tests in tests/test_dependency_overrides.py for Pydantic v2, separate parameterized into independent tests to use insert_assert

*  Refactor OpenAPI test for tests/test_infer_param_optionality.py for consistency, and make it compatible with Pydantic v1 and v2

*  Update tests for tests/test_multi_query_errors.py for Pydantic v1 and v2

*  Update tests for tests/test_multi_body_errors.py for Pydantic v1 and v2

*  Update tests for tests/test_multi_body_errors.py for Pydantic v1 and v2

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* ♻️ Refactor tests for tests/test_path.py to inline pytest parameters, to make it easier to make them compatible with Pydantic v2

*  Refactor and udpate tests for tests/test_path.py for Pydantic v1 and v2

* ♻️ Refactor and update tests for tests/test_query.py with compatibility for Pydantic v1 and v2

*  Fix test with optional field without default None

*  Update tests for compatibility with Pydantic v2

*  Update tutorial tests for Pydantic v2

* ♻️ Update OAuth2 dependencies for Pydantic v2

* ♻️ Refactor str check when checking for sequence types

* ♻️ Rename regex to pattern to keep in sync with Pydantic v2

* ♻️ Refactor _compat.py, start moving conditional imports and declarations to specifics of Pydantic v1 or v2

*  Update tests for OAuth2 security optional

*  Refactor tests for OAuth2 optional for Pydantic v2

*  Refactor tests for OAuth2 security for compatibility with Pydantic v2

* 🐛 Fix location in compat layer for Pydantic v2 ModelField

*  Refactor tests for Pydantic v2 in tests/test_tutorial/test_bigger_applications/test_main_an_py39.py

* 🐛 Add missing markers in Python 3.9 tests

*  Refactor tests for bigger apps for consistency with annotated ones and with support for Pydantic v2

* 🐛 Fix jsonable_encoder with new Pydantic v2 data types and Url

* 🐛 Fix invalid JSON error for compatibility with Pydantic v2

*  Update tests for behind_a_proxy for Pydantic v2

*  Update tests for tests/test_tutorial/test_body/test_tutorial001_py310.py for Pydantic v2

*  Update tests for tests/test_tutorial/test_body/test_tutorial001.py with Pydantic v2 and consistency with Python 3.10 tests

*  Fix tests for tutorial/body_fields for Pydantic v2

*  Refactor tests for tutorial/body_multiple_params with Pydantic v2

*  Update tests for tutorial/body_nested_models for Pydantic v2

*  Update tests for tutorial/body_updates for Pydantic v2

*  Update test for tutorial/cookie_params for Pydantic v2

*  Fix tests for tests/test_tutorial/test_custom_request_and_route/test_tutorial002.py for Pydantic v2

*  Update tests for tutorial/dataclasses for Pydantic v2

*  Update tests for tutorial/dependencies for Pydantic v2

*  Update tests for tutorial/extra_data_types for Pydantic v2

*  Update tests for tutorial/handling_errors for Pydantic v2

*  Fix test markers for Python 3.9

*  Update tests for tutorial/header_params for Pydantic v2

*  Update tests for Pydantic v2 in tests/test_tutorial/test_openapi_callbacks/test_tutorial001.py

*  Fix extra tests for Pydantic v2

*  Refactor test for parameters, to later fix Pydantic v2

*  Update tests for tutorial/query_params for Pydantic v2

* ♻️ Update examples in docs to use new pattern instead of the old regex

*  Fix several tests for Pydantic v2

*  Update and fix test for ResponseValidationError

* 🐛 Fix check for sequences vs scalars, include bytes as scalar

* 🐛 Fix check for complex data types, include UploadFile

* 🐛 Add list to sequence annotation types

* 🐛 Fix checks for uploads and add utils to find if an annotation is an upload (or bytes)

*  Add UnionType and NoneType to compat layer

*  Update tests for request_files for compatibility with Pydantic v2 and consistency with other tests

*  Fix testsw for request_forms for Pydantic v2

*  Fix tests for request_forms_and_files for Pydantic v2

*  Fix tests in tutorial/security for compatibility with Pydantic v2

* ⬆️ Upgrade required version of email_validator

*  Fix tests for params repr

*  Add Pydantic v2 pytest markers

* Use match_pydantic_error_url

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* Use field_serializer instead of encoders in some tests

* Show Undefined as ... in repr

* Mark custom encoders test with xfail

* Update test to reflect new serialization of Decimal as str

* Use `model_validate` instead of `from_orm`

* Update JSON schema to reflect required nullable

* Add dirty-equals to pyproject.toml

* Fix locs and error creation for use with pydantic 2.0a4

* Use the type adapter for serialization. This is hacky.

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

*  Refactor test_multi_body_errors for compatibility with Pydantic v1 and v2

*  Refactor test_custom_encoder for Pydantic v1 and v2

*  Set input to None for now, for compatibility with current tests

* 🐛 Fix passing serialization params to model field when handling the response

* ♻️ Refactor exceptions to not depend on Pydantic ValidationError class

* ♻️ Revert/refactor params to simplify repr

*  Tweak tests for custom class encoders for Pydantic v1 and v2

*  Tweak tests for jsonable_encoder for Pydantic v1 and v2

*  Tweak test for compatibility with Pydantic v1 and v2

* 🐛 Fix filtering data with subclasses

* 🐛 Workaround examples in OpenAPI schema

*  Add skip marker for SQL tutorial, needs to be updated either way

*  Update test for broken JSON

*  Fix test for broken JSON

*  Update tests for timedeltas

*  Fix test for plain text validation errors

*  Add markers for Pydantic v1 exclusive tests (for now)

*  Update test for path_params with enums for compatibility with Pydantic v1 and v2

*  Update tests for extra examples in OpenAPI

*  Fix tests for response_model with compatibility with Pydantic v1 and v2

* 🐛 Fix required double serialization for different types of models

*  Fix tests for response model with compatibility with new Pydantic v2

* 🐛 Import Undefined from compat layer

*  Fix tests for response_model for Pydantic v2

*  Fix tests for schema_extra for Pydantic v2

*  Add markers and update tests for Pydantic v2

* 💡 Comment out logic for double encoding that breaks other usecases

*  Update errors for int parsing

* ♻️ Refactor re-enabling compatibility for Pydantic v1

* ♻️ Refactor OpenAPI utils to re-enable support for Pydantic v1

* ♻️ Refactor dependencies/utils and _compat for compatibility with Pydantic v1

* 🐛 Fix and tweak compatibility with Pydantic v1 and v2 in dependencies/utils

*  Tweak tests and examples for Pydantic v1

* ♻️ Tweak call to ModelField.validate for compatibility with Pydantic v1

*  Use new global override TypeAdapter from_attributes

*  Update tests after updating from_attributes

* 🔧 Update pytest config to avoid collecting tests from docs, useful for editor-integrated tests

*  Add test for data filtering, including inheritance and models in fields or lists of models

* ♻️ Make OpenAPI models compatible with both Pydantic v1 and v2

* ♻️ Fix compatibility for Pydantic v1 and v2 in jsonable_encoder

* ♻️ Fix compatibility in params with Pydantic v1 and v2

* ♻️ Fix compatibility when creating a FieldInfo in Pydantic v1 and v2 in utils.py

* ♻️ Fix generation of flat_models and JSON Schema definitions in _compat.py for Pydantic v1 and v2

* ♻️ Update handling of ErrorWrappers for Pydantic v1

* ♻️ Refactor checks and handling of types an sequences

* ♻️ Refactor and cleanup comments with compatibility for Pydantic v1 and v2

* ♻️ Update UploadFile for compatibility with both Pydantic v1 and v2

* 🔥 Remove commented out unneeded code

* 🐛 Fix mock of get_annotation_from_field_info for Pydantic v1 and v2

* 🐛 Fix params with compatibility for Pydantic v1 and v2, with schemas and new pattern vs regex

* 🐛 Fix check if field is sequence for Pydantic v1

*  Fix tests for custom_schema_fields, for compatibility with Pydantic v1 and v2

*  Simplify and fix tests for jsonable_encoder with compatibility for Pydantic v1 and v2

*  Fix tests for orm_mode with Pydantic v1 and compatibility with Pydantic v2

* ♻️ Refactor logic for normalizing Pydantic v1 ErrorWrappers

* ♻️ Workaround for params with examples, before defining what to deprecate in Pydantic v1 and v2 for examples with JSON Schema vs OpenAPI

*  Fix tests for Pydantic v1 and v2 for response_by_alias

*  Fix test for schema_extra with compatibility with Pydantic v1 and v2

* ♻️ Tweak error regeneration with loc

* ♻️ Update error handling and serializationwith compatibility for Pydantic v1 and v2

* ♻️ Re-enable custom encoders for Pydantic v1

* ♻️ Update ErrorWrapper reserialization in Pydantic v1, do it outside of FastAPI ValidationExceptions

*  Update test for filter_submodel, re-structure to simplify testing while keeping division of Pydantic v1 and v2

*  Refactor Pydantic v1 only test that requires modifying environment variables

* 🔥 Update test for plaintext error responses, for Pydantic v1 and v2

* ️ Revert changes in DB tutorial to use Pydantic v1 (the new guide will have SQLModel)

*  Mark current SQL DB tutorial tests as Pydantic only

* ♻️ Update datastructures for compatibility with Pydantic v1, not requiring pydantic-core

* ♻️ Update encoders.py for compatibility with Pydantic v1

* ️ Revert changes to Peewee, the docs for that are gonna live in a new HowTo section, not in the main tutorials

* ♻️ Simplify response body kwargs generation

* 🔥 Clean up comments

* 🔥 Clean some tests and comments

*  Refactor tests to match new Pydantic error string URLs

*  Refactor tests for recursive models for Pydantic v1 and v2

*  Update tests for Peewee, re-enable, Pydantic-v1-only

* ♻️ Update FastAPI params to take regex and pattern arguments

* ️ Revert tutorial examples for pattern, it will be done in a subsequent PR

* ️ Revert changes in schema extra examples, it will be added later in a docs-specific PR

* 💡 Add TODO comment to document str validations with pattern

* 🔥 Remove unneeded comment

* 📌 Upgrade Pydantic pin dependency

* ⬆️ Upgrade email_validator dependency

* 🐛 Tweak type annotations in _compat.py

* 🔇 Tweak mypy errors for compat, for Pydantic v1 re-imports

* 🐛 Tweak and fix type annotations

*  Update requirements-test.txt, re-add dirty-equals

* 🔥 Remove unnecessary config

* 🐛 Tweak type annotations

* 🔥 Remove unnecessary type in dependencies/utils.py

* 💡 Update comment in routing.py

---------

Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>

* 👷 Add CI for both Pydantic v1 and v2 (#9688)

* 👷 Test and install Pydantic v1 and v2 in CI

* 💚 Tweak CI config for Pydantic v1 and v2

* 💚 Fix Pydantic v2 specification in CI

* 🐛 Fix type annotations for compatibility with Python 3.7

* 💚 Install Pydantic v2 for lints

* 🐛 Fix type annotations for Pydantic v2

* 💚 Re-use test cache for lint

* ♻️ Refactor internals for test coverage and performance (#9691)

* ♻️ Tweak import of Annotated from typing_extensions, they are installed anyway

* ♻️ Refactor _compat to define functions for Pydantic v1 or v2 once instead of checking inside

*  Add test for UploadFile for Pydantic v2

* ♻️ Refactor types and remove logic for impossible cases

*  Add missing tests from test refactor for path params

*  Add tests for new decimal encoder

* 💡 Add TODO comment for decimals in encoders

* 🔥 Remove unneeded dummy function

* 🔥 Remove section of code in field_annotation_is_scalar covered by sub-call to field_annotation_is_complex

* ♻️ Refactor and tweak variables and types in _compat

*  Add tests for corner cases and compat with Pydantic v1 and v2

* ♻️ Refactor type annotations

* 🔖 Release version 0.100.0-beta1

* ♻️ Refactor parts that use optional requirements to make them compatible with installations without them (#9707)

* ♻️ Refactor parts that use optional requirements to make them compatible with installations without them

* ♻️ Update JSON Schema for email field without email-validator installed

* 🐛 Fix support for Pydantic v2.0, small changes in their final release (#9771)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>

* 🔖 Release version 0.100.0-beta2

*  OpenAPI 3.1.0 with Pydantic v2, merge `master` (#9773)

*  Add dirty-equals as a testing dependency (#9778)

 Add dirty-equals as a testing dependency, it seems it got lsot at some point

* 🔀 Merge master, fix valid JSON Schema accepting bools (#9782)

* ️ Revert usage of custom logic for TypeAdapter JSON Schema, solved on the Pydantic side (#9787)

️ Revert usage of custom logic for TypeAdapter JSON Schema, solved on Pydantic side

* ♻️ Deprecate parameter `regex`, use `pattern` instead (#9786)

* 📝 Update docs to deprecate regex, recommend pattern

* ♻️ Update examples to use new pattern instead of regex

* 📝 Add new example with deprecated regex

* ♻️ Add deprecation notes and warnings for regex

*  Add tests for regex deprecation

*  Update tests for compatibility with Pydantic v1

*  Update docs to use Pydantic v2 settings and add note and example about v1 (#9788)

*  Add pydantic-settings to all extras

* 📝 Update docs for Pydantic settings

* 📝 Update Settings source examples to use Pydantic v2, and add a Pydantic v1 version

*  Add tests for settings with Pydantic v1 and v2

* 🔥 Remove solved TODO comment

* ♻️ Update conditional OpenAPI to use new Pydantic v2 settings

*  Update tests to import Annotated from typing_extensions for Python < 3.9 (#9795)

*  Add pydantic-extra-types to fastapi[extra]

*  temp: Install Pydantic from source to test JSON Schema metadata fixes (#9777)

*  Install Pydantic from source, from branch for JSON Schema with metadata

*  Update dependencies, install Pydantic main

*  Fix dependency URL for Pydantic from source

*  Add pydantic-settings for test requirements

* 💡 Add TODO comments to re-enable Pydantic main (not from source) (#9796)

*  Add new Pydantic Field param options to Query, Cookie, Body, etc. (#9797)

* 📝 Add docs for Pydantic v2 for `docs/en/docs/advanced/path-operation-advanced-configuration.md` (#9798)

* 📝 Update docs in examples for settings with Pydantic v2 (#9799)

* 📝 Update JSON Schema `examples` docs with Pydantic v2 (#9800)

* ♻️ Use new Pydantic v2 JSON Schema generator (#9813)

Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>

* ♻️ Tweak type annotations and Pydantic version range (#9801)

* 📌 Re-enable GA Pydantic, for v2, require minimum 2.0.2 (#9814)

* 🔖 Release version 0.100.0-beta3

* 🔥 Remove duplicate type declaration from merge conflicts (#9832)

* 👷‍♂️ Run tests with Pydantic v2 GA (#9830)

👷 Run tests for Pydantic v2 GA

* 📝 Add notes to docs expecting Pydantic v2 and future updates (#9833)

* 📝 Update index with new extras

* 📝 Update release notes

---------

Co-authored-by: David Montague <35119617+dmontagu@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Pastukhov Nikita <diementros@yandex.ru>
2023-07-07 19:12:13 +02:00
Sebastián Ramírez
dd4e78ca7b 🔖 Release version 0.99.1 2023-07-02 18:00:39 +02:00
Sebastián Ramírez
8a198fc1ed 📝 Update release notes 2023-07-02 18:00:12 +02:00
github-actions
6bd4f53531 📝 Update release notes 2023-07-02 15:59:00 +00:00
Sebastián Ramírez
07e1dea467 🐛 Fix JSON Schema accepting bools as valid JSON Schemas, e.g. additionalProperties: false (#9781)
* 🐛 Fix JSON Schema accepting bools as valid JSON Schemas, e.g. additionalProperties: false

*  Add test to ensure additionalProperties can be false

* ♻️ Tweak OpenAPI models to support Pydantic v1's JSON Schema for tuples
2023-07-02 17:58:23 +02:00
github-actions
0f105d9076 📝 Update release notes 2023-07-01 16:44:12 +00:00
Sebastián Ramírez
4d83f984cc 📝 Update source examples to use new JSON Schema examples field (#9776)
* 📝 Update source examples to use new JSON Schema examples field

*  Update tests for JSON Schema examples

* 📝 Update highlights in JSON Schema examples
2023-07-01 18:43:29 +02:00
Sebastián Ramírez
983f1d34db 🔖 Release version 0.99.0 2023-06-30 20:55:17 +02:00
Sebastián Ramírez
efc2bcc57a 📝 Update release notes 2023-06-30 20:54:25 +02:00
github-actions
b757211299 📝 Update release notes 2023-06-30 18:25:53 +00:00
Sebastián Ramírez
7dad5a820b Add support for OpenAPI 3.1.0 (#9770)
*  Update OpenAPI models for JSON Schema 2020-12 and OpenAPI 3.1.0

*  Add support for summary and webhooks

*  Update JSON Schema for UploadFiles

* ️ Revert making paths optional, to ensure always correctness

* ️ Keep UploadFile as format: binary for compatibility with the rest of Pydantic bytes fields in v1

*  Update version of OpenAPI generated to 3.1.0

*  Update the version of Swagger UI

* 📝 Update docs about extending OpenAPI

* 📝 Update docs and links to refer to OpenAPI 3.1.0

*  Update logic for handling webhooks

* ♻️ Update parameter functions and classes, deprecate example and make examples the main field

*  Update tests for OpenAPI 3.1.0

* 📝 Update examples for OpenAPI metadata

*  Add and update tests for OpenAPI metadata

* 📝 Add source example for webhooks

* 📝 Update docs for metadata

* 📝 Update docs for Schema extra

* 📝 Add docs for webhooks

* 🔧 Add webhooks docs to MkDocs

*  Update tests for extending OpenAPI

*  Add tests for webhooks

* ♻️ Refactor generation of OpenAPI and JSON Schema with params

* 📝 Update source examples for field examples

*  Update tests for examples

*  Make sure the minimum version of typing-extensions installed has deprecated() (already a dependency of Pydantic)

* ✏️ Fix typo in Webhooks example code

* 🔥 Remove commented out code of removed nullable field

* 🗑️ Add deprecation warnings for example argument

*  Update tests to check for deprecation warnings

*  Add test for webhooks with security schemes, for coverage

* 🍱 Update image for metadata, with new summary

* 🍱 Add docs image for Webhooks

* 📝 Update docs for webhooks, add docs UI image
2023-06-30 20:25:16 +02:00
github-actions
02fc9e8a63 📝 Update release notes 2023-06-30 16:23:36 +00:00
Sebastián Ramírez
0a8423d792 🔨 Enable linenums in MkDocs Material during local live development to simplify highlighting code (#9769) 2023-06-30 18:23:02 +02:00
github-actions
0f390cd4b5 📝 Update release notes 2023-06-28 16:39:44 +00:00
Carson Crane
1f21b16e03 Add support for deque objects and children in jsonable_encoder (#9433)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-28 18:39:10 +02:00
github-actions
d409c05d6f 📝 Update release notes 2023-06-27 01:14:01 +00:00
dependabot[bot]
782b1c49a9 ⬆ Update httpx requirement from <0.24.0,>=0.23.0 to >=0.23.0,<0.25.0 (#9724)
Updates the requirements on [httpx](https://github.com/encode/httpx) to permit the latest version.
- [Release notes](https://github.com/encode/httpx/releases)
- [Changelog](https://github.com/encode/httpx/blob/master/CHANGELOG.md)
- [Commits](https://github.com/encode/httpx/compare/0.23.0...0.24.1)

---
updated-dependencies:
- dependency-name: httpx
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-27 03:13:10 +02:00
github-actions
706d74b6ad 📝 Update release notes 2023-06-27 01:10:40 +00:00
dependabot[bot]
9debdc97ef ⬆ Bump mkdocs-material from 9.1.16 to 9.1.17 (#9746)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 9.1.16 to 9.1.17.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/9.1.16...9.1.17)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-27 03:08:43 +02:00
github-actions
6c143b930d 📝 Update release notes 2023-06-27 01:07:03 +00:00
github-actions
dffca555ff 📝 Update release notes 2023-06-27 01:06:48 +00:00
Sebastián Ramírez
5e7d45af16 🔥 Remove missing translation dummy pages, no longer necessary (#9751) 2023-06-27 03:06:27 +02:00
pre-commit-ci[bot]
eb312758d8 ⬆ [pre-commit.ci] pre-commit autoupdate (#9259)
updates:
- [github.com/asottile/pyupgrade: v3.3.1 → v3.7.0](https://github.com/asottile/pyupgrade/compare/v3.3.1...v3.7.0)
- [github.com/charliermarsh/ruff-pre-commit: v0.0.272 → v0.0.275](https://github.com/charliermarsh/ruff-pre-commit/compare/v0.0.272...v0.0.275)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-27 03:06:02 +02:00
github-actions
a95af94669 📝 Update release notes 2023-06-27 01:02:34 +00:00
mojtaba
6ba4492670 🌐 Add Persian translation for docs/fa/docs/advanced/sub-applications.md (#9692)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Amin Alaee <mohammadamin.alaee@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-27 03:02:00 +02:00
github-actions
317cef3f8a 📝 Update release notes 2023-06-27 01:00:55 +00:00
Sergei Glazkov
81772b46a8 🌐 Add Russian translation for docs/ru/docs/tutorial/response-model.md (#9675)
Co-authored-by: s.glazkov <s.glazkov@polymatica.ru>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alexandr <alexandrhub@vk.com>
Co-authored-by: ivan-abc <36765187+ivan-abc@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-27 03:00:19 +02:00
github-actions
47524eee1b 📝 Update release notes 2023-06-26 16:03:19 +00:00
Sebastián Ramírez
872af100f5 📝 Fix form for the FastAPI and friends newsletter (#9749) 2023-06-26 18:02:34 +02:00
github-actions
d1c5c5c97c 📝 Update release notes 2023-06-26 14:06:24 +00:00
Sebastián Ramírez
ed297bb2e0 Add Material for MkDocs Insiders features and cards (#9748)
*  Add dependencies for MkDocs Insiders

* 🙈 Add Insider's .cache to .gitignore

* 🔧 Update MkDocs configs for Insiders

* 💄 Add custom Insiders card layout, while the custom logo is provided from upstream

* 🔨 Update docs.py script to dynamically enable insiders if it's installed

* 👷 Add cache for MkDocs Material Insiders' cards

* 🔊 Add a small log to the docs CLI

* 🔊 Tweak logs, only after exporting languages

* 🐛 Fix accessing non existing env var

* 🔧 Invalidate deps cache

* 🔧 Tweak cache IDs

* 👷 Update cache for installing insiders

* 🔊 Log insiders

* 💚 Invalidate cache

* 👷 Tweak cache keys

* 👷 Trigger CI and test cache

* 🔥 Remove cache comment

* ️ Optimize cache usage for first runs of docs

* 👷 Tweak cache for MkDocs Material cards

* 💚 Trigger CI to test cache
2023-06-26 16:05:43 +02:00
github-actions
afc237ad53 📝 Update release notes 2023-06-25 12:57:53 +00:00
Sebastián Ramírez
b107b6a096 🔥 Remove languages without translations (#9743)
* 🔥 Remove lang directories for empty translations

* 🔥 Remove untranslated langs from main config
2023-06-25 14:57:19 +02:00
github-actions
be8e704e46 📝 Update release notes 2023-06-25 12:34:39 +00:00
Sebastián Ramírez
5656ed09ef Refactor docs for building scripts, use MkDocs hooks, simplify (remove) configs for languages (#9742)
*  Add MkDocs hooks to re-use all config from en, and auto-generate missing docs files form en

* 🔧 Update MkDocs config for es

* 🔧 Simplify configs for all languages

*  Compute available languages from MkDocs Material for config overrides in hooks

* 🔧 Update config for MkDocs for en, to make paths compatible for other languages

* ♻️ Refactor scripts/docs.py to remove all custom logic that is now handled by the MkDocs hooks

* 🔧 Remove ta language as it's incomplete (no translations and causing errors)

* 🔥 Remove ta lang, no translations available

* 🔥 Remove dummy overrides directories, no longer needed

*  Use the same missing-translation.md file contents for hooks

* ️ Restore and refactor new-lang command

* 📝 Update docs for contributing with new simplified workflow for translations

* 🔊 Enable logs so that MkDocs can show its standard output on the docs.py script
2023-06-25 14:33:58 +02:00
github-actions
c563b5bcf1 📝 Update release notes 2023-06-24 14:47:59 +00:00
Sebastián Ramírez
51d3a8ff12 🔨 Add MkDocs hook that renames sections based on the first index file (#9737) 2023-06-24 16:47:15 +02:00
github-actions
3aea9acc68 📝 Update release notes 2023-06-24 12:31:54 +00:00
Sebastián Ramírez
dfa56f743a 👷 Make cron jobs run only on main repo, not on forks, to avoid error notifications from missing tokens (#9735) 2023-06-24 14:30:57 +02:00
github-actions
8cee653ad8 📝 Update release notes 2023-06-24 12:29:17 +00:00
Sebastián Ramírez
dd590f46ad 🔧 Update MkDocs for other languages (#9734) 2023-06-24 14:28:43 +02:00
github-actions
7d865c9487 📝 Update release notes 2023-06-24 00:00:47 +00:00
Sebastián Ramírez
c09e5cdfa7 👷 Refactor Docs CI, run in multiple workers with a dynamic matrix to optimize speed (#9732) 2023-06-24 02:00:12 +02:00
github-actions
2848951082 📝 Update release notes 2023-06-23 23:52:34 +00:00
Sebastián Ramírez
f61217a18a 🔥 Remove old internal GitHub Action watch-previews that is no longer needed (#9730) 2023-06-24 01:51:56 +02:00
github-actions
1471bc956c 📝 Update release notes 2023-06-23 18:17:17 +00:00
Sebastián Ramírez
0c66ec7da9 ⬆️ Upgrade MkDocs and MkDocs Material (#9729) 2023-06-23 20:16:41 +02:00
github-actions
5a3bbb62de 📝 Update release notes 2023-06-23 17:55:46 +00:00
Sebastián Ramírez
42d0d6e4a5 👷 Build and deploy docs only on docs changes (#9728) 2023-06-23 19:55:09 +02:00
Sebastián Ramírez
4721405ef7 🔖 Release version 0.98.0 2023-06-22 19:58:22 +02:00
Sebastián Ramírez
8066f85b3f 📝 Update release notes 2023-06-22 19:57:25 +02:00
github-actions
2ffb08d0bc 📝 Update release notes 2023-06-22 17:52:55 +00:00
dependabot[bot]
d1805ef466 ⬆ Bump ruff from 0.0.272 to 0.0.275 (#9721)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 19:52:20 +02:00
github-actions
41d774ed6d 📝 Update release notes 2023-06-22 17:44:21 +00:00
dependabot[bot]
836ac56203 ⬆ Update uvicorn[standard] requirement from <0.21.0,>=0.12.0 to >=0.12.0,<0.23.0 (#9463)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 19:43:44 +02:00
github-actions
a01c2ca3dd 📝 Update release notes 2023-06-22 17:43:29 +00:00
dependabot[bot]
6553243dbf ⬆ Bump mypy from 1.3.0 to 1.4.0 (#9719)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 19:42:53 +02:00
github-actions
fdc713428e 📝 Update release notes 2023-06-22 17:26:46 +00:00
dependabot[bot]
60343161ea ⬆ Update pre-commit requirement from <3.0.0,>=2.17.0 to >=2.17.0,<4.0.0 (#9251)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 19:26:01 +02:00
github-actions
586de94ca1 📝 Update release notes 2023-06-22 17:12:59 +00:00
dependabot[bot]
56bc75372f ⬆ Bump pypa/gh-action-pypi-publish from 1.8.5 to 1.8.6 (#9482)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-22 19:12:24 +02:00
github-actions
4842dfadcf 📝 Update release notes 2023-06-22 17:07:05 +00:00
я котик пур-пур
cfc06a3a3d 📝 Update docs on Pydantic using ujson internally (#5804)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 17:06:25 +00:00
github-actions
c812b42293 📝 Update release notes 2023-06-22 17:04:50 +00:00
ivan-abc
68ce5b37dc ✏ Rewording in docs/en/docs/tutorial/debugging.md (#9581)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 17:04:16 +00:00
github-actions
0dc9a377dc 📝 Update release notes 2023-06-22 17:02:08 +00:00
Pankaj Kumar
d82700c96d ✏️ Fix tooltips for light/dark theme toggler in docs (#9588) 2023-06-22 19:01:28 +02:00
github-actions
fafe670db6 📝 Update release notes 2023-06-22 16:53:00 +00:00
TabarakoAkula
47342cdd18 🌐 Add Russian translation for docs/ru/docs/tutorial/metadata.md (#9681)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: ivan-abc <36765187+ivan-abc@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 18:52:24 +02:00
github-actions
e76dd3e70d 📝 Update release notes 2023-06-22 16:44:41 +00:00
Marcel Sander
e5f3d6a5eb 📝 Add german blog post (Domain-driven Design mit Python und FastAPI) (#9261) 2023-06-22 18:44:05 +02:00
github-actions
7217f167d4 📝 Update release notes 2023-06-22 16:41:05 +00:00
github-actions
762ede2bec 📝 Update release notes 2023-06-22 16:40:50 +00:00
jyothish-mohan
a3b1478221 ✏️ Tweak wording in docs/en/docs/tutorial/security/index.md (#9561) 2023-06-22 18:40:32 +02:00
Lili_DL
41ff599d4b 🌐 Fix typo in Spanish translation for docs/es/docs/tutorial/first-steps.md (#9571)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 18:40:17 +02:00
github-actions
b1f27c96c4 📝 Update release notes 2023-06-22 16:35:04 +00:00
TabarakoAkula
4c401aef0f 🌐 Add Russian translation for docs/tutorial/path-operation-configuration.md (#9696)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: ivan-abc <36765187+ivan-abc@users.noreply.github.com>
Co-authored-by: Alexandr <alexandrhub@vk.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 16:33:47 +00:00
github-actions
c7dad1bb59 📝 Update release notes 2023-06-22 16:33:28 +00:00
Alexandr
0ef164e1ee 📝 Update Annotated notes in docs/en/docs/tutorial/schema-extra-example.md (#9620)
Update for docs/tutorial/schema-extra-example.md

When working on the translation, I noticed that this page is missing the annotated tips that can be found in the rest of the documentation (I checked, and it's the only page where they're missing).
2023-06-22 18:32:53 +02:00
github-actions
fd6a78cbfe 📝 Update release notes 2023-06-22 16:20:40 +00:00
lordqyxz
fa7474b2e8 🌐 Add Chinese translation for docs/zh/docs/advanced/security/index.md (#9666)
Co-authored-by: shiyz <shiyz@finchina.com>
2023-06-22 18:19:49 +02:00
github-actions
2f0541f17a 📝 Update release notes 2023-06-22 16:18:54 +00:00
雨过初晴
804a0a90cf 🌐 Add Chinese translations for docs/zh/docs/advanced/settings.md (#9652) 2023-06-22 18:18:04 +02:00
github-actions
847befdc1d 📝 Update release notes 2023-06-22 16:17:50 +00:00
雨过初晴
4a7b21483b 🌐 Add Chinese translations for docs/zh/docs/advanced/websockets.md (#9651) 2023-06-22 18:17:12 +02:00
github-actions
1182b36362 📝 Update release notes 2023-06-22 16:16:43 +00:00
吴定焕
e17cacfee4 🌐 Add Chinese translation for docs/zh/docs/tutorial/testing.md (#9641)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-22 18:16:06 +02:00
github-actions
234cecb5bf 📝 Update release notes 2023-06-22 16:14:54 +00:00
ivan-abc
612cbee165 🌐 Add Russian translation for docs/tutorial/extra-models.md (#9619)
Co-authored-by: Alexandr <alexandrhub@vk.com>
2023-06-22 18:14:16 +02:00
github-actions
223ed67682 📝 Update release notes 2023-06-22 14:30:35 +00:00
ivan-abc
a2a0119c14 🌐 Add Russian translation for docs/tutorial/cors.md (#9608)
Co-authored-by: Alexandr <alexandrhub@vk.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-06-22 16:29:56 +02:00
github-actions
09319d6271 📝 Update release notes 2023-06-22 14:29:41 +00:00
Michał Brotoń
a92e9c957a 🌐 Add Polish translation for docs/pl/docs/features.md (#5348)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 16:29:05 +02:00
github-actions
7505f24f2e 📝 Update release notes 2023-06-22 11:47:12 +00:00
Alexandr
57727fa4e0 🌐 Add Russian translation for docs/ru/docs/tutorial/body-nested-models.md (#9605)
Co-authored-by: ivan-abc <36765187+ivan-abc@users.noreply.github.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-06-22 13:46:36 +02:00
github-actions
a2aede32b4 📝 Update release notes 2023-06-22 11:43:21 +00:00
Ricardo Castro
7c66ec8a8b ✏️ Fix typo Annotation -> Annotated in docs/en/docs/tutorial/query-params-str-validations.md (#9625)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 11:42:48 +00:00
github-actions
d47eea9bb6 📝 Update release notes 2023-06-22 11:35:49 +00:00
Michał Górny
74de9a7b15 🔧 Set minimal hatchling version needed to build the package (#9240)
Set minimal hatchling version needed to build the package

Set the minimal hatchling version that is needed to build fastapi to
1.13.0.  Older versions fail to build because they do not recognize
the trove classifiers used, e.g. 1.12.2 yields:

    ValueError: Unknown classifier in field `project.classifiers`: Framework :: Pydantic

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 13:35:12 +02:00
github-actions
3279f0ba63 📝 Update release notes 2023-06-22 11:32:46 +00:00
Jacob Coffee
428376d285 📝 Add repo link to PyPI (#9559) 2023-06-22 13:32:09 +02:00
github-actions
05c5ce3689 📝 Update release notes 2023-06-22 11:26:45 +00:00
Ryan Russell
b4b39d3359 ✏️ Fix typos in data for tests (#4958)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 11:26:11 +00:00
github-actions
2f048f7199 📝 Update release notes 2023-06-22 11:20:49 +00:00
Harsha Laxman
2cef119cd7 📝 Use in memory database for testing SQL in docs (#1223)
Co-authored-by: Harsha Laxman <harsh@Harshas-MacBook-Pro.local>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-22 11:20:12 +00:00
github-actions
dd1c2018dc 📝 Update release notes 2023-06-22 10:38:27 +00:00
cyberlis
e94c13ce74 Add allow disabling redirect_slashes at the FastAPI app level (#3432)
Co-authored-by: Denis Lisovik <ckyberlis@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-22 10:37:50 +00:00
github-actions
b7ce10079e 📝 Update release notes 2023-06-19 12:34:13 +00:00
Sebastián Ramírez
87d5870314 🔧 Update sponsors, add Flint (#9699)
* 🔧 Set up sponsor Flint

* 🔧 Add configs for Flint sponsor
2023-06-19 12:33:32 +00:00
github-actions
49bc3e0873 📝 Update release notes 2023-06-16 14:49:35 +00:00
Sebastián Ramírez
8767634932 👷 Lint in CI only once, only with one version of Python, run tests with all of them (#9686) 2023-06-16 16:49:01 +02:00
Sebastián Ramírez
32935103b1 🔖 Release version 0.97.0 2023-06-12 00:50:06 +02:00
Sebastián Ramírez
395ece75aa 📝 Update release notes 2023-06-12 00:49:35 +02:00
github-actions
e958d30d1d 📝 Update release notes 2023-06-11 22:47:16 +00:00
Sebastián Ramírez
34fca99b28 ⬆️ Upgrade Black (#9661) 2023-06-11 22:46:44 +00:00
github-actions
3289796286 📝 Update release notes 2023-06-11 22:38:17 +00:00
Sebastián Ramírez
7167c77a18 ⬆️ Upgrade and fully migrate to Ruff, remove isort, includes a couple of tweaks suggested by the new version of Ruff (#9660) 2023-06-12 00:37:34 +02:00
github-actions
ba882c10fe 📝 Update release notes 2023-06-11 22:16:38 +00:00
Sebastián Ramírez
4ac55af283 ♻️ Update internal type annotations and upgrade mypy (#9658) 2023-06-11 22:16:01 +00:00
github-actions
3390a82832 📝 Update release notes 2023-06-11 22:09:33 +00:00
Sebastián Ramírez
f5844e76b5 💚 Update CI cache to fix installs when dependencies change (#9659) 2023-06-11 22:08:56 +00:00
github-actions
32cefb9bff 📝 Update release notes 2023-06-11 21:49:52 +00:00
Sebastián Ramírez
17e49bc9f7 ♻️ Simplify AsyncExitStackMiddleware as without Python 3.6 AsyncExitStack is always available (#9657)
♻️ Simplify AsyncExitStackMiddleware as without Python 3.6 AsyncExitStack is always available
2023-06-11 21:49:18 +00:00
github-actions
df58ecdee2 📝 Update release notes 2023-06-11 21:38:54 +00:00
Sebastián Ramírez
6595658324 ⬇️ Separate requirements for development into their own requirements.txt files, they shouldn't be extras (#9655) 2023-06-11 23:38:15 +02:00
github-actions
c8b729aea7 📝 Update release notes 2023-06-11 20:36:12 +00:00
Paulo Costa
d8b8f211e8 Add support for dependencies in WebSocket routes (#4534)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-11 20:35:39 +00:00
github-actions
ee96a099d8 📝 Update release notes 2023-06-11 19:08:50 +00:00
Kristján Valur Jónsson
ab03f22635 Add exception handler for WebSocketRequestValidationError (which also allows to override it) (#6030)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-11 21:08:14 +02:00
Sebastián Ramírez
f5e2dd8025 📝 Update release notes 2023-06-11 00:03:27 +02:00
Sebastián Ramírez
19347bfc3c 🔖 Release version 0.96.1 2023-06-10 23:51:40 +02:00
Sebastián Ramírez
20d93fad94 📝 Update release notes 2023-06-10 23:50:09 +02:00
github-actions
58e50622de 📝 Update release notes 2023-06-10 20:58:55 +00:00
Sebastián Ramírez
4ac8b8e443 🔧 Add sponsor Platform.sh (#9650) 2023-06-10 22:58:15 +02:00
github-actions
3d162455a7 📝 Update release notes 2023-06-10 20:49:25 +00:00
Purwo Widodo
edc939eb3a 🌐 Fix spelling in Indonesian translation of docs/id/docs/tutorial/index.md (#5635)
Co-authored-by: Purwo Widodo <id.purwowd@gmail.comm>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-10 22:48:51 +02:00
github-actions
4c64c15ead 📝 Update release notes 2023-06-10 20:37:02 +00:00
Ildar Ramazanov
e3d67a150c 🌐 Add Russian translation for docs/ru/docs/tutorial/index.md (#5896)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-10 20:36:25 +00:00
github-actions
9b14107695 📝 Update release notes 2023-06-10 20:31:03 +00:00
雨过初晴
57679e8370 🌐 Add Chinese translations for docs/zh/docs/advanced/response-change-status-code.md and docs/zh/docs/advanced/response-headers.md (#9544) 2023-06-10 22:30:28 +02:00
github-actions
6fe26b5689 📝 Update release notes 2023-06-10 20:29:47 +00:00
Alexandr
510fa5b7fe 🌐 Add Russian translation for docs/ru/docs/tutorial/schema-extra-example.md (#9621)
Co-authored-by: ivan-abc <36765187+ivan-abc@users.noreply.github.com>
2023-06-10 22:29:08 +02:00
github-actions
ca8ddb2893 📝 Update release notes 2023-06-10 17:23:47 +00:00
Sebastián Ramírez
6dd8e567cc 🐛 Fix HTTPException header type annotations (#9648) 2023-06-10 19:23:12 +02:00
github-actions
ae5c51afa6 📝 Update release notes 2023-06-10 17:06:14 +00:00
Marcelo Trylesinski
19757d1859 🔥 Remove link to Pydantic's benchmark, as it was removed there (#5811)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-10 19:05:42 +02:00
github-actions
e645a2db1b 📝 Update release notes 2023-06-10 17:05:03 +00:00
Marcelo Trylesinski
52fd0afc94 ♻ Remove media_type from ORJSONResponse as it's inherited from the parent class (#5805)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-10 19:04:29 +02:00
github-actions
503cec5649 📝 Update release notes 2023-06-10 16:03:40 +00:00
github-actions
2c7a0aca95 📝 Update release notes 2023-06-10 14:26:29 +00:00
Sebastián Ramírez
8d29e494e0 👷 Add custom tokens for GitHub Actions to avoid rate limits (#9647) 2023-06-10 16:25:54 +02:00
Sebastián Ramírez
4c23c0644b 👷 Add custom token to Smokeshow and Preview Docs for download-artifact, to prevent API rate limits (#9646) 2023-06-10 14:39:34 +02:00
github-actions
d189c38aaf 📝 Update release notes 2023-06-10 12:06:21 +00:00
Timothée Mazzucotelli
010d44ee1b ♻ Instantiate HTTPException only when needed, optimization refactor (#5356)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-10 14:05:35 +02:00
github-actions
4b31beef35 📝 Update release notes 2023-06-08 18:31:33 +00:00
Marcelo Trylesinski
61a8d6720c 📌 Update minimum version of Pydantic to >=1.7.4 (#9567) 2023-06-08 20:30:49 +02:00
github-actions
155fc5e24e 📝 Update release notes 2023-06-07 20:44:47 +00:00
Sebastián Ramírez
2d35651a5a 🐛 Fix OpenAPI model fields int validations, change gte to ge (#9635)
🐛 Fix OpenAPI model fields int validations, change `gte` to `ge`
2023-06-07 22:44:12 +02:00
Sebastián Ramírez
1574c96231 🔖 Release version 0.96.0 2023-06-03 16:29:23 +02:00
Sebastián Ramírez
99ed2a227f 📝 Update release notes 2023-06-03 16:28:37 +02:00
github-actions
6b72d54136 📝 Update release notes 2023-06-03 14:20:32 +00:00
Sergei Solomein
8474bae744 🌐 Add Russian translation for docs/tutorial/body.md (#3885)
Co-authored-by: Teregov_Ruslan <48125303+RuslanTer@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: FedorGN <66411909+FedorGN@users.noreply.github.com>
2023-06-03 14:19:58 +00:00
github-actions
4d5e40190b 📝 Update release notes 2023-06-03 14:19:04 +00:00
Alexandr
1309f67f64 🌐 Add Russian translation for docs/ru/docs/tutorial/static-files.md (#9580)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-03 14:18:30 +00:00
github-actions
b086b6580d 📝 Update release notes 2023-06-03 14:15:41 +00:00
github-actions
47c13874a0 📝 Update release notes 2023-06-03 14:06:48 +00:00
github-actions
ede2b53a0f 📝 Update release notes 2023-06-03 14:06:02 +00:00
Artem Golicyn
918d96f6ad 🌐 Add Russian translation for docs/ru/docs/tutorial/first-steps.md (#9471)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-03 14:05:53 +00:00
Alexandr
4c9ac66554 🌐 Add Russian translation for docs/ru/docs/tutorial/query-params.md (#9584)
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-03 14:05:30 +00:00
Alexandr
1f92ad349c 🌐 Add Russian translation for docs/ru/docs/tutorial/debugging.md (#9579)
Co-authored-by: ivan-abc <36765187+ivan-abc@users.noreply.github.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-06-03 14:05:22 +00:00
github-actions
8e1280bf87 📝 Update release notes 2023-06-03 14:01:51 +00:00
github-actions
5d2942f8fd 📝 Update release notes 2023-06-03 13:58:16 +00:00
github-actions
ee017fdffa 📝 Update release notes 2023-06-03 13:58:09 +00:00
github-actions
d5b588f246 📝 Update release notes 2023-06-03 13:57:42 +00:00
github-actions
1ecc9a1810 📝 Update release notes 2023-06-03 13:56:26 +00:00
github-actions
f0b4d590af 📝 Update release notes 2023-06-03 13:56:16 +00:00
github-actions
beedcd90c7 📝 Update release notes 2023-06-03 13:56:02 +00:00
github-actions
f2b0670f04 📝 Update release notes 2023-06-03 13:55:50 +00:00
github-actions
795419ceee 📝 Update release notes 2023-06-03 13:54:48 +00:00
github-actions
2c091aa0a4 📝 Update release notes 2023-06-03 13:52:14 +00:00
Sebastián Ramírez
68809d6f97 🔧 Update sponsors, remove InvestSuite (#9612) 2023-06-03 13:51:39 +00:00
github-actions
3c7a4b568c 📝 Update release notes 2023-06-03 13:38:23 +00:00
Zanie Adkins
27618aa2e8 Update create_cloned_field to use a global cache and improve startup performance (#4645)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Huon Wilson <wilson.huon@gmail.com>
2023-06-03 13:37:41 +00:00
吴定焕
d057294de1 🌐 Add Chinese translation for docs/zh/docs/tutorial/static-files.md (#9436)
Add Chinese translation for docs/zh/docs/tutorial/static-files.md
2023-06-03 14:49:32 +02:00
Andres Bermeo
7cdee0eb63 🌐 Update Spanish translation including new illustrations in docs/es/docs/async.md (#9483) 2023-06-03 14:37:15 +02:00
Lemonyte
ffb818970f ✏️ Fix typo in Deta deployment tutorial (#9501)
Fix typo (Data -> Deta)
2023-06-03 14:32:40 +02:00
Artem Golicyn
5017949010 🌐 Add Russian translation for docs/ru/docs/tutorial/path-params.md (#9519)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-06-03 14:31:44 +02:00
ivan-abc
ad77d7f926 🌐 Add Russian translation for docs/ru/docs/tutorial/path-params-numeric-validations.md (#9563)
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-06-03 14:22:10 +02:00
Vladislav Kramorenko
061e912ccf 🌐 Add Russian translation for docs/ru/docs/deployment/concepts.md (#9577)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-03 14:21:05 +02:00
Alexandr
72c72774c5 🌐 Add Russian translation for docs/ru/docs/tutorial/body-multiple-params.md (#9586)
* 🌐 Add Russian translation for docs/tutorial/body-multiple-params.md

Co-authored-by: ivan-abc <36765187+ivan-abc@users.noreply.github.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-06-03 14:13:10 +02:00
github-actions[bot]
e0961cbd1c 👥 Update FastAPI People (#9602)
Co-authored-by: github-actions <github-actions@github.com>
2023-06-03 14:09:57 +02:00
Sebastián Ramírez
8cc967a760 🔖 Release version 0.95.2 2023-05-16 15:39:43 +02:00
Sebastián Ramírez
6d235d1fe1 📝 Update release notes 2023-05-16 15:38:23 +02:00
github-actions
66259ddbb5 📝 Update release notes 2023-05-16 13:30:24 +00:00
Sebastián Ramírez
b4535abe8f ⬆️ Upgrade Starlette version to >=0.27.0 for a security release (#9541) 2023-05-16 13:29:40 +00:00
github-actions
d59c27d017 📝 Update release notes 2023-05-09 14:32:48 +00:00
Samuel Colvin
5100a98ccd 🐛 Fix flask.escape warning for internal tests (#9468)
* fix flask.escape warning

* 📝 Fix highlight in docs for WSGI

---------

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-05-09 14:32:00 +00:00
github-actions
fe55402776 📝 Update release notes 2023-05-08 21:36:55 +00:00
Sebastián Ramírez
f00f0de9ca Refactor 2 tests, for consistency and simplification (#9504)
 Refactor tests, for consistency and simplification
2023-05-08 23:36:13 +02:00
github-actions
028e7cad67 📝 Update release notes 2023-05-08 21:08:08 +00:00
Sebastián Ramírez
50c1a928fb Refactor OpenAPI tests, prepare for Pydantic v2 (#9503)
*  Refactor OpenAPI tests, move inline, prepare for Pydantic v2 tests

*  Fix test module loading for conditional OpenAPI

* 🐛 Fix missing pytest marker

*  Fix test for coverage
2023-05-08 23:07:32 +02:00
Bighneswar Parida
724060df43 📝 Update Deta deployment tutorial for compatibility with Deta Space (#6004)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lemonyte <49930425+lemonyte@users.noreply.github.com>
Co-authored-by: xeust <maxeust@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-05-08 14:32:02 +02:00
github-actions
490bde7169 📝 Update release notes 2023-05-08 11:18:04 +00:00
github-actions
3f5cfdc3fe 📝 Update release notes 2023-05-08 11:17:05 +00:00
oandersonmagalhaes
f2d01d7a6a 🌐 Add Portuguese translation for docs/pt/docs/advanced/events.md (#9326)
Co-authored-by: Fernando Crozetta <fernando@czetta.com>
Co-authored-by: Lorhan Sohaky <16273730+LorhanSohaky@users.noreply.github.com>
2023-05-08 13:16:57 +02:00
Vladislav Kramorenko
42ca1cb42d 🌐 Add Russian translation for docs/ru/docs/deployment/manually.md (#9417)
Co-authored-by: Artem Golicyn <86262613+AGolicyn@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-05-08 11:16:31 +00:00
github-actions
bdb32bfe03 📝 Update release notes 2023-05-08 11:16:10 +00:00
Saleumsack KEOBOUALAY
ed1f93f803 🌐 Add setup for translations to Lao (#9396)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-05-08 13:15:37 +02:00
github-actions
33fa1b0927 📝 Update release notes 2023-05-08 11:14:57 +00:00
Vladislav Kramorenko
928bb2e2ce 🌐 Add Russian translation for docs/ru/docs/tutorial/testing.md (#9403)
Add Russian translation for docs/ru/docs/tutorial/testing.md
2023-05-08 13:14:19 +02:00
github-actions
778b909cc1 📝 Update release notes 2023-05-08 11:11:35 +00:00
Vladislav Kramorenko
d56f02a986 🌐 Add Russian translation for docs/ru/docs/deployment/https.md (#9428)
Co-authored-by: Artem Golicyn <86262613+AGolicyn@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-05-08 13:11:00 +02:00
github-actions
60ef67a66b 📝 Update release notes 2023-05-02 06:28:23 +00:00
MariiaRomaniuk
055cf356ca ✏ Fix command to install requirements in Windows (#9445)
fix command to install requirements
2023-05-01 23:27:49 -07:00
github-actions
8ac8d70d52 📝 Update release notes 2023-04-25 19:12:33 +00:00
Axel
eb1b858c4f 🌐 Add French translation for docs/fr/docs/advanced/response-directly.md (#9415)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-04-25 12:12:00 -07:00
github-actions
0ef0aa55b0 📝 Update release notes 2023-04-25 19:08:41 +00:00
Evzen Ptacek
0e75981bd0 🌐 Initiate Czech translation setup (#9288)
Initiate Czech translation setup

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-04-25 12:08:01 -07:00
github-actions
1bc156482f 📝 Update release notes 2023-04-25 18:46:57 +00:00
Lucas Balieiro
6485c14c3b ✏ Fix typo in Portuguese docs for docs/pt/docs/index.md (#9337) 2023-04-25 11:46:17 -07:00
github-actions
bd51832394 📝 Update release notes 2023-04-25 18:45:08 +00:00
Nadezhda Fedina
da21ec92cf 🌐 Add Russian translation for docs/ru/docs/tutorial/response-status-code.md (#9370)
* Add Russian translation for docs/ru/docs/tutorial/response-status-code.md

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* Apply suggestions from code review

Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>

* Replace 'response code' with 'status code', make minor translation improvements

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-04-25 11:44:34 -07:00
github-actions
7f3e0fe8a7 📝 Update release notes 2023-04-25 18:28:42 +00:00
github-actions
bde0316227 📝 Update release notes 2023-04-25 18:27:12 +00:00
github-actions
a73570a832 📝 Update release notes 2023-04-25 18:26:51 +00:00
Sebastián Ramírez
46726aa1c4 💚 Disable setup-python pip cache in CI (#9438) 2023-04-25 18:26:32 +00:00
dependabot[bot]
a3d881ab67 ⬆ Bump pypa/gh-action-pypi-publish from 1.6.4 to 1.8.5 (#9346)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.6.4 to 1.8.5.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.6.4...v1.8.5)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-25 11:26:11 -07:00
dependabot[bot]
07f691ba4b ⬆ Bump dawidd6/action-download-artifact from 2.26.0 to 2.27.0 (#9394)
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 2.26.0 to 2.27.0.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v2.26.0...v2.27.0)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-25 11:25:28 -07:00
Sebastián Ramírez
c81e136d75 🔖 Release version 0.95.1 2023-04-13 12:04:52 -07:00
Sebastián Ramírez
79846b2d2b 📝 Update release notes 2023-04-13 12:04:11 -07:00
github-actions
1ccc5a862b 📝 Update release notes 2023-04-13 18:58:35 +00:00
Geoff Dworkin
8df86309c8 📝 Add notification message warning about old versions of FastAPI not supporting Annotated (#9298)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-04-13 18:57:59 +00:00
github-actions
925ba5c652 📝 Update release notes 2023-04-13 18:44:47 +00:00
Leonardo Marinho de Melo Júnior
1bb998d516 📝 Fix typo in docs/en/docs/advanced/behind-a-proxy.md (#5681)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-04-13 18:44:09 +00:00
github-actions
89fd635925 📝 Update release notes 2023-04-13 18:38:01 +00:00
Kimiaattaei
9f13595247 ✏ Fix wrong import from typing module in Persian translations for docs/fa/docs/index.md (#6083) 2023-04-13 11:37:23 -07:00
github-actions
bf9bb08b28 📝 Update release notes 2023-04-13 18:34:43 +00:00
Armen Gabrielyan
75f59c46d5 ✏️ Fix format, remove unnecessary asterisks in docs/en/docs/help-fastapi.md (#9249)
✏️ Remove unnecessary asterisks from help doc
2023-04-13 11:34:04 -07:00
github-actions
fe975b0031 📝 Update release notes 2023-04-13 18:33:37 +00:00
Nicolas Renkamp
c21e3371b8 ✏ Fix typo in docs/en/docs/tutorial/query-params-str-validations.md (#9272) 2023-04-13 11:33:03 -07:00
github-actions
acd4c11282 📝 Update release notes 2023-04-13 18:30:56 +00:00
tim-habitat
08ba3a98a3 ✏ Fix typo/bug in inline code example in docs/en/docs/tutorial/query-params-str-validations.md (#9273) 2023-04-13 11:30:21 -07:00
github-actions
0cc8e9cf31 📝 Update release notes 2023-04-13 18:29:28 +00:00
Aadarsha Shrestha
8ca7c5c29d ✏ Fix typo in docs/en/docs/tutorial/path-params-numeric-validations.md (#9282) 2023-04-13 11:28:52 -07:00
github-actions
cd6150806f 📝 Update release notes 2023-04-13 18:21:50 +00:00
dasstyxx
571b5c6f0c ✏ Fix typo: 'wll' to 'will' in docs/en/docs/tutorial/query-params-str-validations.md (#9380) 2023-04-13 11:21:17 -07:00
github-actions
c1f41fc5fe 📝 Update release notes 2023-04-13 18:18:19 +00:00
github-actions
6e129dbaaf 📝 Update release notes 2023-04-13 18:17:46 +00:00
Axel
da2f365db4 🌐 Add French translation for docs/fr/docs/advanced/index.md (#5673)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-04-13 18:17:42 +00:00
Sebastián Ramírez
dfe58433c0 🔧 Update sponsors: remove Jina (#9388)
🔧 Remove Jina sponsor
2023-04-13 11:17:05 -07:00
github-actions
1267736d9f 📝 Update release notes 2023-04-13 18:16:07 +00:00
Luccas Mateus
7048ecfa7b 🌐 Add Portuguese translation for docs/pt/docs/tutorial/body-nested-models.md (#4053)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2023-04-13 11:15:34 -07:00
github-actions
d1f1425392 📝 Update release notes 2023-04-13 18:13:26 +00:00
github-actions
d824a5ca9b 📝 Update release notes 2023-04-13 18:12:59 +00:00
Vladislav Kramorenko
723d47403b 🌐 Add Russian translation for docs/ru/docs/alternatives.md (#5994)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-04-13 18:12:48 +00:00
Lorhan Sohaky
d455f3f868 🌐 Add Portuguese translation for docs/pt/docs/tutorial/extra-models.md (#5912)
Co-authored-by: Fábio Ueno <fabio.t.ueno@gmail.com>
2023-04-13 11:12:25 -07:00
github-actions
4b9e9e40b5 📝 Update release notes 2023-04-13 18:07:18 +00:00
Lorhan Sohaky
fa103cf1fd 🌐 Add Portuguese translation for docs/pt/docs/tutorial/path-operation-configuration.md (#5936)
Co-authored-by: Fábio Ueno <fabio.t.ueno@gmail.com>
2023-04-13 11:06:27 -07:00
github-actions
c6be4c6d65 📝 Update release notes 2023-04-13 18:05:11 +00:00
Aleksandr Egorov
0ab88cd1a9 🌐 Add Russian translation for docs/ru/docs/contributing.md (#6002)
Co-authored-by: stigsanek <alexander.e.egorov@pikta.ru>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2023-04-13 11:04:30 -07:00
github-actions
9bdb8cc45a 📝 Update release notes 2023-04-13 18:03:28 +00:00
Sehwan Park
48afd32ac8 🌐 Add Korean translation for docs/tutorial/dependencies/classes-as-dependencies.md (#9176)
Co-authored-by: Nina Hwang <79563565+NinaHwang@users.noreply.github.com>
Co-authored-by: Joona Yoon <joonas-yoon@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-13 11:02:52 -07:00
github-actions
48e9d87e7e 📝 Update release notes 2023-04-13 18:01:31 +00:00
Vladislav Kramorenko
dafce52bc7 🌐 Add Russian translation for docs/ru/docs/project-generation.md (#9243) 2023-04-13 11:00:47 -07:00
github-actions
d82809d90d 📝 Update release notes 2023-04-13 18:00:28 +00:00
Cedric Fraboulet
1ae5466140 🌐 Add French translation for docs/fr/docs/index.md (#9265)
* docs(index): copy the new index.md from docs/en

* docs(index): add translation for docs/index.md

* Apply rjNemo's suggestions

* Apply Viicos's suggestions
2023-04-13 10:59:44 -07:00
github-actions
c4128e7f5a 📝 Update release notes 2023-04-13 17:58:46 +00:00
dedkot
6bc0d210da 🌐 Add Russian translation for docs/ru/docs/tutorial/query-params-str-validations.md (#9267)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-13 10:58:09 -07:00
github-actions
08f049208e 📝 Update release notes 2023-04-13 17:52:45 +00:00
Vladislav Kramorenko
221b22200a 🌐 Add Russian translation for docs/ru/docs/benchmarks.md (#9271)
* del docs/ru/docs/contributing.md

* ru translate for */docs/ru/docs/project-generation.md

* docs/ru/docs/benchmarks.md

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* Delete project-generation.md

* Update benchmarks.md

* Update benchmarks.md

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-04-13 10:52:11 -07:00
github-actions
3eac0a4a87 📝 Update release notes 2023-04-13 17:49:59 +00:00
Sharon Yogev
fdf66c825e 🐛 Fix using Annotated in routers or path operations decorated multiple times (#9315)
* Fix: copy FieldInfo from Annotated arguments

We need to copy the field_info to prevent ourselves from
mutating it.  This allows multiple path or nested routers ,etc.

* 📝 Add comment in fastapi/dependencies/utils.py

Co-authored-by: Nadav Zingerman <7372858+nzig@users.noreply.github.com>

*  Extend and tweak tests for Annotated

*  Tweak coverage, it's probably covered by a different version of Python

---------

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Nadav Zingerman <7372858+nzig@users.noreply.github.com>
2023-04-13 10:49:22 -07:00
github-actions
6ce6c8954c 📝 Update release notes 2023-04-10 18:28:00 +00:00
github-actions
ac4bf3b5eb 📝 Update release notes 2023-04-10 18:16:44 +00:00
Sebastián Ramírez
6ab811763f 🔧 Update sponsors, add databento, remove Ines's course and StriveWorks (#9351) 2023-04-05 17:09:04 +02:00
LeeeeT
d4e85da18b 🌐 🔠 📄 🐢 Translate docs to Emoji 🥳 🎉 💥 🤯 🤯 (#5385)
* 🌐 💬  🩺  🦲

* 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks

* 🛠️😊

* ♻️ Rename emoji lang from emj to em, and main docs name as 😉

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Axd1x8a <26704473+FeeeeK@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-04-01 11:26:04 +02:00
Sebastián Ramírez
d666ccb622 🔖 Release version 0.95.0 2023-03-18 20:37:42 +01:00
Sebastián Ramírez
38f0cad517 📝 Tweak release notes 2023-03-18 20:37:20 +01:00
Sebastián Ramírez
bd90bed02a 📝 Update release notes 2023-03-18 20:24:12 +01:00
github-actions
546392db98 📝 Update release notes 2023-03-18 19:08:30 +00:00
Sebastián Ramírez
0bc87ec77c 📝 Tweak tip recommending Annotated in docs (#9270)
📝 Tweak tip recommending Annotated
2023-03-18 19:07:53 +00:00
Sebastián Ramírez
fbfd53542e 📝 Update release notes 2023-03-18 19:46:47 +01:00
github-actions
994ea1ad33 📝 Update release notes 2023-03-18 16:16:37 +00:00
Sebastián Ramírez
69673548bc 📝 Update order of examples, latest Python version first, and simplify version tab names (#9269)
* 📝 Simplify names in Python versions in tabs in docs

* 📝 Update docs for Types Intro, explain Python 3.6+, Python 3.9+, Python 3.10+

* 📝 Re-order all Python examples, show latest Python versions first
2023-03-18 17:16:02 +01:00
github-actions
166d348ea6 📝 Update release notes 2023-03-18 12:30:38 +00:00
Sebastián Ramírez
9eaed2eb37 📝 Update all docs to use Annotated as the main recommendation, with new examples and tests (#9268)
* 🍱 Add new source examples with Annotated for Query Params and String Validations

* 📝 Add new docs with Annotated for Query Params and String Validations

* 🚚 Rename incorrectly named tests for Query Params and str validations

*  Add new tests with Annotated for Query Params and Sring Validations examples

* 🍱 Add new examples with Annotated for Intro to Python Types

* 📝 Update Python Types Intro, include Annotated

* 🎨 Fix formatting in Query params and string validation, and highlight

* 🍱 Add new Annotated source examples for Path Params and Numeric Validations

* 📝 Update docs for Path Params and Numeric Validations with Annotated

* 🍱 Add new source examples with Annotated for Body - Multiple Params

* 📝 Update docs with Annotated for Body - Multiple Parameters

*  Add test for new Annotated examples in Body - Multiple Parameters

* 🍱 Add new Annotated source examples for Body Fields

* 📝 Update docs for Body Fields with new Annotated examples

*  Add new tests for new Annotated examples for Body Fields

* 🍱 Add new Annotated source examples for Schema Extra (Example Data)

* 📝 Update docs for Schema Extra with Annotated

*  Add tests for new Annotated examples for Schema Extra

* 🍱 Add new Annnotated source examples for Extra Data Types

* 📝 Update docs with Annotated for Extra Data Types

*  Add tests for new Annotated examples for Extra Data Types

* 🍱 Add new Annotated source examples for Cookie Parameters

* 📝 Update docs for Cookie Parameters with Annotated examples

*  Add tests for new Annotated source examples in Cookie Parameters

* 🍱 Add new Annotated examples for Header Params

* 📝 Update docs with Annotated examples for Header Parameters

*  Add tests for new Annotated examples for Header Params

* 🍱 Add new Annotated examples for Form Data

* 📝 Update Annotated docs for Form Data

*  Add tests for new Annotated examples in Form Data

* 🍱 Add new Annotated source examples for Request Files

* 📝 Update Annotated docs for Request Files

*  Test new Annotated examples for Request Files

* 🍱 Add new Annotated source examples for Request Forms and Files

*  Add tests for new Anotated examples for Request Forms and Files

* 🍱 Add new Annotated source examples for Dependencies and Advanced Dependencies

*  Add tests for new Annotated dependencies

* 📝 Add new docs for using Annotated with dependencies including type aliases

* 📝 Update docs for Classes as Dependencies with Annotated

* 📝 Update docs for Sub-dependencies with Annotated

* 📝 Update docs for Dependencies in path operation decorators with Annotated

* 📝 Update docs for Global Dependencies with Annotated

* 📝 Update docs for Dependencies with yield with Annotated

* 🎨 Update format in example for dependencies with Annotated

* 🍱 Add source examples with Annotated for Security

*  Add tests for new Annotated examples for security

* 📝 Update docs for Security - First Steps with Annotated

* 📝 Update docs for Security: Get Current User with Annotated

* 📝 Update docs for Simple OAuth2 with Password and Bearer with Annotated

* 📝 Update docs for OAuth2 with Password (and hashing), Bearer with JWT tokens with Annotated

* 📝 Update docs for Request Forms and Files with Annotated

* 🍱 Add new source examples for Bigger Applications with Annotated

*  Add new tests for Bigger Applications with Annotated

* 📝 Update docs for Bigger Applications - Multiple Files with Annotated

* 🍱 Add source examples for background tasks with Annotated

* 📝 Update docs for Background Tasks with Annotated

*  Add test for Background Tasks with Anotated

* 🍱 Add new source examples for docs for Testing with Annotated

* 📝 Update docs for Testing with Annotated

*  Add tests for Annotated examples for Testing

* 🍱 Add new source examples for Additional Status Codes with Annotated

*  Add tests for new Annotated examples for Additional Status Codes

* 📝 Update docs for Additional Status Codes with Annotated

* 📝 Update docs for Advanced Dependencies with Annotated

* 📝 Update docs for OAuth2 scopes with Annotated

* 📝 Update docs for HTTP Basic Auth with Annotated

* 🍱 Add source examples with Annotated for WebSockets

*  Add tests for new Annotated examples for WebSockets

* 📝 Update docs for WebSockets with new Annotated examples

* 🍱 Add source examples with Annotated for Settings and Environment Variables

* 📝 Update docs for Settings and Environment Variables with Annotated

* 🍱 Add new source examples for testing dependencies with Annotated

*  Add tests for new examples for testing dependencies

* 📝 Update docs for testing dependencies with new Annotated examples

*  Update and fix marker for Python 3.9 test

* 🔧 Update Ruff ignores for source examples in docs

*  Fix some tests in the grid for Python 3.9 (incorrectly testing 3.10)

* 🔥 Remove source examples and tests for (non existent) docs section about Annotated, as it's covered in all the rest of the docs
2023-03-18 13:29:59 +01:00
github-actions
f63b3ad53e 📝 Update release notes 2023-03-17 20:36:26 +00:00
Nadav Zingerman
375513f114 Add support for PEP-593 Annotated for specifying dependencies and parameters (#4871)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-17 21:35:45 +01:00
Sebastián Ramírez
ef176c6631 🔖 Release version 0.94.1 2023-03-14 03:27:11 +01:00
github-actions
7b7e86a307 📝 Update release notes 2023-03-14 02:19:50 +00:00
Sebastián Ramírez
25aabe05ce 🎨 Fix types for lifespan, upgrade Starlette to 0.26.1 (#9245) 2023-03-14 03:19:04 +01:00
Sebastián Ramírez
392ffaae43 🔖 Release version 0.94.0 2023-03-10 20:00:49 +01:00
Sebastián Ramírez
202ee0497a 📝 Update release notes 2023-03-10 20:00:09 +01:00
github-actions
321e873c95 📝 Update release notes 2023-03-10 18:57:58 +00:00
github-actions
4860631468 📝 Update release notes 2023-03-10 18:57:42 +00:00
dependabot[bot]
8e4c96c703 ⬆ Bump black from 22.10.0 to 23.1.0 (#5953)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-10 19:57:21 +01:00
dependabot[bot]
39813aa9b0 ⬆ Bump types-ujson from 5.6.0.0 to 5.7.0.1 (#6027)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-10 19:57:07 +01:00
github-actions
3e3278ed3f 📝 Update release notes 2023-03-10 18:51:19 +00:00
dependabot[bot]
c8a07078cf ⬆ Bump dawidd6/action-download-artifact from 2.24.3 to 2.26.0 (#6034)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-10 19:50:08 +01:00
github-actions
59f91db1d2 📝 Update release notes 2023-03-10 18:49:54 +00:00
pre-commit-ci[bot]
f04b61bd16 ⬆ [pre-commit.ci] pre-commit autoupdate (#5709)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-10 19:49:18 +01:00
github-actions
253d58bc5c 📝 Update release notes 2023-03-10 18:48:20 +00:00
Yasser Tahiri
78b8a9b6ec Add pydantic to PyPI classifiers (#5914) 2023-03-10 19:47:38 +01:00
github-actions
c26db94a90 📝 Update release notes 2023-03-10 18:43:10 +00:00
Vladislav Kramorenko
d1f3753e5e 🌐 Add Russian translation for docs/ru/docs/history-design-future.md (#5986) 2023-03-10 19:42:25 +01:00
github-actions
d5b0cc9f58 📝 Update release notes 2023-03-10 18:32:12 +00:00
Ben Beasley
42daed222e ⬆ Upgrade python-multipart to support 0.0.6 (#9212) 2023-03-10 19:31:36 +01:00
github-actions
fd3bfe9f50 📝 Update release notes 2023-03-10 18:27:50 +00:00
Steven Eubank
1fea9c5626 📝 Update Sentry link in docs (#9218) 2023-03-10 19:27:10 +01:00
github-actions
d783463ebd 📝 Update release notes 2023-03-10 18:24:42 +00:00
Sebastián Ramírez
8a4cfa52af ⬆️ Upgrade Starlette version, support new lifespan with state (#9239) 2023-03-10 19:24:04 +01:00
Sebastián Ramírez
25382d2d19 🔖 Release version 0.93.0 2023-03-07 17:06:47 +01:00
Sebastián Ramírez
b9bb441b23 📝 Update release notes 2023-03-07 17:04:40 +01:00
github-actions
e33f30a607 📝 Update release notes 2023-03-07 15:46:37 +00:00
Jordan Speicher
cc9a73c3f8 Add support for lifespan async context managers (superseding startup and shutdown events) (#2944)
Co-authored-by: Mike Shantz <mshantz@coldstorage.com>
Co-authored-by: Jonathan Plasse <13716151+JonathanPlasse@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-07 16:46:00 +01:00
github-actions
66e03c816b 📝 Update release notes 2023-03-06 19:32:19 +00:00
gusty1g
639cf3440a 🌐 Tamil translations - initial setup (#5564)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-06 20:31:37 +01:00
github-actions
2f1b856fe6 📝 Update release notes 2023-03-06 16:29:17 +00:00
Axel
31e148ba8e 🌐 Add French translation for docs/fr/docs/advanced/path-operation-advanced-configuration.md (#9221)
Co-authored-by: Julian Maurin <julian.maurin.perso@pm.me>
Co-authored-by: Cedric Fraboulet <62244267+frabc@users.noreply.github.com>
2023-03-06 17:28:40 +01:00
github-actions
40c2c44ff9 📝 Update release notes 2023-03-06 16:27:29 +00:00
Cedric Fraboulet
c5f72f02cd 🌐 Add French translation for docs/tutorial/debugging.md (#9175) 2023-03-06 17:26:49 +01:00
github-actions
9b83a00c40 📝 Update release notes 2023-03-04 12:52:10 +00:00
har8
83012a9cf6 🌐 Initiate Armenian translation setup (#5844)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-04 12:51:37 +00:00
github-actions
8625189351 📝 Update release notes 2023-03-04 12:43:32 +00:00
eykamp
e570371003 ✏ Fix formatting in docs/en/docs/tutorial/metadata.md for ReDoc (#6005) 2023-03-04 13:42:55 +01:00
Aayush Chhabra
4d099250f6 ✏ Fix typo in docs/en/docs/tutorial/bigger-applications.md, "codes" to "code" (#5990)
Typo in docs: it should be code instead of codes
2023-03-04 13:17:21 +01:00
github-actions
9ef46a2299 📝 Update release notes 2023-03-04 12:02:42 +00:00
Ruidy
30a9d68232 🌐 Add French translation for deployment/manually.md (#3693)
Co-authored-by: Sam Courtemanche <smlep.pro@gmail.com>
Co-authored-by: Ruidy <r.nemausat@empfohlen.de>
Co-authored-by: Ruidy <rnemausat@newstore.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-03-04 12:02:09 +00:00
github-actions
03bb7c166c 📝 Update release notes 2023-03-04 11:45:13 +00:00
Sebastián Ramírez
c5f343a4fd 👷 Update translation bot messages (#9206) 2023-03-04 11:44:30 +00:00
github-actions
83050bead6 📝 Update release notes 2023-03-04 10:40:08 +00:00
Sebastián Ramírez
bd219c2bbf 👷 Update translations bot to use Discussions, and notify when a PR is done (#9183) 2023-03-04 11:39:28 +01:00
github-actions
4b95025d44 📝 Update release notes 2023-03-04 07:35:11 +00:00
Sebastián Ramírez
ff64772dd1 🔧 Update sponsors-badges (#9182) 2023-03-04 07:34:39 +00:00
github-actions
e8fd74e737 📝 Update release notes 2023-03-04 07:30:07 +00:00
github-actions[bot]
87842ac0db 👥 Update FastAPI People (#9181)
Co-authored-by: github-actions <github-actions@github.com>
2023-03-04 08:29:30 +01:00
github-actions
7674da89d3 📝 Update release notes 2023-03-02 15:11:54 +00:00
Sebastián Ramírez
e9326de161 🔊 Log GraphQL errors in FastAPI People, because it returns 200, with a payload with an error (#9171) 2023-03-02 15:11:17 +00:00
github-actions
97effae92d 📝 Update release notes 2023-03-02 13:07:40 +00:00
Sebastián Ramírez
a8bde44029 💚 Fix/workaround GitHub Actions in Docker with git for FastAPI People (#9169) 2023-03-02 13:06:57 +00:00
github-actions
be54d44b0c 📝 Update release notes 2023-03-01 13:22:41 +00:00
Sebastián Ramírez
35d93d59d8 ♻️ Refactor FastAPI Experts to use only discussions now that questions are migrated (#9165) 2023-03-01 13:22:00 +00:00
github-actions
7b3727e03e 📝 Update release notes 2023-02-21 10:24:13 +00:00
Sebastián Ramírez
a270ab0c3f ⬆️ Upgrade analytics (#6025) 2023-02-21 11:23:37 +01:00
github-actions
f6f39d8714 📝 Update release notes 2023-02-16 18:51:02 +00:00
Sebastián Ramírez
4f4035262c ⬆️ Upgrade and re-enable installing Typer-CLI (#6008) 2023-02-16 18:50:21 +00:00
Sebastián Ramírez
6879082b36 🔖 Release version 0.92.0 2023-02-14 10:17:53 +01:00
Sebastián Ramírez
52ca6cb95b 📝 Update release notes 2023-02-14 10:17:08 +01:00
github-actions
9e283ef66b 📝 Update release notes 2023-02-14 09:13:56 +00:00
Sebastián Ramírez
75e7e9e0a2 ⬆️ Upgrade Starlette to 0.25.0 (#5996) 2023-02-14 09:13:22 +00:00
Sebastián Ramírez
2ca77f9a4d 🔖 Release version 0.91.0 2023-02-10 15:33:25 +01:00
Sebastián Ramírez
3c05189b06 📝 Update release notes 2023-02-10 15:32:23 +01:00
github-actions
a04acf6900 📝 Update release notes 2023-02-10 14:13:57 +00:00
Sebastián Ramírez
d566c6cbca ⬆️ Upgrade Starlette version to 0.24.0 and refactor internals for compatibility (#5985) 2023-02-10 15:13:04 +01:00
Sebastián Ramírez
6e94ec2bf0 🔖 Release version 0.90.1 2023-02-09 20:41:40 +01:00
Sebastián Ramírez
e85c109bcd 📝 Update release notes 2023-02-09 20:40:53 +01:00
github-actions
445e611a29 📝 Update release notes 2023-02-09 19:37:21 +00:00
Jakepys
392766bcfa ✏ Update zip-docs.sh internal script, remove extra space (#5931) 2023-02-09 20:36:46 +01:00
github-actions
5ed70f285b 📝 Update release notes 2023-02-09 19:35:40 +00:00
Chandra Deb
d6fb9429d2 ✏ Tweak wording to clarify docs/en/docs/project-generation.md (#5930) 2023-02-09 20:35:01 +01:00
github-actions
9a5147382e 📝 Update release notes 2023-02-09 19:29:30 +00:00
Yasser Tahiri
99deead7fc ✏ Update Pydantic GitHub URLs (#5952) 2023-02-09 20:28:54 +01:00
github-actions
18e6c3ff6a 📝 Update release notes 2023-02-09 19:27:57 +00:00
Igor Shevchenko
3c5536a780 🌐 Add Russian translation for docs/ru/docs/tutorial/cookie-params.md (#5890) 2023-02-09 20:27:16 +01:00
github-actions
79eed9d7d9 📝 Update release notes 2023-02-09 18:58:23 +00:00
Sebastián Ramírez
e37d504e27 📝 Add opinion from Cisco (#5981) 2023-02-09 18:57:49 +00:00
github-actions
70688eb7b2 📝 Update release notes 2023-02-09 18:47:16 +00:00
Sebastián Ramírez
16599b7356 ⬆️ Upgrade Starlette range to allow 0.23.1 (#5980) 2023-02-09 18:46:38 +00:00
Sebastián Ramírez
148bcf5ce4 🔖 Release version 0.90.0 2023-02-08 11:30:01 +01:00
Sebastián Ramírez
e4c8df062b 📝 Update release notes 2023-02-08 11:28:55 +01:00
github-actions
b313f86338 📝 Update release notes 2023-02-08 10:23:46 +00:00
Marcelo Trylesinski
9293795e99 ⬆️ Bump Starlette from 0.22.0 to 0.23.0 (#5739)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-02-08 11:23:07 +01:00
github-actions
58757f63af 📝 Update release notes 2023-02-07 16:51:06 +00:00
Leon
88dc4ce3d7 📝 Add article "Tortoise ORM / FastAPI 整合快速筆記" to External Links (#5496)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-02-07 16:50:02 +00:00
github-actions
c9d3656a6e 📝 Update release notes 2023-02-07 16:46:40 +00:00
Sebastián Ramírez
3e4840f21b ⬆️ Upgrade Ubuntu version for docs workflow (#5971) 2023-02-07 16:46:03 +00:00
github-actions
9cb2586499 📝 Update release notes 2023-02-07 13:33:51 +00:00
Alexander Sviridov
8b62319d6c 🌐 Add Russian translation for docs/ru/docs/tutorial/body-fields.md (#5898) 2023-02-07 14:33:16 +01:00
github-actions
6e3c707c60 📝 Update release notes 2023-02-07 13:28:45 +00:00
Sebastián Ramírez
94fa151881 🌐 Add Russian translation for docs/ru/docs/help-fastapi.md (#5970)
Co-authored-by: Xewus <xewuss@yandex.ru>
Co-authored-by: Vladislav Kramorenko <85196001+Xewus@users.noreply.github.com>
2023-02-07 13:28:10 +00:00
github-actions
a4f3bc5a69 📝 Update release notes 2023-02-07 13:10:13 +00:00
github-actions
05342cc264 📝 Update release notes 2023-02-07 13:09:45 +00:00
Bruno Artur Torres Lopes Pereira
8115282ed3 🌐 Add Portuguese translation for docs/pt/docs/tutorial/static-files.md (#5858)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-07 14:09:32 +01:00
felipebpl
9ad2cb29f9 🌐 Add Portuguese translation for docs/pt/docs/tutorial/encoder.md (#5525)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-02-07 13:09:00 +00:00
github-actions
23d0efa894 📝 Update release notes 2023-02-07 13:05:18 +00:00
Vladislav Kramorenko
e1129af819 🌐 Add Russian translation for docs/ru/docs/contributing.md (#5870)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-02-07 14:04:38 +01:00
github-actions
c59539913d 📝 Update release notes 2023-02-03 17:56:25 +00:00
github-actions[bot]
7a64587d7f 👥 Update FastAPI People (#5954)
Co-authored-by: github-actions <github-actions@github.com>
2023-02-03 18:55:25 +01:00
github-actions
62fc0b4923 📝 Update release notes 2023-02-03 17:55:03 +00:00
Sebastián Ramírez
fc7da62005 📝 Micro-tweak help docs (#5960) 2023-02-03 17:54:22 +00:00
github-actions
40df42f5c7 📝 Update release notes 2023-01-31 14:03:27 +00:00
Sebastián Ramírez
0b0af37b0e 🔧 Update new issue chooser to direct to GitHub Discussions (#5948) 2023-01-31 14:02:52 +00:00
github-actions
73920366e5 📝 Update release notes 2023-01-30 16:50:10 +00:00
Sebastián Ramírez
682067cab2 📝 Recommend GitHub Discussions for questions (#5944) 2023-01-30 16:49:32 +00:00
github-actions
ca30b92dd7 📝 Update release notes 2023-01-30 16:24:22 +00:00
Sebastián Ramírez
72b542d90a 🔧 Update sponsors badges (#5943) 2023-01-30 16:23:43 +00:00
github-actions
9012ab8bcd 📝 Update release notes 2023-01-30 15:16:30 +00:00
Sebastián Ramírez
9530defba8 Compute FastAPI Experts including GitHub Discussions (#5941) 2023-01-30 15:15:56 +00:00
github-actions
7c23bbd96f 📝 Update release notes 2023-01-30 15:10:29 +00:00
Sebastián Ramírez
11b6c0146d ⬆️ Upgrade isort and update pre-commit (#5940) 2023-01-30 16:09:51 +01:00
github-actions
4e29835609 📝 Update release notes 2023-01-24 14:30:38 +00:00
Sebastián Ramírez
9858577cd6 🔧 Add template for questions in Discussions (#5920) 2023-01-24 18:30:03 +04:00
github-actions
cd1ee83435 📝 Update release notes 2023-01-23 14:24:31 +00:00
Sebastián Ramírez
fe74890b4b 🔧 Update Sponsor Budget Insight to Powens (#5916) 2023-01-23 14:23:53 +00:00
github-actions
97a2ebc219 📝 Update release notes 2023-01-23 14:13:39 +00:00
Sebastián Ramírez
805226c2b0 🔧 Update GitHub Sponsors badge data (#5915) 2023-01-23 14:13:03 +00:00
Sebastián Ramírez
5905c3f740 🔖 Release version 0.89.1 2023-01-10 20:31:23 +04:00
Sebastián Ramírez
00f3c831f3 📝 Update release notes 2023-01-10 20:30:10 +04:00
github-actions
e84cb6663e 📝 Update release notes 2023-01-10 16:23:24 +00:00
Sebastián Ramírez
fb8e9083f4 📝 Update docs and examples for Response Model with Return Type Annotations, and update runtime error (#5873) 2023-01-10 16:22:47 +00:00
github-actions
6b83525ff4 📝 Update release notes 2023-01-10 12:46:04 +00:00
Marcelo Trylesinski
fba7493042 🐛 Ignore Response classes on return annotation (#5855)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-10 12:45:18 +00:00
github-actions
53973f7f94 📝 Update release notes 2023-01-10 12:38:39 +00:00
Kader M
1562592bde 🌐 Add Turkish translation for docs/tr/docs/tutorial/first_steps.md (#5691)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-10 12:38:01 +00:00
github-actions
52a84175c1 📝 Update release notes 2023-01-10 12:34:24 +00:00
Raf Rasenberg
929289b630 📝 Add External Link: FastAPI lambda container: serverless simplified (#5784)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-10 16:33:36 +04:00
Sebastián Ramírez
69bd7d8501 🔖 Release version 0.89.0 2023-01-07 21:17:10 +04:00
Sebastián Ramírez
a6af7c27f8 📝 Update release notes 2023-01-07 21:15:11 +04:00
github-actions
aa6a8e5d49 📝 Update release notes 2023-01-07 17:05:20 +00:00
dependabot[bot]
c482dd3d42 ⬆ Update coverage[toml] requirement from <7.0,>=6.5.0 to >=6.5.0,<8.0 (#5801)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 17:04:43 +00:00
github-actions
681e5c0199 📝 Update release notes 2023-01-07 17:02:15 +00:00
github-actions
eb39b0f8f8 📝 Update release notes 2023-01-07 17:01:58 +00:00
Xhy-5000
27ce2e2108 📝 Add External Link: Authorization on FastAPI with Casbin (#5712)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 21:01:38 +04:00
dependabot[bot]
f56b0d571d ⬆ Update uvicorn[standard] requirement from <0.19.0,>=0.12.0 to >=0.12.0,<0.21.0 for development (#5795)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 17:01:21 +00:00
github-actions
5c6d7b2ff3 📝 Update release notes 2023-01-07 16:57:45 +00:00
Nonso Mgbechi
78813a543d ✏ Fix typo in docs/en/docs/async.md (#5785)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 20:56:58 +04:00
github-actions
903e3be3b8 📝 Update release notes 2023-01-07 16:56:07 +00:00
dependabot[bot]
a17da3d0f4 ⬆ Bump dawidd6/action-download-artifact from 2.24.2 to 2.24.3 (#5842)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 20:55:29 +04:00
github-actions
d202598c71 📝 Update release notes 2023-01-07 15:35:51 +00:00
github-actions[bot]
2dfdcea69a 👥 Update FastAPI People (#5825)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 15:35:14 +00:00
github-actions
789d649fba 📝 Update release notes 2023-01-07 15:31:38 +00:00
Kelby Faessler
bea1fdd2eb ✏ Fix typo in docs/en/docs/deployment/concepts.md (#5824) 2023-01-07 19:31:03 +04:00
github-actions
929c700117 📝 Update release notes 2023-01-07 15:13:27 +00:00
dependabot[bot]
f4e895bc8a ⬆ Bump types-ujson from 5.5.0 to 5.6.0.0 (#5735)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 15:12:49 +00:00
github-actions
adef9f4c02 📝 Update release notes 2023-01-07 15:08:57 +00:00
dependabot[bot]
6e1152d31f ⬆ Bump pypa/gh-action-pypi-publish from 1.5.2 to 1.6.4 (#5750)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 15:08:12 +00:00
github-actions
9812116dc7 📝 Update release notes 2023-01-07 14:55:35 +00:00
Sviatoslav Sydorenko
2583a83f9d 👷 Add GitHub Action gate/check (#5492) 2023-01-07 18:54:59 +04:00
github-actions
59d654672f 📝 Update release notes 2023-01-07 14:46:09 +00:00
Vladislav Kramorenko
d0027de64f 🌐 Add Russian translation for docs/ru/docs/fastapi-people.md (#5577)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 18:45:32 +04:00
github-actions
3c20b6e42b 📝 Update release notes 2023-01-07 14:34:13 +00:00
Ben Ho
3178c17776 🌐 Fix typo in Chinese translation for docs/zh/docs/benchmarks.md (#4269)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 14:33:29 +00:00
github-actions
1be95ba02d 📝 Update release notes 2023-01-07 14:21:59 +00:00
Nina Hwang
2a3a786dd7 🌐 Add Korean translation for docs/tutorial/cors.md (#3764)
Co-authored-by: weekwith.me <63915557+0417taehyun@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-07 18:21:23 +04:00
github-actions
a3edc76051 📝 Update release notes 2023-01-07 14:14:07 +00:00
Sebastián Ramírez
d70eef825e 🔧 Update sponsors, add Svix (#5848) 2023-01-07 14:13:34 +00:00
github-actions
679aee85ce 📝 Update release notes 2023-01-07 13:59:26 +00:00
Sebastián Ramírez
cb35e275e3 🔧 Remove Doist sponsor (#5847) 2023-01-07 13:58:46 +00:00
github-actions
18d087f9c6 📝 Update release notes 2023-01-07 13:46:24 +00:00
Yurii Karabas
d0573f5713 Add support for function return type annotations to declare the response_model (#1436)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2023-01-07 17:45:48 +04:00
github-actions
efc12c5cdb 📝 Update release notes 2022-12-16 20:25:51 +00:00
dependabot[bot]
4d5cbc71ac ⬆ Update sqlalchemy requirement from <=1.4.41,>=1.3.18 to >=1.3.18,<1.4.43 (#5540)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-12-16 23:41:48 +04:00
github-actions
10500dbc03 📝 Update release notes 2022-12-16 19:11:14 +00:00
dependabot[bot]
63ad0ed4a6 ⬆ Bump nwtgck/actions-netlify from 1.2.4 to 2.0.0 (#5757)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-16 23:10:29 +04:00
github-actions
dc9fb1305a 📝 Update release notes 2022-12-16 18:11:45 +00:00
Sebastián Ramírez
9efab1bd96 👷 Refactor CI artifact upload/download for docs previews (#5793) 2022-12-16 22:11:03 +04:00
github-actions
97f04ab58c 📝 Update release notes 2022-12-03 22:26:17 +00:00
dependabot[bot]
1ba515a18d ⬆ Bump pypa/gh-action-pypi-publish from 1.5.1 to 1.5.2 (#5714)
Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.5.1 to 1.5.2.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](https://github.com/pypa/gh-action-pypi-publish/compare/v1.5.1...v1.5.2)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-03 23:25:39 +01:00
github-actions
5f1cc3a5ff 📝 Update release notes 2022-12-02 17:23:12 +00:00
github-actions[bot]
41db4cba4c 👥 Update FastAPI People (#5722)
Co-authored-by: github-actions <github-actions@github.com>
2022-12-02 18:22:33 +01:00
github-actions
83bcdc40d8 📝 Update release notes 2022-11-29 18:06:22 +00:00
Sebastián Ramírez
8bdab084f9 🔧 Update sponsors, disable course bundle (#5713) 2022-11-29 19:05:40 +01:00
github-actions
5c4054ab8a 📝 Update release notes 2022-11-28 07:13:14 +00:00
dependabot[bot]
7e4e0d22ae ⬆ Update typer[all] requirement from <0.7.0,>=0.6.1 to >=0.6.1,<0.8.0 (#5639)
Updates the requirements on [typer[all]](https://github.com/tiangolo/typer) to permit the latest version.
- [Release notes](https://github.com/tiangolo/typer/releases)
- [Changelog](https://github.com/tiangolo/typer/blob/master/docs/release-notes.md)
- [Commits](https://github.com/tiangolo/typer/compare/0.6.1...0.7.0)

---
updated-dependencies:
- dependency-name: typer[all]
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-28 08:12:37 +01:00
Sebastián Ramírez
612b8ff168 🔖 Release version 0.88.0 2022-11-27 15:50:32 +01:00
Sebastián Ramírez
46bb5d2c4b 📝 Update release notes 2022-11-27 15:49:33 +01:00
github-actions
c458ca6f07 📝 Update release notes 2022-11-27 14:46:48 +00:00
Eugenio Panadero
46974c510e ⬆ Bump Starlette to version 0.22.0 to fix bad encoding for query parameters in TestClient (#5659)
closes https://github.com/tiangolo/fastapi/issues/5646
2022-11-27 15:46:06 +01:00
github-actions
89ec1f2d36 📝 Update release notes 2022-11-27 14:23:13 +00:00
github-actions
128c925c35 📝 Update release notes 2022-11-27 14:22:41 +00:00
Sebastián Ramírez
884203676d 👷 Tweak build-docs to improve CI performance (#5699) 2022-11-27 14:22:30 +00:00
pre-commit-ci[bot]
9b4e85f088 ⬆ [pre-commit.ci] pre-commit autoupdate (#5566)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-27 15:22:03 +01:00
github-actions
991db7b05a 📝 Update release notes 2022-11-27 14:14:28 +00:00
Ayrton Freeman
ebd917a530 🌐 Add Portuguese translation for docs/pt/docs/deployment/docker.md (#5663)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-27 14:13:50 +00:00
github-actions
99d8470a8e 📝 Update release notes 2022-11-27 14:00:09 +00:00
Sebastián Ramírez
7c5626bef7 ⬆️ Upgrade Ruff (#5698) 2022-11-27 14:59:32 +01:00
github-actions
91e5a5d1cf 📝 Update release notes 2022-11-27 13:53:52 +00:00
Sebastián Ramírez
fcc4dd61f1 👷 Remove pip cache for Smokeshow as it depends on a requirements.txt (#5700) 2022-11-27 14:53:13 +01:00
github-actions
0b53ee505b 📝 Update release notes 2022-11-27 13:40:03 +00:00
Sebastián Ramírez
c942a9b8d0 💚 Fix pip cache for Smokeshow (#5697) 2022-11-27 14:39:17 +01:00
github-actions
c77384fc8f 📝 Update release notes 2022-11-27 13:12:12 +00:00
Sebastián Ramírez
0c07e542a7 👷 Fix and tweak CI cache handling (#5696) 2022-11-27 13:11:22 +00:00
github-actions
ec30c3001d 📝 Update release notes 2022-11-25 11:39:33 +00:00
Michael Adkins
22837ee202 👷 Update setup-python action in tests to use new caching feature (#5680) 2022-11-25 12:38:55 +01:00
github-actions
0eb05cabbf 📝 Update release notes 2022-11-22 13:30:37 +00:00
Muhammad Abdur Rakib
6883f362a5 ✏️ Fix typo in docs for docs/en/docs/advanced/middleware.md (#5376)
Fix typo in documentation

A full-stop was missing in `TrustedHostMiddleware` section

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-22 13:29:57 +00:00
github-actions
4638b2c64e 📝 Update release notes 2022-11-13 22:07:03 +00:00
dependabot[bot]
3c01b2469f ⬆ Bump black from 22.8.0 to 22.10.0 (#5569)
Bumps [black](https://github.com/psf/black) from 22.8.0 to 22.10.0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/compare/22.8.0...22.10.0)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-13 23:06:28 +01:00
Sebastián Ramírez
63a5ffcf57 🔖 Release version 0.87.0 2022-11-13 22:36:53 +01:00
Sebastián Ramírez
da1c67338f 🔖 Release version 0.87.0 2022-11-13 22:27:53 +01:00
Sebastián Ramírez
46a509649d 📝 Update release notes 2022-11-13 22:26:43 +01:00
github-actions
1d416c4c53 📝 Update release notes 2022-11-13 20:51:19 +00:00
Sebastián Ramírez
89095eba4f ⬆️ Upgrade and relax dependencies for extras "all" (#5634) 2022-11-13 21:50:43 +01:00
github-actions
5a63f660de 📝 Update release notes 2022-11-13 20:30:05 +00:00
Sebastián Ramírez
9c483505e3 ✏️ Tweak Help FastAPI from PR review after merging (#5633) 2022-11-13 20:29:23 +00:00
github-actions
ad0e923fed 📝 Update release notes 2022-11-13 20:29:15 +00:00
Pax
fc717f84ff ✏️ Clarify docs on CORS (#5627) 2022-11-13 21:28:37 +01:00
Sebastián Ramírez
b1204a9b62 📝 Update release notes 2022-11-13 21:23:22 +01:00
github-actions
16630bf54d 📝 Update release notes 2022-11-13 19:34:43 +00:00
Sebastián Ramírez
50ea75ae98 📝 Update Help FastAPI: Help Maintain FastAPI (#5632) 2022-11-13 20:34:09 +01:00
github-actions
a0852e2f53 📝 Update release notes 2022-11-13 18:19:43 +00:00
Sebastián Ramírez
fa74093440 Use Ruff for linting (#5630) 2022-11-13 19:19:04 +01:00
github-actions
bcd9ab95e1 📝 Update release notes 2022-11-13 16:11:29 +00:00
Sebastián Ramírez
d537ee93d7 Re-export Starlette's WebSocketException and add it to docs (#5629) 2022-11-13 17:10:54 +01:00
github-actions
1c93d5523a 📝 Update release notes 2022-11-13 15:20:44 +00:00
Sebastián Ramírez
f92f87d379 📝 Update references to Requests for tests to HTTPX, and add HTTPX to extras (#5628) 2022-11-13 16:20:05 +01:00
github-actions
57141ccac4 📝 Update release notes 2022-11-13 14:35:13 +00:00
github-actions
46b903f70b 📝 Update release notes 2022-11-13 14:26:43 +00:00
Paweł Rubin
fdbd48be5f ⬆ Upgrade Starlette to 0.21.0, including the new [TestClient based on HTTPX](https://github.com/encode/starlette/releases/tag/0.21.0) (#5471)
Co-authored-by: Paweł Rubin <pawel.rubin@ocado.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-13 15:26:09 +01:00
github-actions
5f67ac6fd6 📝 Update release notes 2022-11-13 14:04:27 +00:00
axel584
ba5310f731 🌐 Add French translation for docs/fr/docs/advanced/additional-status-code.md (#5477)
Co-authored-by: Julian Maurin <julian.maurin.perso@pm.me>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-13 14:03:48 +00:00
github-actions
f57ccd8ef3 📝 Update release notes 2022-11-13 13:59:55 +00:00
Bruno Artur Torres Lopes Pereira
c040e3602a 🌐 Add Portuguese translation for docs/pt/docs/tutorial/request-forms-and-files.md (#5579)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-11-13 14:59:16 +01:00
github-actions
86d4073632 📝 Update release notes 2022-11-13 13:59:09 +00:00
Ryusei Ishikawa
59208e4ddc 🌐 Add Japanese translation for docs/ja/docs/advanced/websockets.md (#4983)
Co-authored-by: tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: komtaki <39375566+komtaki@users.noreply.github.com>
2022-11-13 14:58:31 +01:00
nikkie
0781a91d19 🌐 Fix highlight lines for Japanese translation for docs/tutorial/query-params.md (#2969)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Fix https://github.com/tiangolo/fastapi/issues/2966
2022-11-13 14:57:52 +01:00
github-actions
41735d2de9 📝 Update release notes 2022-11-10 12:22:58 +00:00
Sebastián Ramírez
a0c717d784 🛠 Add Arabic issue number to Notify Translations GitHub Action (#5610) 2022-11-10 12:22:25 +00:00
github-actions
0ed9ca78bc 📝 Update release notes 2022-11-10 11:16:30 +00:00
dependabot[bot]
678d35994a ⬆ Bump dawidd6/action-download-artifact from 2.24.1 to 2.24.2 (#5609)
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 2.24.1 to 2.24.2.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v2.24.1...v2.24.2)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-10 12:15:55 +01:00
github-actions
a7edd0b80d 📝 Update release notes 2022-11-09 11:46:50 +00:00
dependabot[bot]
f36d2e2b2b ⬆ Bump dawidd6/action-download-artifact from 2.24.0 to 2.24.1 (#5603)
Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 2.24.0 to 2.24.1.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v2.24.0...v2.24.1)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-09 12:46:14 +01:00
github-actions
5f0e095689 📝 Update release notes 2022-11-04 19:20:29 +00:00
Sebastián Ramírez
ccd242348f 🔖 Release version 0.86.0 2022-11-03 22:17:44 +01:00
Sebastián Ramírez
066cfae56e 📝 Update release notes 2022-11-03 22:16:37 +01:00
github-actions
51e768e85a 📝 Update release notes 2022-11-03 21:13:25 +00:00
Sebastián Ramírez
10fbfd6dc7 ⬆ Add Python 3.11 to the officially supported versions (#5587) 2022-11-03 21:12:43 +00:00
Sebastián Ramírez
85e602d7cc 📝 Update release notes 2022-11-03 22:05:26 +01:00
github-actions
fbc13d1f5b 📝 Update release notes 2022-11-03 21:01:09 +00:00
Vivek Ashokkumar
d4e2bdb33a ✏ Fix typo in docs/en/docs/tutorial/security/oauth2-jwt.md (#5584)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-03 21:00:28 +00:00
github-actions
8a5befd099 📝 Update release notes 2022-11-03 20:56:13 +00:00
Sebastián Ramírez
9a442c9730 👷 Update FastAPI People to exclude bots: pre-commit-ci, dependabot (#5586) 2022-11-03 20:55:32 +00:00
Sebastián Ramírez
4fa4965beb 📝 Update coverage badge to use Samuel Colvin's Smokeshow (#5585) 2022-11-03 21:55:00 +01:00
github-actions
5f4680201c 📝 Update release notes 2022-11-03 20:06:36 +00:00
Irfanuddin Shafi Ahmed
5cd99a9517 🎨 Format OpenAPI JSON in test_starlette_exception.py (#5379) 2022-11-03 21:06:00 +01:00
github-actions
b6ea8414a9 📝 Update release notes 2022-11-03 20:01:17 +00:00
Sebastián Ramírez
be3e29fb3c 👷 Switch from Codecov to Smokeshow plus pytest-cov to pure coverage for internal tests (#5583) 2022-11-03 21:00:29 +01:00
github-actions
cf730518bc 📝 Update release notes 2022-11-03 12:27:24 +00:00
Sebastián Ramírez
d62f5c1b28 Enable tests for Python 3.11 (#4881) 2022-11-03 13:26:48 +01:00
github-actions
4cf9075809 📝 Update release notes 2022-11-03 12:08:23 +00:00
ZHCai
a0c677ef0d 🌐 Update wording in Chinese translation for docs/zh/docs/python-types.md (#5416) 2022-11-03 13:07:49 +01:00
github-actions
54aa27ca07 📝 Update release notes 2022-11-03 12:07:29 +00:00
Adrian Garcia Badaracco
ac9f56ea5e 🐛 Close FormData (uploaded files) after the request is done (#5465)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-03 13:06:52 +01:00
github-actions
ed9425ef50 📝 Update release notes 2022-11-03 11:52:17 +00:00
Vladislav Kramorenko
9a85535e7f 🌐 Add Russian translation for docs/ru/docs/deployment/index.md (#5336)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-03 11:51:44 +00:00
github-actions
c9308cf070 📝 Update release notes 2022-11-03 11:51:26 +00:00
jaystone776
058cb6e88e 🌐 Update Chinese translation for docs/tutorial/security/oauth2-jwt.md (#3846)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-11-03 11:50:48 +00:00
github-actions
876ea7978f 📝 Update release notes 2022-11-03 11:45:26 +00:00
github-actions[bot]
da0bfd22aa 👥 Update FastAPI People (#5571)
Co-authored-by: github-actions <github-actions@github.com>
2022-11-03 12:44:51 +01:00
Sebastián Ramírez
d0917ce015 🔖 Release version 0.85.2 2022-10-31 19:57:16 +01:00
Sebastián Ramírez
6002290659 📝 Update release notes 2022-10-31 19:56:21 +01:00
github-actions
e92a8649f9 📝 Update release notes 2022-10-31 18:12:19 +00:00
Bruno Artur Torres Lopes Pereira
c28337e61d 🌐 Add Portuguese translation for docs/pt/docs/tutorial/request-forms.md (#4934)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 19:11:41 +01:00
github-actions
f4aea58528 📝 Update release notes 2022-10-31 18:08:49 +00:00
Zssaer
fcab59be88 🌐 Add Chinese translation for docs/zh/docs/tutorial/dependencies/classes-as-dependencies.md (#4971)
Co-authored-by: Jeodre <jedore_fight@189.cn>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 19:08:15 +01:00
github-actions
6aa9ef0c96 📝 Update release notes 2022-10-31 18:08:01 +00:00
Ruidy
c7fe6fea33 🌐 Add French translation for deployment/deta.md (#3692)
Co-authored-by: Sam Courtemanche <smlep.pro@gmail.com>
Co-authored-by: Ruidy <r.nemausat@empfohlen.de>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 18:07:22 +00:00
github-actions
c53e5bd4b1 📝 Update release notes 2022-10-31 17:58:24 +00:00
非法操作
db4452d47e 🌐 Update Chinese translation for docs/zh/docs/tutorial/query-params-str-validations.md (#5255)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 18:57:38 +01:00
github-actions
53127efde5 📝 Update release notes 2022-10-31 17:57:25 +00:00
Zssaer
9974c4b6ac 🌐 Add Chinese translation for docs/zh/docs/tutorial/sql-databases.md (#4999)
Co-authored-by: mkdir700 <56359329+mkdir700@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 18:56:49 +01:00
Ruidy
7ff62468a0 🌐 Add French translation for deployment/https.md (#3691)
Co-authored-by: Sam Courtemanche <smlep.pro@gmail.com>
Co-authored-by: Ruidy <r.nemausat@empfohlen.de>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 17:45:30 +00:00
github-actions
38493f8ae1 📝 Update release notes 2022-10-31 17:44:58 +00:00
github-actions
e0945eb1c8 📝 Update release notes 2022-10-31 17:44:40 +00:00
ASpathfinder
a26a3c1cbf 🌐 Add Chinese translation for docs/zh/docs/advanced/wsgi.md (#4505)
Co-authored-by: Jeodre <jedore_fight@189.cn>
Co-authored-by: KellyAlsa-massive-win <lhz928441818@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 18:43:39 +01:00
Lucas Mendes
2889b4a3df 🌐 Add Portuguese translation for docs/pt/docs/tutorial/body-multiple-params.md (#4111)
Co-authored-by: Lorhan Sohaky <contato+gi74@lorhan.me>
Co-authored-by: Wuerike <35462243+Wuerike@users.noreply.github.com>
Co-authored-by: Lorhan Sohaky <16273730+LorhanSohaky@users.noreply.github.com>
2022-10-31 18:42:57 +01:00
github-actions
8b20eece4c 📝 Update release notes 2022-10-31 17:42:41 +00:00
Lucas Mendes
330e8112ac 🌐 Add Portuguese translation for docs/pt/docs/tutorial/path-params-numeric-validations.md (#4099)
Co-authored-by: Pedro Victor <32584628+peidrao@users.noreply.github.com>
Co-authored-by: Lucas <61513630+lsglucas@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 18:41:58 +01:00
github-actions
7a2e9c7aaa 📝 Update release notes 2022-10-31 17:41:03 +00:00
Ruidy
1613749cc3 🌐 Add French translation for deployment/versions.md (#3690)
Co-authored-by: Sam Courtemanche <smlep.pro@gmail.com>
Co-authored-by: Ruidy <r.nemausat@empfohlen.de>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 18:39:54 +01:00
github-actions
669b3a4cb8 📝 Update release notes 2022-10-31 17:38:37 +00:00
dependabot[bot]
5f089435e5 ⬆ Bump nwtgck/actions-netlify from 1.2.3 to 1.2.4 (#5507)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 17:37:23 +00:00
github-actions
f1c61dec0c 📝 Update release notes 2022-10-31 17:36:43 +00:00
github-actions
a96effa86e 📝 Update release notes 2022-10-31 17:36:24 +00:00
dependabot[bot]
29c36f9d3f ⬆ Bump internal dependency types-ujson from 5.4.0 to 5.5.0 (#5537)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 17:36:09 +00:00
dependabot[bot]
fcf49a04eb ⬆ Bump dawidd6/action-download-artifact from 2.23.0 to 2.24.0 (#5508)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 17:35:48 +00:00
github-actions
558d929568 📝 Update release notes 2022-10-31 17:34:47 +00:00
Julian Maurin
f3086a7b15 🌐 Add French translation for docs/fr/docs/help-fastapi.md (#2233)
Co-authored-by: Ruidy <ruidy.nemausat@gmail.com>
2022-10-31 18:34:09 +01:00
github-actions
64d512e349 📝 Update release notes 2022-10-31 17:21:40 +00:00
Pamela Fox
88556dafb6 ✏ Fix grammar and add helpful links to dependencies in docs/en/docs/async.md (#5432) 2022-10-31 18:21:05 +01:00
github-actions
6a46532cc4 📝 Update release notes 2022-10-31 17:17:35 +00:00
Shubham
c75de8cba2 ✏ Fix broken link in alternatives.md (#5455)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 17:16:57 +00:00
github-actions
85443e64ee 📝 Update release notes 2022-10-31 17:10:20 +00:00
dependabot[bot]
2623a06105 ⬆ Update internal dependency pytest-cov requirement from <4.0.0,>=2.12.0 to >=2.12.0,<5.0.0 (#5539)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 17:09:45 +00:00
github-actions
d72599b4dc 📝 Update release notes 2022-10-31 16:51:55 +00:00
pre-commit-ci[bot]
16e058697d ⬆ [pre-commit.ci] pre-commit autoupdate (#5536)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 17:48:43 +01:00
github-actions
bbfa450991 📝 Update release notes 2022-10-31 16:47:12 +00:00
zhangbo
22524a1610 ✏ Fix typo in docs about contributing, for compatibility with pip in Zsh (#5523)
Co-authored-by: zhangbo <zhangbo@zjptmc.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 16:46:37 +00:00
github-actions
959f6bf209 📝 Update release notes 2022-10-31 16:46:16 +00:00
dependabot[bot]
80eac96c70 ⬆ Bump internal dependency mypy from 0.971 to 0.982 (#5541)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 17:45:41 +01:00
github-actions
bbb8fe1e60 📝 Update release notes 2022-10-31 16:40:30 +00:00
yuk115nt5now
bfb1422555 🌐 Fix typo in Chinese translation for docs/zh/docs/tutorial/security/first-steps.md (#5530) 2022-10-31 17:39:44 +01:00
github-actions
0cc40ed664 📝 Update release notes 2022-10-31 16:39:02 +00:00
feliciss
4a1c69e6c2 📝 Fix typo in docs with examples for Python 3.10 instead of 3.9 (#5545)
Co-authored-by: Feliciss <system@Felicisss-MacBook-Air.local>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-31 16:38:10 +00:00
github-actions
42a4ed7a18 📝 Update release notes 2022-10-31 16:22:46 +00:00
Bruno Artur Torres Lopes Pereira
146b9d6e04 🌐 Add Portuguese translation for docs/pt/docs/tutorial/response-status-code.md (#4922)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-31 17:22:07 +01:00
github-actions
e0d1619362 📝 Update release notes 2022-10-31 16:07:36 +00:00
Sebastián Ramírez
fdfcb9412e 🔧 Add config for Tamil translations (#5563) 2022-10-31 16:07:02 +00:00
github-actions
866a24f879 📝 Update release notes 2022-10-31 13:36:59 +00:00
Samuel Colvin
ee4b2bb8ae 🐛 Fix internal Trio test warnings (#5547) 2022-10-31 14:36:30 +01:00
github-actions
f67b19f0f7 📝 Update release notes 2022-10-20 11:15:56 +00:00
pre-commit-ci[bot]
9dc1a3026d ⬆ [pre-commit.ci] pre-commit autoupdate (#5408)
updates:
- [github.com/asottile/pyupgrade: v2.37.3 → v3.1.0](https://github.com/asottile/pyupgrade/compare/v2.37.3...v3.1.0)
- https://github.com/myint/autoflakehttps://github.com/PyCQA/autoflake
- [github.com/PyCQA/autoflake: v1.5.3 → v1.7.6](https://github.com/PyCQA/autoflake/compare/v1.5.3...v1.7.6)
- [github.com/psf/black: 22.8.0 → 22.10.0](https://github.com/psf/black/compare/22.8.0...22.10.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-20 13:15:19 +02:00
github-actions
e13df8ee79 📝 Update release notes 2022-10-16 15:16:24 +00:00
Sebastián Ramírez
e04878edfe ⬆️ Upgrade Typer to include Rich in scripts for docs (#5502) 2022-10-16 15:15:47 +00:00
github-actions
0e3ff851c2 📝 Update release notes 2022-10-16 15:02:15 +00:00
Sebastián Ramírez
e866a2c7e1 🐛 Fix calling mkdocs for languages as a subprocess to fix/enable MkDocs Material search plugin (#5501)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-10-16 17:01:38 +02:00
Sebastián Ramírez
90fc4299d1 🔖 Release version 0.85.1 2022-10-14 22:52:36 +02:00
github-actions
a3a37a4213 📝 Update release notes 2022-10-14 20:50:44 +00:00
github-actions[bot]
3c6528460c 👥 Update FastAPI People (#5447)
Co-authored-by: github-actions <github-actions@github.com>
2022-10-14 22:50:07 +02:00
github-actions
5ba0c8c002 📝 Update release notes 2022-10-14 20:44:57 +00:00
Jarro van Ginkel
0ae8db447a 🐛 Fix support for strings in OpenAPI status codes: default, 1XX, 2XX, 3XX, 4XX, 5XX (#5187)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-10-14 22:44:22 +02:00
github-actions
9c6086eee6 📝 Update release notes 2022-10-14 20:22:46 +00:00
Sebastián Ramírez
ebe69913ae 🔧 Disable Material for MkDocs search plugin (#5495) 2022-10-14 20:22:09 +00:00
github-actions
81115dba53 📝 Update release notes 2022-10-11 20:50:43 +00:00
Samuel Colvin
1d1859675f 🔇 Ignore Trio warning in tests for CI (#5483) 2022-10-12 00:50:01 +04:00
github-actions
c6aa28bea2 📝 Update release notes 2022-09-20 14:30:02 +00:00
moneeka
20f689ded2 📝 Add WayScript x FastAPI Tutorial to External Links section (#5407) 2022-09-20 16:29:23 +02:00
Sebastián Ramírez
1213227667 🔖 Release version 0.85.0 2022-09-15 15:57:23 +02:00
Sebastián Ramírez
e782ba43ce 📝 Update release notes 2022-09-15 15:56:35 +02:00
github-actions
6ddd0c64b0 📝 Update release notes 2022-09-15 13:49:32 +00:00
Sebastián Ramírez
a05e8b4e6f ⬆️ Upgrade Uvicorn in public extras: all (#5401) 2022-09-15 13:48:53 +00:00
github-actions
e83aa43296 📝 Update release notes 2022-09-15 13:43:34 +00:00
Sebastián Ramírez
95cbb43b06 ⬆️ Upgrade dependencies for doc and dev internal extras: Typer, Uvicorn (#5400) 2022-09-15 13:42:53 +00:00
github-actions
babe2f9b03 📝 Update release notes 2022-09-15 13:33:12 +00:00
Sebastián Ramírez
add7c4800c ⬆️ Upgrade test dependencies: Black, HTTPX, databases, types-ujson (#5399) 2022-09-15 13:32:22 +00:00
github-actions
b741ea7619 📝 Update release notes 2022-09-15 13:27:00 +00:00
Sebastián Ramírez
74ce2204ae ⬆️ Upgrade mypy and tweak internal type annotations (#5398) 2022-09-15 13:26:21 +00:00
github-actions
823df88c34 📝 Update release notes 2022-09-15 13:02:23 +00:00
Sebastián Ramírez
3658733b5e 🔧 Update test dependencies, upgrade Pytest, move dependencies from dev to test (#5396) 2022-09-15 13:01:46 +00:00
github-actions
715c0341a9 📝 Update release notes 2022-09-15 12:32:54 +00:00
Marcelo Trylesinski
adcf03f2bc ⬆ Upgrade version required of Starlette from 0.19.1 to 0.20.4 (#4820)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-15 14:32:05 +02:00
Sebastián Ramírez
1073062c7f 🔖 Release version 0.84.0 2022-09-14 20:41:29 +02:00
github-actions
7291cead65 📝 Update release notes 2022-09-14 18:32:03 +00:00
Ofek Lev
4267bd1f4f 🔧 Update package metadata, drop support for Python 3.6, move build internals from Flit to Hatch (#5240)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-14 20:31:19 +02:00
Sebastián Ramírez
b2aa3593be 📝 Update release notes 2022-09-11 18:26:30 +02:00
Sebastián Ramírez
ed0fcba7cb 🔖 Release version 0.83.0 2022-09-11 18:25:29 +02:00
Sebastián Ramírez
22a155efc1 📝 Update release notes 2022-09-11 18:24:46 +02:00
github-actions
306326a213 📝 Update release notes 2022-09-11 16:16:31 +00:00
Marcelo Trylesinski
4fec12b354 📝 Update SECURITY.md (#5377) 2022-09-11 18:15:49 +02:00
github-actions
275306c369 📝 Update release notes 2022-09-11 16:14:21 +00:00
Irfanuddin Shafi Ahmed
4d270463af 🐛Fix RuntimeError raised when HTTPException has a status code with no content (#5365)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-11 16:13:36 +00:00
github-actions
6620273083 📝 Update release notes 2022-09-08 15:03:37 +00:00
Thomas Meckel
0b4fe10c8f 🐛 Fix empty reponse body when default status_code is empty but the a Response parameter with response.status_code is set (#5360)
Co-authored-by: Thomas Meckel <tmeckel@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-08 15:02:59 +00:00
github-actions
c4007cb9ec 📝 Update release notes 2022-09-08 14:30:00 +00:00
DCsunset
3ec498af63 Add support in jsonable_encoder for include and exclude with dataclasses (#4923)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-08 16:29:23 +02:00
github-actions
895789bed0 📝 Update release notes 2022-09-08 14:09:15 +00:00
pre-commit-ci[bot]
ef5d6181b6 ⬆ [pre-commit.ci] pre-commit autoupdate (#5352)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-08 16:08:33 +02:00
Sebastián Ramírez
3079ba925e 🔖 Release version 0.82.0 2022-09-04 21:26:31 +02:00
Sebastián Ramírez
ddf6daeb07 📝 Update release notes 2022-09-04 21:25:29 +02:00
github-actions
f3efaf69da 📝 Update release notes 2022-09-04 19:10:05 +00:00
Adrian Garcia Badaracco
f8460a8b54 🐛 Allow exit code for dependencies with yield to always execute, by removing capacity limiter for them, to e.g. allow closing DB connections without deadlocks (#5122)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-04 21:09:24 +02:00
github-actions
d0cc996dc7 📝 Update release notes 2022-09-04 15:17:43 +00:00
github-actions[bot]
c70fab38e7 👥 Update FastAPI People (#5347)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-04 15:16:00 +00:00
github-actions
80d68a6eda 📝 Update release notes 2022-09-04 15:12:59 +00:00
Mateusz Nowak
dacb689290 Export WebSocketState in fastapi.websockets (#4376) 2022-09-04 17:12:10 +02:00
github-actions
dd2f759bac 📝 Update release notes 2022-09-04 15:07:46 +00:00
Irfanuddin Shafi Ahmed
4cff206ebb 🐛 Fix FastAPI People GitHub Action: set HTTPX timeout for GraphQL query request (#5222)
Co-authored-by: Irfanuddin <irfanuddin@knowledgelens.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-04 15:07:12 +00:00
github-actions
0195bb5706 📝 Update release notes 2022-09-04 14:57:04 +00:00
baconfield
0ae8d09189 ✏ Update Hypercorn link, now pointing to GitHub (#5346)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-04 14:56:29 +00:00
github-actions
9df22ab864 📝 Update release notes 2022-09-04 14:28:31 +00:00
Vladislav Kramorenko
81967f8f93 🌐 Add Russian translation for docs/ru/docs/features.md (#5315)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-04 16:27:48 +02:00
github-actions
7dd4a4f435 📝 Update release notes 2022-09-04 14:00:36 +00:00
github-actions
94b7527dfd 📝 Update release notes 2022-09-04 14:00:22 +00:00
dependabot[bot]
a3a8d68715 ⬆ Bump dawidd6/action-download-artifact from 2.22.0 to 2.23.0 (#5321)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-04 15:59:59 +02:00
pre-commit-ci[bot]
ee035dfa9a ⬆ [pre-commit.ci] pre-commit autoupdate (#5318)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-04 15:59:46 +02:00
github-actions
5a79564dab 📝 Update release notes 2022-09-04 13:40:56 +00:00
ASpathfinder
dc1534736d 🌐 Update Chinese translation for docs/zh/docs/tutorial/request-files.md (#4529)
Co-authored-by: KellyAlsa-massive-win <lhz928441818@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-04 15:40:14 +02:00
github-actions
fc559b5fcd 📝 Update release notes 2022-09-04 13:39:50 +00:00
Zssaer
0d43b6552b 🌐 Add Chinese translation for docs/zh/docs/tutorial/encoder.md (#4969) 2022-09-04 15:39:06 +02:00
github-actions
89839eb834 📝 Update release notes 2022-09-04 13:38:49 +00:00
Peter Fackeldey
f266dc17d7 ✏ Tweak wording in docs/en/docs/advanced/dataclasses.md (#3698) 2022-09-04 15:37:47 +02:00
github-actions
697ec94a7e 📝 Update release notes 2022-09-04 13:29:46 +00:00
MendyLanda
ae369d879a 📝 Add note about Python 3.10 X | Y operator in explanation about Response Models (#5307) 2022-09-04 15:29:06 +02:00
github-actions
198b7ef2cb 📝 Update release notes 2022-09-04 13:24:23 +00:00
Mário Victor Ribeiro Silva
68e04f6531 🌐 Fix MkDocs file line for Portuguese translation of background-task.md (#5242)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-04 13:23:34 +00:00
github-actions
c00e1ec6bf 📝 Update release notes 2022-09-04 13:18:44 +00:00
非法操作
d3ff7c620a ✏ Fix a small code highlight line error (#5256) 2022-09-04 15:18:08 +02:00
github-actions
fae28a9bd7 📝 Update release notes 2022-09-04 13:01:40 +00:00
sjyothi54
0e7478d39c 📝 Add link to New Relic article: "How to monitor FastAPI application performance using Python agent" (#5260)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-04 15:01:08 +02:00
github-actions
dbb43da9c0 📝 Update release notes 2022-09-03 17:13:24 +00:00
Charlie DiGiovanna
56f887de15 🐛 Make sure a parameter defined as required is kept required in OpenAPI even if defined as optional in another dependency (#4319)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-03 17:12:41 +00:00
github-actions
fbe1a803fc 📝 Update release notes 2022-09-02 13:36:48 +00:00
Junghoon Yang
52b5b08910 ♻ Internal small refactor, move operation_id parameter position in delete method for consistency with the code (#4474)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-02 13:36:00 +00:00
github-actions
e7e6404faf 📝 Update release notes 2022-09-02 12:44:09 +00:00
Marcelo Trylesinski
30b3905ef3 Support Python internal description on Pydantic model's docstring (#3032)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-02 14:43:21 +02:00
github-actions
b1d0f1e970 📝 Update release notes 2022-09-02 10:18:09 +00:00
abc.zxy
7250c194da Update ORJSONResponse to support non str keys and serializing Numpy arrays (#3892)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-09-02 10:17:31 +00:00
github-actions
173b891603 📝 Update release notes 2022-09-02 09:53:06 +00:00
Sebastián Ramírez
6ae8f07d24 🔧 Update sponsors, disable ImgWhale (#5338) 2022-09-02 09:52:19 +00:00
github-actions
b83709add4 📝 Update release notes 2022-09-01 09:59:45 +00:00
Ben Falk
a71077c530 📝 Update docs for ORJSONResponse with details about improving performance (#2615)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-01 09:59:05 +00:00
github-actions
278adc012a 📝 Update release notes 2022-09-01 09:33:10 +00:00
Sebastián Ramírez
356a57daa8 📝 Add docs for creating a custom Response class (#5331) 2022-09-01 09:32:30 +00:00
github-actions
b9d7f86743 📝 Update release notes 2022-09-01 09:06:24 +00:00
Sebastián Ramírez
adf4e77dd6 📝 Add tip about using alias for form data fields (#5329) 2022-09-01 09:05:41 +00:00
github-actions
0e1a9d1c0f 📝 Update release notes 2022-09-01 08:51:37 +00:00
David Brochart
d8b6aa630c 🐛 Fix support for path parameters in WebSockets (#3879)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-09-01 10:50:47 +02:00
Sebastián Ramírez
0bb8920ae1 🔖 Release version 0.81.0 2022-08-26 17:18:44 +02:00
Sebastián Ramírez
95c182a42c 📝 Update release notes 2022-08-26 17:17:42 +02:00
github-actions
165d57db24 📝 Update release notes 2022-08-26 14:53:08 +00:00
Ihor Tymkiv
ae5280e501 ✏ Fix a simple typo in docs/en/docs/python-types.md (#5193)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 14:52:23 +00:00
github-actions
d4b2ef8137 📝 Update release notes 2022-08-26 14:46:06 +00:00
impocode
fd2080aece 🌐 Add Russian translation for docs/ru/docs/index.md (#5289) 2022-08-26 16:45:24 +02:00
github-actions
3c8d8c38a7 📝 Update release notes 2022-08-26 14:44:37 +00:00
Artyom Kropp
fa92dbf557 🌐 Add Russian translation for docs/ru/docs/deployment/versions.md (#4985) 2022-08-26 16:43:58 +02:00
github-actions
cd8854c4c7 📝 Update release notes 2022-08-26 14:43:25 +00:00
Bruno Artur Torres Lopes Pereira
b63398f4b5 🌐 Add Portuguese translation for docs/pt/docs/tutorial/header-params.md (#4921)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 14:42:45 +00:00
github-actions
728b961d35 📝 Update release notes 2022-08-26 14:37:17 +00:00
supraaxdd
5e34cb1868 ✏ Fix typos in tests/test_schema_extra_examples.py (#5126) 2022-08-26 16:36:41 +02:00
github-actions
bbd34c55d5 📝 Update release notes 2022-08-26 14:35:47 +00:00
Roy Hyunjin Han
8a72d363c8 ✏ Fix typos in docs/en/docs/tutorial/path-params-numeric-validations.md (#5142) 2022-08-26 16:35:10 +02:00
github-actions
ee93ad952c 📝 Update release notes 2022-08-26 14:29:03 +00:00
dependabot[bot]
d26674616c ⬆ Bump dawidd6/action-download-artifact from 2.21.1 to 2.22.0 (#5258)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-26 16:28:08 +02:00
github-actions
40a19fe261 📝 Update release notes 2022-08-26 14:27:09 +00:00
github-actions
8b4546352f 📝 Update release notes 2022-08-26 14:26:53 +00:00
Edwuin Gutierrez
b3f2f08251 📝 Add step about upgrading pip in the venv to avoid errors when installing dependencies docs/en/docs/contributing.md (#5181)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 14:26:28 +00:00
pre-commit-ci[bot]
3d3a7dbe7e ⬆ [pre-commit.ci] pre-commit autoupdate (#5196)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-26 16:26:10 +02:00
github-actions
d69b5f39b4 📝 Update release notes 2022-08-26 14:23:22 +00:00
Pedro Augusto de Paula Barbosa
70213467a6 ✏ Reword and clarify text in tutorial docs/en/docs/tutorial/body-nested-models.md (#5169) 2022-08-26 16:22:36 +02:00
github-actions
8d1d1703f4 📝 Update release notes 2022-08-26 14:21:42 +00:00
Charlie Wilson
1285ba4b2e ✏ Fix minor typo in docs/en/docs/features.md (#5206) 2022-08-26 16:20:57 +02:00
github-actions
6bbfd27c19 📝 Update release notes 2022-08-26 14:11:39 +00:00
github-actions
4c0b9b831c 📝 Update release notes 2022-08-26 14:11:05 +00:00
Burak Kadir Er
9e6dcba766 ✏ Fix minor typos in docs/en/docs/async.md (#5125)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 14:10:53 +00:00
KrishNa
e1825589ba 📝 Add external link to docs: "Fastapi, Docker(Docker compose) and Postgres" (#5033) 2022-08-26 16:10:17 +02:00
github-actions
acc59df815 📝 Update release notes 2022-08-26 14:09:23 +00:00
Seungho Kim
d86b54e79b 🔥 Delete duplicated tests in tests/test_tutorial/test_sql_databases/test_sql_databases.py (#5040) 2022-08-26 16:08:45 +02:00
github-actions
6b77179e3b 📝 Update release notes 2022-08-26 13:57:25 +00:00
github-actions
8dab25df71 📝 Update release notes 2022-08-26 13:56:54 +00:00
Luis R
22bed0008c 🐛 Fix jsonable_encoder for dataclasses with pydantic-compatible fields (#3607)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-26 15:56:47 +02:00
Erik Vroon
de6ccd7754 Add ReDoc <noscript> warning when JS is disabled (#5074)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 13:56:07 +00:00
github-actions
26c68c6e0d 📝 Update release notes 2022-08-26 13:47:11 +00:00
pylounge
dc10b81d05 ♻ Simplify internal RegEx in fastapi/utils.py (#5057)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-26 15:46:22 +02:00
github-actions
1f2070af20 📝 Update release notes 2022-08-26 13:44:50 +00:00
LYK
a95212565a 🌐 Update ko/mkdocs.yml for a missing link (#5020)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 13:44:02 +00:00
github-actions
d80b065b5e 📝 Update release notes 2022-08-26 13:33:08 +00:00
Adrian Garcia Badaracco
dde140d8e3 📝 Simplify example for docs for Additional Responses, remove unnecessary else (#4693) 2022-08-26 15:32:30 +02:00
github-actions
96c3f44a0e 📝 Update release notes 2022-08-26 13:30:28 +00:00
David Kim
0539dd9cd3 🔧 Fix Type hint of auto_error which does not need to be Optional[bool] (#4933) 2022-08-26 15:29:50 +02:00
github-actions
aaf5a380df 📝 Update release notes 2022-08-26 13:27:07 +00:00
Micael Jarniac
e3c055ba8f 📝 Update docs, compare enums with identity instead of equality (#4905) 2022-08-26 15:26:03 +02:00
github-actions
afe44f0b25 📝 Update release notes 2022-08-26 13:25:48 +00:00
Michael Oliver
8cd8aa4b67 🔧 Update mypy config, use strict = true instead of manual configs (#4605)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 15:25:02 +02:00
github-actions
26097421d3 📝 Update release notes 2022-08-26 13:24:42 +00:00
github-actions
3df68694c0 📝 Update release notes 2022-08-26 13:24:10 +00:00
Micael Jarniac
f3e9dcd891 ✏ Fix typo in docs/en/docs/python-types.md (#4886)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 13:24:04 +00:00
Shahriyar Rzayev
00bdf533ef ♻ Change a dict() for {} in fastapi/utils.py (#3138) 2022-08-26 15:23:25 +02:00
github-actions
ae56590c51 📝 Update release notes 2022-08-26 13:17:25 +00:00
github-actions
923e0ac0c1 📝 Update release notes 2022-08-26 13:17:04 +00:00
Guillermo Quintana Pelayo
a64387c3fc ♻ Move internal variable for errors in jsonable_encoder to put related code closer (#4560)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 13:16:44 +00:00
Muzaffer Cikay
c8124496fc ♻ Simplify conditional assignment in fastapi/dependencies/utils.py (#4597)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 13:16:17 +00:00
github-actions
75792eb82b 📝 Update release notes 2022-08-26 13:05:26 +00:00
Joon Hwan 김준환
bb53d0b0ea 🎨 Fix syntax highlighting in docs for OpenAPI Callbacks (#4368)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 15:04:48 +02:00
github-actions
f928f3390c 📝 Update release notes 2022-08-26 09:42:03 +00:00
James Curtin
d5c84594cb ⬆ Upgrade version pin accepted for Flake8, for internal code, to flake8 >=3.8.3,<6.0.0 (#4097)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 11:41:23 +02:00
github-actions
0968329ed7 📝 Update release notes 2022-08-26 09:26:59 +00:00
Ori Levari
880c8b37cf 🐛 Fix support for extending openapi_extras with parameter lists (#4267)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-26 09:26:20 +00:00
github-actions
92181ef182 📝 Update release notes 2022-08-25 21:53:36 +00:00
juntatalor
ca2fae0588 Add support for FrozenSet in parameters (e.g. query) (#2938)
Co-authored-by: saborisov <borisov_s@tass.ru>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-25 23:52:53 +02:00
github-actions
af3a6ef78b 📝 Update release notes 2022-08-25 21:45:33 +00:00
Andy Challis
eb3ab337ab Allow custom middlewares to raise HTTPExceptions and propagate them (#2036)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-25 23:44:40 +02:00
github-actions
5215b39d50 📝 Update release notes 2022-08-25 09:56:40 +00:00
Sidharth Ajithkumar
9359a8d65f Preserve json.JSONDecodeError information when handling invalid JSON in request body, to support custom exception handlers that use its information (#4057)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-25 11:55:53 +02:00
github-actions
afaa0391a5 📝 Update release notes 2022-08-24 21:36:15 +00:00
Caleb Renfroe
438656395a ✏ Reword confusing sentence in docs file typo-fix-path-params-numeric-validations.md (#3219)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-24 21:35:30 +00:00
github-actions
39319a7ede 📝 Update release notes 2022-08-24 14:54:27 +00:00
Kevin Tewouda
8c6ad35615 📝 Update docs for handling HTTP Basic Auth with secrets.compare_digest() to account for non-ASCII characters (#3536)
Co-authored-by: le_woudar <kevin.tewouda@gandi.net>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-24 16:53:43 +02:00
github-actions
f90465f5b4 📝 Update release notes 2022-08-24 14:18:57 +00:00
Sebastián Ramírez
1835b3f76d 📝 Update docs for testing, fix examples with relative imports (#5302) 2022-08-24 16:18:11 +02:00
github-actions
2201f29be3 📝 Update release notes 2022-08-24 08:44:22 +00:00
Sebastián Ramírez
68f25120c5 🍱 Update Jina banner, fix typo (#5301) 2022-08-24 08:43:44 +00:00
Sebastián Ramírez
7d6e70791d 🔖 Release version 0.80.0 2022-08-23 16:14:48 +02:00
Sebastián Ramírez
18819f9850 📝 Update release notes 2022-08-23 16:13:37 +02:00
github-actions
ad65e72d90 📝 Update release notes 2022-08-23 13:58:06 +00:00
Teo Koon Peng
ec072d75fe ⬆ Upgrade Swagger UI copy of oauth2-redirect.html to include fixes for flavors of authorization code flows in Swagger UI (#3439)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-23 13:57:25 +00:00
github-actions
09acce4b2c 📝 Update release notes 2022-08-23 13:48:07 +00:00
Andrey Semakin
f6808e76dc ♻ Strip empty whitespace from description extracted from docstrings (#2821)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-23 13:47:19 +00:00
github-actions
f8f5281ef5 📝 Update release notes 2022-08-23 13:31:17 +00:00
laggardkernel
b993b4af28 🐛 Fix cached dependencies when using a dependency in Security() and other places (e.g. Depends()) with different OAuth2 scopes (#2945)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-23 13:30:24 +00:00
github-actions
982911f08f 📝 Update release notes 2022-08-22 19:18:24 +00:00
Taneli Hukkinen
634cf22584 🐛 Fix response_model not invalidating None (#2725)
Co-authored-by: Taneli Hukkinen <hukkinj1@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-22 19:17:45 +00:00
github-actions
12f60cac7a 📝 Update release notes 2022-08-22 18:49:42 +00:00
Sebastián Ramírez
e7b1b96a54 🎨 Update type annotations for response_model, allow things like Union[str, None] (#5294) 2022-08-22 18:49:03 +00:00
github-actions
a6a39f3009 📝 Update release notes 2022-08-22 18:35:01 +00:00
0xflotus
1ff8df6e7f 🌐 Fix typos in German translation for docs/de/docs/features.md (#4533)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-22 18:33:10 +00:00
github-actions
7953353a35 📝 Update release notes 2022-08-22 14:53:35 +00:00
Joona Yoon
6c16d6a4f9 🌐 Add missing navigator for encoder.md in Korean translation (#5238) 2022-08-22 16:52:50 +02:00
github-actions
eb80b79555 📝 Update release notes 2022-08-22 12:44:46 +00:00
Sebastián Ramírez
ab8988ff7c 🔖 Release version 0.79.1 2022-08-18 23:14:07 +02:00
Sebastián Ramírez
09381ba042 📝 Update release notes 2022-08-18 23:13:19 +02:00
github-actions
767df02814 📝 Update release notes 2022-08-18 21:12:18 +00:00
Sebastián Ramírez
a21c315574 📝 Add note giving credit for illustrations to Ketrina Thompson (#5284) 2022-08-18 21:11:39 +00:00
Sebastián Ramírez
7f0e2f6cfa 📝 Update release notes 2022-08-18 23:04:30 +02:00
github-actions
94bbb91ec2 📝 Update release notes 2022-08-18 20:57:50 +00:00
Sebastián Ramírez
2f9c6ab36a 🔧 Update Jina sponsorship (#5283) 2022-08-18 22:57:02 +02:00
github-actions
74638fcf7c 📝 Update release notes 2022-08-18 20:49:01 +00:00
Xavi Moreno
eb2e183361 🐛 Fix jsonable_encoder using include and exclude parameters for non-Pydantic objects (#2606)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 22:48:21 +02:00
github-actions
8a9a117ec7 📝 Update release notes 2022-08-18 20:31:57 +00:00
Luca Repetti
e88089ec21 🐛 Fix edge case with repeated aliases names not shown in OpenAPI (#2351)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 20:31:19 +00:00
github-actions
3a3b61dc6e 📝 Update release notes 2022-08-18 20:13:14 +00:00
Teofilo Zosa
ea017c9919 📝 Add misc dependency installs to tutorial docs (#2126)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 20:12:34 +00:00
Yumihiki
38802eefeb 📝 Quote pip install command for Zsh compatibility in multiple languages (#5214)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 16:16:54 +00:00
github-actions
58848897f4 📝 Update release notes 2022-08-18 16:15:37 +00:00
Bruno Artur Torres Lopes Pereira
73c6011ec4 🌐 Add Portuguese translation for docs/pt/docs/tutorial/query-params.md (#4775)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 16:13:12 +00:00
github-actions
30e7b6a34c 📝 Update release notes 2022-08-18 16:12:24 +00:00
github-actions
a9c2b8336b 📝 Update release notes 2022-08-18 16:11:55 +00:00
Vini Sousa
f79e6a48a1 🌐 Add Portuguese translation for docs/pt/docs/tutorial/security/first-steps.md (#4954)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-18 18:10:25 +02:00
zhangbo
fb849ee7ef 🌐 Add translation for docs/zh/docs/advanced/response-cookies.md (#4638)
Co-authored-by: zhangbo <zhangbo@zjptmc.com>
2022-08-18 18:09:38 +02:00
github-actions
e90d53f6f4 📝 Update release notes 2022-08-18 16:06:52 +00:00
github-actions
8afd291572 📝 Update release notes 2022-08-18 16:05:42 +00:00
github-actions
441b726537 📝 Update release notes 2022-08-18 16:05:11 +00:00
Marcelo Trylesinski
46f5091c9f ✏ Fix typo in python-types.md (#5116) 2022-08-18 18:04:33 +02:00
github-actions
d268eb2011 📝 Update release notes 2022-08-18 16:03:07 +00:00
Ruidy
e5eb56f0b5 🌐 Add French translation for docs/fr/docs/deployment/index.md (#3689)
Co-authored-by: Arthur Rio <arthurio@users.noreply.github.com>
Co-authored-by: Ruidy <r.nemausat@empfohlen.de>
Co-authored-by: Ruidy <rnemausat@newstore.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-18 18:02:40 +02:00
github-actions
f9dcff1490 📝 Update release notes 2022-08-18 16:02:28 +00:00
Fernando Simões
5d0e2f58e7 🌐 Add Portuguese translation for tutorial/handling-errors.md (#4769)
Co-authored-by: Lucas <61513630+lsglucas@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 16:02:20 +00:00
github-actions
b489b327b8 📝 Update release notes 2022-08-18 16:01:57 +00:00
Ruidy
48ca7a6368 🌐 Add French translation for docs/fr/docs/history-design-future.md (#3451)
Co-authored-by: Sam Courtemanche <smlep.pro@gmail.com>
Co-authored-by: Arthur Rio <arthurio@users.noreply.github.com>
Co-authored-by: Ruidy <r.nemausat@empfohlen.de>
Co-authored-by: Ruidy <rnemausat@newstore.com>
2022-08-18 18:01:14 +02:00
github-actions
65e4286bc9 📝 Update release notes 2022-08-18 16:00:22 +00:00
Atiab Bin Zakaria
b862639ce9 ✏ Fix typo in docs/en/docs/python-types.md (#5007) 2022-08-18 17:59:50 +02:00
AdmiralDesu
8fe80e81e1 🌐 Add Russian translation for docs/ru/docs/tutorial/background-tasks.md (#4854)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-18 17:59:02 +02:00
jaystone776
dc7e13846c 🌐 Add Chinese translation for docs/tutorial/security/first-steps.md (#3841)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 15:57:21 +00:00
github-actions
fc4ad71069 📝 Update release notes 2022-08-18 15:56:11 +00:00
github-actions
7e3e4fa7ea 📝 Update release notes 2022-08-18 15:54:41 +00:00
sUeharaE4
e23fa40e6c 🌐 Add Japanese translation for docs/ja/docs/advanced/nosql-databases.md (#4205)
Co-authored-by: tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-18 17:54:22 +02:00
Baskara Febrianto
a0d79b3706 🌐 Add Indonesian translation for docs/id/docs/tutorial/index.md (#4705)
Co-authored-by: Baskara Febrianto <baskarafebrianto@gmail>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-08-18 15:53:59 +00:00
github-actions
a79228138b 📝 Update release notes 2022-08-18 15:26:58 +00:00
Carlton Gibson
623b0f37de 📝 Remove unneeded Django/Flask references from async topic intro (#5280) 2022-08-18 17:24:28 +02:00
github-actions
44d1b21ba2 📝 Update release notes 2022-08-17 10:48:46 +00:00
Sebastián Ramírez
0ba0c4662d Add illustrations for Concurrent burgers and Parallel burgers (#5277) 2022-08-17 12:48:05 +02:00
github-actions
f1feb1427b 📝 Update release notes 2022-08-16 11:08:10 +00:00
Sebastián Ramírez
a1cdf8cd44 🔧 Update Jina sponsorship (#5272) 2022-08-16 11:07:22 +00:00
github-actions
5c576e42be 📝 Update release notes 2022-07-20 13:21:07 +00:00
Sebastián Ramírez
9031d1daee 🔧 Update sponsors, Striveworks badge (#5179) 2022-07-20 13:20:12 +00:00
github-actions
c07aced06d 📝 Update release notes 2022-07-20 12:26:04 +00:00
Mohsen Mahmoodi
3b5839260f 🌐 Add Persian translation for docs/fa/docs/index.md and tweak right-to-left CSS (#2395)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-07-20 12:25:23 +00:00
Sebastián Ramírez
50fb34bf55 🔖 Release version 0.79.0 2022-07-14 19:35:13 +02:00
Sebastián Ramírez
2f21bef91b 📝 Update release notes 2022-07-14 19:34:25 +02:00
github-actions
e35df688d5 📝 Update release notes 2022-07-14 17:17:09 +00:00
Itay Raveh
59d154fa6f 🌐 Start of Hebrew translation (#5050)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-07-14 17:16:28 +00:00
github-actions
ee182c6a0a 📝 Update release notes 2022-07-14 17:15:39 +00:00
Sebastián Ramírez
9197cbd36c 🔧 Update translations notification for Hebrew (#5158) 2022-07-14 17:14:53 +00:00
github-actions
f30b6c6001 📝 Update release notes 2022-07-14 17:05:01 +00:00
Sebastián Ramírez
71b10e5890 🔧 Update Dependabot commit message (#5156) 2022-07-14 17:04:20 +00:00
github-actions
49619c0180 📝 Update release notes 2022-07-14 16:15:55 +00:00
github-actions
84f6a03011 📝 Update release notes 2022-07-14 16:15:31 +00:00
dependabot[bot]
ec3b6e975c ⬆ Bump actions/upload-artifact from 2 to 3 (#5148)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-14 18:15:08 +02:00
dependabot[bot]
35244ee83b ⬆ Bump actions/cache from 2 to 3 (#5149)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-14 18:14:54 +02:00
github-actions
0be244ad52 📝 Update release notes 2022-07-14 15:05:19 +00:00
Sebastián Ramírez
169af0217e 🔧 Update sponsors badge configs (#5155) 2022-07-14 15:04:37 +00:00
github-actions
21fd708c6e 📝 Update release notes 2022-07-14 14:57:21 +00:00
Sebastián Ramírez
ec2ec48293 👥 Update FastAPI People (#5154)
Co-authored-by: github-actions <github-actions@github.com>
2022-07-14 14:56:40 +00:00
github-actions
e3339f6770 📝 Update release notes 2022-07-14 12:38:22 +00:00
Sebastián Ramírez
85dc173d19 🔧 Update Jina sponsor badges (#5151)
* 🍱 Update Jina badges

* 💄 Tweak sponsors badge CSS

* 🔧 Update Jina sponsor

* 📝 Re-generate README
2022-07-14 12:37:37 +00:00
github-actions
801e90863a 📝 Update release notes 2022-07-14 11:46:23 +00:00
github-actions
86fb017aad 📝 Update release notes 2022-07-14 11:45:51 +00:00
Sebastián Ramírez
2226f962ff 🔧 Add config for Swedish translations notification (#5147) 2022-07-14 11:45:26 +00:00
Robin
b4a98a7224 🌐 Start of Swedish translation (#5062)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-07-14 11:45:01 +00:00
github-actions
c5954d3bc0 📝 Update release notes 2022-07-14 11:35:16 +00:00
wakabame
80cb57e4b2 🌐 Add Japanese translation for docs/ja/docs/advanced/index.md (#5043)
Co-authored-by: Amazyra <yamaguchi.tatsuya.27a@gmail.com>
Co-authored-by: tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-07-14 11:34:38 +00:00
github-actions
fb26c1ee70 📝 Update release notes 2022-07-14 11:30:45 +00:00
Kamil Woźniak
120cf49089 🌐🇵🇱 Add Polish translation for docs/pl/docs/tutorial/first-steps.md (#5024)
* docs: Polish translation for tutorial/first-steps.md

* docs: Polish translation / fixes after cr
2022-07-14 13:30:09 +02:00
github-actions
48b7804a79 📝 Update release notes 2022-07-14 11:27:49 +00:00
github-actions
19701d12fb 📝 Update release notes 2022-07-14 11:26:52 +00:00
dependabot[bot]
606028dc8c ⬆ Bump actions/checkout from 2 to 3 (#5133)
Bump actions/checkout from 2 to 3

Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-14 11:26:14 +00:00
pre-commit-ci[bot]
100799cde2 ⬆ [pre-commit.ci] pre-commit autoupdate (#5030)
updates:
- [github.com/pre-commit/pre-commit-hooks: v4.2.0 → v4.3.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.2.0...v4.3.0)
- [github.com/asottile/pyupgrade: v2.32.1 → v2.37.1](https://github.com/asottile/pyupgrade/compare/v2.32.1...v2.37.1)
- [github.com/psf/black: 22.3.0 → 22.6.0](https://github.com/psf/black/compare/22.3.0...22.6.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-14 13:25:32 +02:00
github-actions
c15fce3248 📝 Update release notes 2022-07-14 11:24:11 +00:00
github-actions
b7bd3c1d55 📝 Update release notes 2022-07-14 11:23:15 +00:00
github-actions
3ccb960478 📝 Update release notes 2022-07-14 11:22:19 +00:00
dependabot[bot]
6497cb08f5 ⬆ Bump nwtgck/actions-netlify from 1.1.5 to 1.2.3 (#5132)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-14 13:22:16 +02:00
dependabot[bot]
7c3137301b ⬆ Bump codecov/codecov-action from 2 to 3 (#5131)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-14 13:22:02 +02:00
dependabot[bot]
397a2e3484 ⬆ Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1 (#5130)
Bump dawidd6/action-download-artifact from 2.9.0 to 2.21.1

Bumps [dawidd6/action-download-artifact](https://github.com/dawidd6/action-download-artifact) from 2.9.0 to 2.21.1.
- [Release notes](https://github.com/dawidd6/action-download-artifact/releases)
- [Commits](https://github.com/dawidd6/action-download-artifact/compare/v2.9.0...v2.21.1)

---
updated-dependencies:
- dependency-name: dawidd6/action-download-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-14 13:21:37 +02:00
github-actions
2fcf044a90 📝 Update release notes 2022-07-14 11:21:27 +00:00
dependabot[bot]
ff47d50a9b ⬆ Bump actions/setup-python from 2 to 4 (#5129)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-14 13:20:51 +02:00
github-actions
43d8ebfb4d 📝 Update release notes 2022-07-14 11:20:21 +00:00
Sebastián Ramírez
c43120258f 🐛 Fix removing body from status codes that do not support it (#5145) 2022-07-14 13:19:42 +02:00
github-actions
a0fd613527 📝 Update release notes 2022-07-12 16:54:11 +00:00
Sebastián Ramírez
1d5bbe5552 👷 Add Dependabot (#5128) 2022-07-12 18:53:38 +02:00
github-actions
bea5194ffc 📝 Update release notes 2022-07-11 19:31:26 +00:00
Sebastián Ramírez
b768643577 ♻️ Move from Optional[X] to Union[X, None] for internal utils (#5124) 2022-07-11 19:30:41 +00:00
github-actions
8047230181 📝 Update release notes 2022-07-01 08:59:26 +00:00
Sebastián Ramírez
6c6382df4d 🔧 Update sponsors, remove Dropbase, add Doist (#5096) 2022-07-01 10:58:40 +02:00
github-actions
f8c875bb3f 📝 Update release notes 2022-06-25 19:50:20 +00:00
Sebastián Ramírez
d8f3e8f20d 🔧 Update sponsors, remove Classiq, add ImgWhale (#5079)
* 🔧 Update sponsors, remove Classiq, add ImgWhale

* 🔧 Update README
2022-06-25 21:49:44 +02:00
Sebastián Ramírez
1876ebc779 🔖 Release version 0.78.0 2022-05-14 14:58:04 -05:00
Sebastián Ramírez
1673b3ec11 📝 Update release notes 2022-05-14 14:53:50 -05:00
github-actions
1711403732 📝 Update release notes 2022-05-14 19:09:00 +00:00
Sebastián Ramírez
acab64b3c3 Add tests for required nonable parameters and body fields (#4907) 2022-05-14 19:08:31 +00:00
github-actions
0a8d6871fb 📝 Update release notes 2022-05-14 12:00:32 +00:00
Sebastián Ramírez
ca437cdfab 📝 Add docs recommending Union over Optional and migrate source examples (#4908)
* 📝 Add docs recommending Union over Optional

* 📝 Update docs recommending Union over Optional

* 📝 Update source examples for docs, recommend Union over Optional

* 📝 Update highlighted lines with updated source examples

* 📝 Update highlighted lines in Markdown with recent code changes

* 📝 Update docs, use Union instead of Optional

* ♻️ Update source examples to recommend Union over Optional

* 🎨 Update highlighted code in Markdown after moving from Optional to Union
2022-05-14 06:59:59 -05:00
github-actions
c5be1b0550 📝 Update release notes 2022-05-13 23:39:00 +00:00
Sebastián Ramírez
9262fa8362 Add support for not needing ... as default value in required Query(), Path(), Header(), etc. (#4906)
*  Do not require default value in Query(), Path(), Header(), etc

* 📝 Update source examples for docs with default and required values

*  Update tests with new default values and not required Ellipsis

* 📝 Update docs for Query params and update info about default value, required, Ellipsis
2022-05-13 18:38:22 -05:00
github-actions
31690dda2c 📝 Update release notes 2022-05-12 20:48:12 +00:00
Sebastián Ramírez
8b66b9ca3e 🎨 Fix default value as set in tutorial for Path Operations Advanced Configurations (#4899) 2022-05-12 20:47:31 +00:00
github-actions
975d859ac4 📝 Update release notes 2022-05-12 20:39:14 +00:00
Shahriyar Rzayev
82775f7cd0 ♻ Refactor dict value extraction to minimize key lookups fastapi/utils.py (#3139)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-12 20:38:30 +00:00
github-actions
497e5a2422 📝 Update release notes 2022-05-12 18:11:39 +00:00
Sebastián Ramírez
f31ad41dda 👷 Fix installing Material for MkDocs Insiders in CI (#4897) 2022-05-12 18:10:57 +00:00
github-actions
d75c69e01f 📝 Update release notes 2022-05-12 17:15:56 +00:00
Sebastián Ramírez
f204e8010a 👷 Add pre-commit CI instead of custom GitHub Action (#4896) 2022-05-12 17:15:13 +00:00
github-actions
bcabbf8b37 📝 Update release notes 2022-05-12 16:43:22 +00:00
Sebastián Ramírez
29df6b3e83 👷 Add pre-commit GitHub Action workflow (#4895)
Co-authored-by: pre-commit <github-actions@github.com>
2022-05-12 11:42:47 -05:00
github-actions
16f1d073db 📝 Update release notes 2022-05-12 16:16:56 +00:00
Michael Adkins
199916ac8c 📝 Add documentation for redefined path operations (#4864)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-12 11:16:16 -05:00
github-actions
4bb8ac2114 📝 Update release notes 2022-05-12 00:47:36 +00:00
Sebastián Ramírez
a5eff3b78e 🔥 Remove un-used old pending tests, already covered in other places (#4891) 2022-05-12 00:46:56 +00:00
github-actions
277a53442b 📝 Update release notes 2022-05-12 00:41:39 +00:00
Sebastián Ramírez
9cae3cdb09 🔧 Add Python formatting hooks to pre-commit (#4890) 2022-05-12 00:41:06 +00:00
github-actions
f673e64eeb 📝 Update release notes 2022-05-12 00:06:56 +00:00
Sebastián Ramírez
3d0f130ff3 🔧 Add pre-commit with first config and first formatting pass (#4888)
* 🔧 Add first pre-commit config

* 🎨 Format YAML files with pre-commit

* 🎨 Format Markdown with pre-commit

* 🎨 Format SVGs, drawio, JS, HTML with pre-commit

*  Add pre-commit to dev dependencies

* ⬇️ Extend pre-commit range to support Python 3.6
2022-05-12 00:06:16 +00:00
github-actions
9cbd42b13e 📝 Update release notes 2022-05-11 22:32:26 +00:00
Maxim Martynov
8c593a9cc9 👷 Disable CI installing Material for MkDocs in forks (#4410)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-11 17:31:52 -05:00
github-actions
f3b04a6118 📝 Update release notes 2022-05-11 21:44:52 +00:00
Matthew Evans
4fcdb31947 📝 Add OpenAPI warning to "Body - Fields" docs with extra schema extensions (#4846)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-11 16:43:47 -05:00
github-actions
1bbbdb4b7f 📝 Update release notes 2022-05-11 18:54:33 +00:00
Mário Victor Ribeiro Silva
15dd12629e 📝 Add dark mode auto switch to docs based on OS preference (#4869) 2022-05-11 13:53:57 -05:00
github-actions
0f7de452dd 📝 Update release notes 2022-05-11 18:49:56 +00:00
Lorenzo Castellino
35445828c8 📝 Update docs about Swagger UI self-hosting with newer source links (#4813)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-11 18:49:16 +00:00
github-actions
ff2daa0471 📝 Update release notes 2022-05-11 17:49:06 +00:00
jbrocher
e9098abe8c 📝 Add link to external article: Building the Poll App From Django Tutorial With FastAPI And React (#4778)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-11 17:48:25 +00:00
github-actions
062107159f 📝 Update release notes 2022-05-11 17:42:56 +00:00
水上 皓登
a38b0a7fac 🌐 Fix code examples in Japanese translation for docs/ja/docs/tutorial/testing.md (#4623)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-11 12:42:13 -05:00
github-actions
643291b9ca 📝 Update release notes 2022-05-11 17:35:38 +00:00
Samuel Borges
441f75a06c 📝 Updates links for Celery documentation (#4736)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-11 12:35:04 -05:00
github-actions
688d2db5e3 📝 Update release notes 2022-05-11 17:29:37 +00:00
hitrust
99a41e7f8d ✏ Fix example code with sets in tutorial for body nested models (#3030)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-11 17:29:02 +00:00
github-actions
d71b12f323 📝 Update release notes 2022-05-11 17:05:24 +00:00
Kinuax
cb5a200a7c ✏ Fix links to Pydantic docs (#4670)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-11 17:03:41 +00:00
Sebastián Ramírez
2aaac141dd 🔖 Release version 0.77.1 2022-05-09 23:19:32 -05:00
Sebastián Ramírez
03cbdd4f74 📝 Update release notes 2022-05-09 23:18:03 -05:00
github-actions
a7e659e472 📝 Update release notes 2022-05-10 04:12:55 +00:00
Maciej Kaczkowski
350745c545 🌐 Add Polish translation for docs/pl/docs/tutorial/index.md (#4516)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 04:12:18 +00:00
github-actions
d0e4015034 📝 Update release notes 2022-05-10 04:08:22 +00:00
Mohammad Raisul ISlam
b1e691091d ✏ Fix typo in deployment (#4629)
Co-authored-by: raisul1234 <raisul.islam@myalice.ai>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 04:07:45 +00:00
github-actions
9b4e6751bb 📝 Update release notes 2022-05-10 04:06:19 +00:00
github-actions
8082b45f24 📝 Update release notes 2022-05-10 04:05:48 +00:00
Mateus José
86c459d1e8 🌐 Add Portuguese translation for docs/pt/docs/help-fastapi.md (#4583)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 04:05:45 +00:00
Felix Schürmeyer
2a91ee945d 📝 Add link to german article: REST-API Programmieren mittels Python und dem FastAPI Modul (#4624)
A beginner article in German to get started with the FastAPI with a small Todo API as an example.

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 04:05:10 +00:00
github-actions
764703cc56 📝 Update release notes 2022-05-10 04:03:35 +00:00
Sebastián Ramírez
71ea5883cd 🔧 Add notifications in issue for Uzbek translations (#4884) 2022-05-10 04:02:55 +00:00
github-actions
cc51b251dd 📝 Update release notes 2022-05-10 03:35:53 +00:00
Kiko Ilievski
6337186ff4 ✏ Fix small typo in docs/en/docs/tutorial/security/first-steps.md (#4515)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 03:35:21 +00:00
github-actions
88606940f5 📝 Update release notes 2022-05-10 03:34:23 +00:00
Mukul Mantosh
98bb5480a5 📝 Add external link: PyCharm Guide to FastAPI (#4512)
Co-authored-by: Mukul Mantosh <Mukul.Mantosh@in.bosch.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 03:33:51 +00:00
github-actions
170123a41f 📝 Update release notes 2022-05-10 03:32:54 +00:00
Yashasvi Singh
9262a699f2 📝 Add external link to article: Building an API with FastAPI and Supabase and Deploying on Deta (#4440)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 03:32:21 +00:00
github-actions
9a87c6d8d2 📝 Update release notes 2022-05-10 03:23:03 +00:00
Marcelo Trylesinski
f396912043 ⬆ Upgrade Starlette from 0.19.0 to 0.19.1 (#4819)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 03:22:26 +00:00
Sebastián Ramírez
0696454445 🔖 Release version 0.77.0 2022-05-09 20:40:03 -05:00
Sebastián Ramírez
a145d3d277 📝 Update release notes 2022-05-09 20:39:10 -05:00
github-actions
453471d07b 📝 Update release notes 2022-05-10 01:33:38 +00:00
github-actions
938b1a3542 📝 Update release notes 2022-05-10 01:33:06 +00:00
silvanmelchior
4ce27b5d4d 📝 Add external link to article: Seamless FastAPI Configuration with ConfZ (#4414)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 01:33:05 +00:00
Kaustubh Gupta
f9134fe5e4 📝 Add external link to article: 5 Advanced Features of FastAPI You Should Try (#4436) 2022-05-09 20:32:32 -05:00
github-actions
d8ca285f8d 📝 Update release notes 2022-05-10 01:31:28 +00:00
Rob Gilton
1233a7d93b ✏ Reword to improve legibility of docs about TestClient (#4389)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 01:30:38 +00:00
github-actions
38902407c0 📝 Update release notes 2022-05-10 01:26:01 +00:00
Yue Chen
4fa0cd4def 🌐 Update source example highlights for docs/zh/docs/tutorial/query-params-str-validations.md (#4237)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 01:25:28 +00:00
github-actions
edd38c0230 📝 Update release notes 2022-05-10 01:22:07 +00:00
Ben Gamble
8f90e514f4 📝 Add external link to blog post about Kafka, FastAPI, and Ably (#4044)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 01:21:29 +00:00
github-actions
fa1ffa5677 📝 Update release notes 2022-05-10 01:08:12 +00:00
alm
c0d6865c10 🌐 Remove translation docs references to aiofiles as it's no longer needed since AnyIO (#3594)
Co-authored-by: AlonMenczer <alonm@spotnix.io>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 20:07:37 -05:00
github-actions
8a353ab911 📝 Update release notes 2022-05-10 00:39:57 +00:00
Patryk Cisek
262183b534 ✏ Fix typo in docs/en/docs/async.md (#4726)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 00:39:23 +00:00
github-actions
faf7ce5af5 📝 Update release notes 2022-05-10 00:36:22 +00:00
Cleo Menezes Jr
3d201623dd 🌐 Fix typo in Portuguese translation for docs/pt/docs/tutorial/path-params.md (#4722)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 00:35:48 +00:00
github-actions
59fbdefd7f 📝 Update release notes 2022-05-10 00:27:42 +00:00
wakabame
e5980a71c2 🌐 Fix live docs server for translations for some languages (#4729)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 00:27:05 +00:00
github-actions
0d1be46481 📝 Update release notes 2022-05-10 00:10:27 +00:00
Lucas Mendes
4fa4432173 🌐 Add Portuguese translation for docs/pt/docs/tutorial/cookie-params.md (#4112)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-10 00:09:54 +00:00
github-actions
c9eda31dd6 📝 Update release notes 2022-05-09 23:55:47 +00:00
github-actions
f2bc805113 📝 Update release notes 2022-05-09 23:55:28 +00:00
Sam Courtemanche
8fc4872c1b 🌐 Fix French translation for docs/tutorial/body.md (#4332) 2022-05-09 18:55:11 -05:00
William Poetra Yoga
b017a33ebd ✏ Fix typo in docs/en/docs/tutorial/sql-databases.md (#4875) 2022-05-09 18:54:51 -05:00
github-actions
424674a082 📝 Update release notes 2022-05-09 23:54:33 +00:00
Sho Nakamura
944f06a901 🌐 Add Japanese translation for docs/ja/docs/advanced/conditional-openapi.md (#2631)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 23:54:00 +00:00
github-actions
3279ef38ed 📝 Update release notes 2022-05-09 23:48:40 +00:00
a-takahashi223
d286e6a5be 🌐 Fix Japanese translation of docs/ja/docs/tutorial/body.md (#3062)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 23:48:07 +00:00
github-actions
b1c5b64c2c 📝 Update release notes 2022-05-09 23:45:05 +00:00
Izabela Guerreiro
2ef0b9896e 🌐 Add Portuguese translation for docs/pt/docs/tutorial/background-tasks.md (#2170)
Co-authored-by: Lorhan Sohaky <16273730+LorhanSohaky@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 23:44:32 +00:00
github-actions
d07422a07a 📝 Update release notes 2022-05-09 18:35:27 +00:00
Lucas
8724c493d9 🌐 Add Portuguese translation for docs/deployment/deta.md (#4442)
Co-authored-by: Lorhan Sohaky <contato+gi74@lorhan.me>
Co-authored-by: Izabela Guerreiro <izaguerreiro@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 18:34:42 +00:00
github-actions
df50d7c13f 📝 Update release notes 2022-05-09 18:30:57 +00:00
Makarov Andrey
e0962d0b54 🌐 Add Russian translation for docs/async.md (#4036)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 18:30:19 +00:00
github-actions
b7d5746773 📝 Update release notes 2022-05-09 18:26:23 +00:00
Leandro de Souza
3005c8c7b9 🌐 Add Portuguese translation for docs/tutorial/body.md (#3960)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: Lucas <61513630+lsglucas@users.noreply.github.com>
Co-authored-by: Leandro de Souza <leandro.souza@fontes.corp>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 18:25:41 +00:00
github-actions
260d97ec6f 📝 Update release notes 2022-05-09 18:20:27 +00:00
Luccas Mateus
f4620c42cf 🌐 Add Portuguese translation of tutorial/extra-data-types.md (#4077)
Co-authored-by: Lorhan Sohaky <16273730+LorhanSohaky@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 18:19:49 +00:00
github-actions
65ed4b5433 📝 Update release notes 2022-05-09 18:16:44 +00:00
Jonas Mueller
12342888d6 🌐 Update German translation for docs/features.md (#3905)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 13:16:02 -05:00
github-actions
ee4e27a94f 📝 Update release notes 2022-05-09 18:07:21 +00:00
Marcelo Trylesinski
86fa3cb24f ⬆ Upgrade Starlette from 0.18.0 to 0.19.0 (#4488)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-09 13:06:42 -05:00
Sebastián Ramírez
9090c771ee 🔖 Release version 0.76.0 2022-05-05 17:26:05 -05:00
Sebastián Ramírez
8df8b037f2 📝 Update release notes 2022-05-05 17:25:14 -05:00
github-actions
792285a047 📝 Update release notes 2022-05-05 22:22:57 +00:00
github-actions[bot]
66f6344820 👥 Update FastAPI People (#4847)
Co-authored-by: github-actions <github-actions@github.com>
2022-05-05 17:22:25 -05:00
github-actions
b44e85ca8a 📝 Update release notes 2022-05-05 22:20:33 +00:00
Marcelo Trylesinski
33d61430cf ⬆ Upgrade Starlette from 0.17.1 to 0.18.0 (#4483)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-05-05 17:19:59 -05:00
github-actions
146f57b8f7 📝 Update release notes 2022-04-25 10:02:17 +00:00
Sebastián Ramírez
1920c3dd16 🔧 Add Budget Insight sponsor (#4824) 2022-04-25 10:01:39 +00:00
github-actions
07b12c8e41 📝 Update release notes 2022-04-24 15:53:04 +00:00
Sebastián Ramírez
4642d5bb86 🍱 Update sponsor, ExoFlare badge (#4822) 2022-04-24 15:52:31 +00:00
github-actions
0fd99ec337 📝 Update release notes 2022-04-24 15:31:48 +00:00
Sebastián Ramírez
7c8383c96b 🔧 Update sponsors, enable Dropbase again, update TalkPython link (#4821) 2022-04-24 17:31:12 +02:00
Sebastián Ramírez
2b54432a9c 🔖 Release version 0.75.2 2022-04-17 23:08:37 +02:00
Sebastián Ramírez
acd2287b57 📝 Update release notes 2022-04-17 23:07:27 +02:00
github-actions
1d106bd959 📝 Update release notes 2022-04-17 21:01:21 +00:00
Sebastián Ramírez
77fc14eb69 🔧 Update sponsors, add: ExoFlare, Ines Course; remove: Dropbase, Vim.so, Calmcode; update: Striveworks, TalkPython and TestDriven.io (#4805) 2022-04-17 23:00:49 +02:00
github-actions
41d75b6d1c 📝 Update release notes 2022-04-17 20:56:09 +00:00
Sebastián Ramírez
ddd9da3db4 Fix new/recent tests with new fixed ValidationError JSON Schema (#4806) 2022-04-17 20:55:36 +00:00
Sebastián Ramírez
197c1d6dd7 📝 Update release notes 2022-04-17 21:02:49 +02:00
github-actions
d9e7a541fd 📝 Update release notes 2022-04-17 17:42:18 +00:00
dconathan
c449ae5c74 🐛 Fix JSON Schema for ValidationError at field loc (#3810)
Co-authored-by: Devin Conathan <dconatha@amfam.com>
2022-04-17 19:41:46 +02:00
github-actions
1d8d81a6d5 📝 Update release notes 2022-04-17 17:22:26 +00:00
Marcelo Trylesinski
d81c908132 🐛 Fix support for prefix on APIRouter WebSockets (#2640)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-04-17 19:21:53 +02:00
github-actions
cb4da93643 📝 Update release notes 2022-04-17 16:18:35 +00:00
Sebastián Ramírez
3cbfae16cf ⬆️ Update ujson ranges for CVE-2021-45958 (#4804) 2022-04-17 16:17:59 +00:00
github-actions
0def8382b8 📝 Update release notes 2022-04-17 15:52:12 +00:00
Sebastián Ramírez
02fae6a38e ⬆️ Upgrade dependencies upper range for extras "all" (#4803) 2022-04-17 15:51:42 +00:00
Sebastián Ramírez
75af472029 📝 Update release notes 2022-04-17 16:55:37 +02:00
github-actions
e1135eddb5 📝 Update release notes 2022-04-17 14:47:55 +00:00
Alan Wright
acf8a91c25 ⬆ Upgrade Swagger UI - swagger-ui-dist@4 (#4347)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-04-17 14:47:14 +00:00
github-actions
c4f361c0c4 📝 Update release notes 2022-04-16 08:18:43 +00:00
Sebastián Ramírez
cc57bfcf60 ⬆️ Upgrade Codecov GitHub Action (#4801) 2022-04-16 08:18:08 +00:00
Sebastián Ramírez
26f725d259 🔖 Release version 0.75.1 2022-04-01 18:05:52 -05:00
Sebastián Ramírez
9e018c322c 📝 Update release notes 2022-04-01 18:05:06 -05:00
github-actions
3fefc83d42 📝 Update release notes 2022-04-01 23:02:53 +00:00
github-actions
2c31667407 📝 Update release notes 2022-04-01 23:02:28 +00:00
github-actions[bot]
233214795a 👥 Update FastAPI People (#4752)
Co-authored-by: github-actions <github-actions@github.com>
2022-04-01 18:02:17 -05:00
Sebastián Ramírez
e1d0e3874b Temporarily remove typer-cli from dependencies and upgrade Black (#4754) 2022-04-01 23:01:51 +00:00
github-actions
eddbae948f 📝 Update release notes 2022-03-18 16:48:49 +00:00
Sebastián Ramírez
5c842586c2 🌐 Start Dutch translations (#4703) 2022-03-18 16:47:54 +00:00
github-actions
fc96370ce3 📝 Update release notes 2022-03-18 16:37:49 +00:00
Sebastián Ramírez
d820267cde 🔧 Add configuration to notify Dutch translations (#4702) 2022-03-18 16:37:14 +00:00
github-actions
bd94d313c9 📝 Update release notes 2022-03-18 16:24:54 +00:00
Amin Alaee
2b6f1585ec 🌐 Start Persian/Farsi translations (#4243)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-03-18 16:24:19 +00:00
github-actions
bab5c201da 📝 Update release notes 2022-03-17 20:25:09 +00:00
Sarmast Bilawal Khuhro
aec2d26bac ✏ Reword sentence about handling errors (#1993)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-03-17 20:24:34 +00:00
github-actions
d5d6eebd40 📝 Update release notes 2022-03-17 20:20:21 +00:00
github-actions[bot]
7982aa5143 👥 Update FastAPI People (#4699)
Co-authored-by: github-actions <github-actions@github.com>
2022-03-17 15:19:43 -05:00
github-actions
fd6ce67392 📝 Update release notes 2022-03-17 18:36:57 +00:00
Sebastián Ramírez
d3eb787090 🐛 Fix FastAPI People generation to include missing file in commit (#4695) 2022-03-17 18:36:21 +00:00
github-actions
6125dc72cd 📝 Update release notes 2022-03-15 15:48:22 +00:00
Sebastián Ramírez
cf8b40e660 🔧 Update Classiq sponsor links (#4688) 2022-03-15 15:47:36 +00:00
github-actions
fab2a765de 📝 Update release notes 2022-03-10 02:30:13 +00:00
Sebastián Ramírez
9aa698aa67 🔧 Add Classiq sponsor (#4671) 2022-03-09 21:29:40 -05:00
Sebastián Ramírez
87e29ec2c5 📝 Update release notes 2022-03-05 19:52:18 +01:00
github-actions
abd148f63a 📝 Update release notes 2022-03-05 18:49:46 +00:00
Sebastián Ramírez
9f38a05954 📝 Add Jina's QA Bot to the docs to help people that want to ask quick questions (#4655)
Co-authored-by: yanlong.wang <yanlong.wang@naiver.org>
2022-03-05 19:49:15 +01:00
Sebastián Ramírez
c89dc736bd 📝 Update release notes 2022-03-04 23:11:21 +01:00
Sebastián Ramírez
19769d0483 🔖 Release version 0.75.0 2022-03-04 23:09:11 +01:00
Sebastián Ramírez
586d17bfb5 📝 Update release notes 2022-03-04 23:08:06 +01:00
github-actions
786b5858e5 📝 Update release notes 2022-03-04 22:02:55 +00:00
Sebastián Ramírez
8a0d4c79c1 Add support for custom generate_unique_id_function and docs for generating clients (#4650) 2022-03-04 23:02:18 +01:00
Sebastián Ramírez
440d2d2d1a 🔖 Release version 0.74.1 2022-02-21 16:54:18 +01:00
github-actions
e953059054 📝 Update release notes 2022-02-21 15:52:03 +00:00
Sebastián Ramírez
f5d7df3c6c Include route in scope to allow middleware and other tools to extract its information (#4603) 2022-02-21 16:51:26 +01:00
Sebastián Ramírez
1ce16c2f40 🔖 Release version 0.74.0 2022-02-17 17:08:23 +01:00
Sebastián Ramírez
03d4d4c38e 📝 Update release notes 2022-02-17 17:05:38 +01:00
github-actions
2d2f1dee5d 📝 Update release notes 2022-02-17 14:18:35 +00:00
Sebastián Ramírez
59e36481dc 🔧 Add Striveworks sponsor (#4596) 2022-02-17 14:18:01 +00:00
github-actions
4fcb00328c 📝 Update release notes 2022-02-17 12:40:46 +00:00
Sebastián Ramírez
9d56a3cb59 Update internal AsyncExitStack to fix context for dependencies with yield (#4575) 2022-02-17 13:40:12 +01:00
github-actions
78b07cb809 📝 Update release notes 2022-02-13 17:19:09 +00:00
Sebastián Ramírez
6034f80687 💚 Only build docs on push when on master to avoid duplicate runs from PRs (#4564) 2022-02-13 18:18:38 +01:00
github-actions
b93f8a709a 📝 Update release notes 2022-02-01 14:28:16 +00:00
github-actions[bot]
618c99d774 👥 Update FastAPI People (#4502)
Co-authored-by: github-actions <github-actions@github.com>
2022-02-01 15:27:34 +01:00
Sebastián Ramírez
291180bf2d 🔖 Release version 0.73.0 2022-01-23 23:38:51 +01:00
Sebastián Ramírez
cbe8d552c1 📝 Update release notes 2022-01-23 23:37:48 +01:00
github-actions
af18d5c49f 📝 Update release notes 2022-01-23 22:14:28 +00:00
Victor Benichoux
a698908ed6 🐛 Fix bug preventing to use OpenAPI when using tuples (#3874)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-01-23 23:13:55 +01:00
github-actions
dba9ea8120 📝 Update release notes 2022-01-23 21:31:08 +00:00
Sebastián Ramírez
f8d4d04015 📝 Tweak and improve docs for Request Files (#4470) 2022-01-23 21:30:35 +00:00
github-actions
5a864d8261 📝 Update release notes 2022-01-23 19:14:47 +00:00
Sebastián Ramírez
1bf55200a9 Add support for declaring UploadFile parameters without explicit File() (#4469) 2022-01-23 19:14:13 +00:00
github-actions
59b1f353b3 📝 Update release notes 2022-01-23 17:43:36 +00:00
Sebastián Ramírez
569afb4378 Add support for tags with Enums (#4468) 2022-01-23 18:43:04 +01:00
Sebastián Ramírez
0f8349fcb7 📝 Update release notes 2022-01-23 18:03:42 +01:00
github-actions
6215fdd39e 📝 Update release notes 2022-01-23 16:34:52 +00:00
Vivek Sunder
94ca8c1e29 🐛 Prefer custom encoder over defaults if specified in jsonable_encoder (#2061)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-01-23 17:34:18 +01:00
github-actions
f4963f05bf 📝 Update release notes 2022-01-23 16:32:35 +00:00
Sebastián Ramírez
d4608a00cf 🐛 Prefer custom encoder over defaults if specified in jsonable_encoder (#4467)
Co-authored-by: Vivek Sunder <sviveksunder@gmail.com>
2022-01-23 17:32:04 +01:00
github-actions
699b5ef841 📝 Update release notes 2022-01-23 16:14:28 +00:00
Sebastián Ramírez
3de0fb82bf 🐛 Fix docs dependencies cache, to get the latest Material for MkDocs (#4466) 2022-01-23 17:13:49 +01:00
github-actions
85518bc58b 📝 Update release notes 2022-01-23 15:55:36 +00:00
Mark
ca5d57ea79 Allow hiding from OpenAPI (and Swagger UI) Query, Cookie, Header, and Path parameters (#3144)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-01-23 16:54:59 +01:00
github-actions
347e391271 📝 Update release notes 2022-01-23 14:56:44 +00:00
Sebastián Ramírez
a75d080124 🔧 Add sponsor Dropbase (#4465) 2022-01-23 15:56:14 +01:00
Sebastián Ramírez
f0388915a8 🔖 Release version 0.72.0 2022-01-16 21:09:10 +01:00
Sebastián Ramírez
9e2f5c67b6 📝 Update release notes 2022-01-16 21:08:04 +01:00
github-actions
93e4a19e35 📝 Update release notes 2022-01-16 19:42:33 +00:00
jaystone776
e1c6d7d310 🌐 Update Chinese translation for docs/help-fastapi.md (#3847) 2022-01-16 20:41:59 +01:00
github-actions
d23b295b96 📝 Update release notes 2022-01-16 19:41:49 +00:00
kty4119
26e94116c1 🌐 Fix Korean translation for docs/ko/docs/index.md (#4195)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-01-16 19:41:13 +00:00
github-actions
24968937e5 📝 Update release notes 2022-01-16 19:37:21 +00:00
MicroPanda123
5c5b889288 🌐 Add Polish translation for docs/pl/docs/index.md (#4245)
Co-authored-by: Dawid Dutkiewicz <dutkiewicz@users.noreply.github.com>
Co-authored-by: Dima Tisnek <dimaqq@gmail.com>
Co-authored-by: Bart Skowron <bxsx@bartskowron.com>
Co-authored-by: Bart Skowron <bart.skowron@rollbar.com>
2022-01-16 19:36:42 +00:00
github-actions
436261b3ea 📝 Update release notes 2022-01-16 19:35:00 +00:00
jaystone776
5c62a59e7b 🌐 Add Chinese translation for docs\tutorial\path-operation-configuration.md (#3312)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-01-16 19:34:28 +00:00
github-actions
acbe79da37 📝 Update release notes 2022-01-16 19:27:03 +00:00
John Riebold
a85aa125d2 Enable configuring Swagger UI parameters (#2568)
Co-authored-by: Artem Ivanov <artem@worklife.io>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2022-01-16 20:26:24 +01:00
github-actions
9af8cc69d5 📝 Update release notes 2022-01-16 14:44:43 +00:00
Sebastián Ramírez
7fe79441c1 📝 Update Python Types docs, add missing 3.6 / 3.9 example (#4434) 2022-01-16 15:44:08 +01:00
github-actions
b8ae84d460 📝 Update release notes 2022-01-16 14:35:21 +00:00
Sebastián Ramírez
ca2b1dbb64 🔧 Enable MkDocs Material Insiders' content.tabs.link (#4399) 2022-01-16 14:34:45 +00:00
Sebastián Ramírez
672c55ac62 🔖 Release version 0.71.0 2022-01-07 18:07:59 +01:00
github-actions
66c27c3e07 📝 Update release notes 2022-01-07 14:19:23 +00:00
github-actions[bot]
44f4885c66 👥 Update FastAPI People (#4354)
Co-authored-by: github-actions <github-actions@github.com>
2022-01-07 15:18:45 +01:00
github-actions
4da33e3031 📝 Update release notes 2022-01-07 14:17:49 +00:00
Sebastián Ramírez
a1ede32f29 🔧 Add FastAPI Trove Classifier for PyPI (#4386) 2022-01-07 14:17:13 +00:00
github-actions
0a82b3a900 📝 Update release notes 2022-01-07 14:12:16 +00:00
Sebastián Ramírez
d08a062ee2 Add docs and tests for Python 3.9 and Python 3.10 (#3712)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-01-07 15:11:31 +01:00
github-actions
83f6781037 📝 Update release notes 2022-01-07 10:24:43 +00:00
Sebastián Ramírez
764ecae2d4 ⬆ Upgrade MkDocs Material and configs (#4385) 2022-01-07 11:24:00 +01:00
github-actions
4e9f75912f 📝 Update release notes 2022-01-07 09:35:10 +00:00
simondale00
2b10ca1cc4 ⬆️ Upgrade Starlette to 0.17.1 (#4145)
Co-authored-by: Dima Tisnek <dimaqq@gmail.com>
Co-authored-by: simond <simond@surveymonkey.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2022-01-07 10:34:28 +01:00
Sebastián Ramírez
3efb4f7edf 🔖 Release version 0.70.1 2021-12-12 12:39:32 +01:00
github-actions
9c25f9615c 📝 Update release notes 2021-12-12 11:34:58 +00:00
github-actions[bot]
e7158bc592 👥 Update FastAPI People (#4274)
Co-authored-by: github-actions <github-actions@github.com>
2021-12-12 12:34:18 +01:00
github-actions
6d642ef5fb 📝 Update release notes 2021-12-12 11:29:36 +00:00
Eric Jolibois
b0cd4d7e7e 🐛 Fix JSON Schema for dataclasses, supporting the fixes in Pydantic 1.9 (#4272)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-12-12 12:28:35 +01:00
github-actions
0a87bc88b8 📝 Update release notes 2021-12-09 10:48:10 +00:00
Nina Hwang
062efcbb5d 🌐 Add Korean translation for docs/tutorial/request-forms-and-files.md (#3744)
Co-authored-by: weekwith.me <63915557+0417taehyun@users.noreply.github.com>
2021-12-09 11:47:26 +01:00
github-actions
aa4a69f790 📝 Update release notes 2021-12-09 10:45:00 +00:00
github-actions
eb79441a7f 📝 Update release notes 2021-12-09 10:40:14 +00:00
Nina Hwang
fa5639cb35 🌐 Add Korean translation for docs/tutorial/request-files.md (#3743)
Co-authored-by: Spike <rurouni24@gmail.com>
Co-authored-by: weekwith.me <63915557+0417taehyun@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-12-08 15:52:01 +00:00
Leandro de Souza
10e3a02582 🌐 Add portuguese translation for docs/tutorial/query-params-str-validations.md (#3965)
Co-authored-by: Mário Victor Ribeiro Silva <mariovictorrs@gmail.com>
Co-authored-by: Leandro de Souza <leandro.souza@fontes.corp>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-12-08 16:50:35 +01:00
github-actions
fb9c4b31b9 📝 Update release notes 2021-12-08 15:46:19 +00:00
Nina Hwang
39dbee9d56 🌐 Add Korean translation for docs/tutorial/response-status-code.md (#3742)
Co-authored-by: weekwith.me <63915557+0417taehyun@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-12-08 16:45:37 +01:00
github-actions
dd463d0dc2 📝 Update release notes 2021-12-08 15:44:10 +00:00
Kwang Soo Jeong
461e0d4cce 🌐 Add Korean translation for Tutorial - JSON Compatible Encoder (#3152) 2021-12-08 16:43:31 +01:00
github-actions
da69a1c4c0 📝 Update release notes 2021-12-08 15:42:12 +00:00
Spike
a5d697b9b5 🌐 Add Korean translation for Tutorial - Path Parameters and Numeric Validations (#2432) 2021-12-08 16:41:26 +01:00
github-actions
8e416875ce 📝 Update release notes 2021-12-08 15:38:10 +00:00
daehyeon kim
446d194c46 🌐 Add Korean translation for docs/ko/docs/deployment/versions.md (#4121)
Co-authored-by: weekwith.me <63915557+0417taehyun@users.noreply.github.com>
2021-12-08 16:37:30 +01:00
github-actions
cace5a79f7 📝 Update release notes 2021-12-08 15:33:09 +00:00
kimjaeyoonn
dabb4898f1 🌐 Fix Korean translation for docs/ko/docs/tutorial/index.md (#4193) 2021-12-08 15:32:24 +00:00
github-actions
f282c0e207 📝 Update release notes 2021-12-08 15:04:50 +00:00
Sebastián Ramírez
146ff28d9c 🔧 Add CryptAPI sponsor (#4264) 2021-12-08 15:04:04 +00:00
github-actions
58ab733f19 📝 Update release notes 2021-10-26 18:54:22 +00:00
weekwith.me
0a61a6c865 📝 Update docs/tutorial/dependencies/classes-as-dependencies: Add type of query parameters in a description of Classes as dependencies (#4015) 2021-10-26 18:53:40 +00:00
github-actions
fb1f341231 📝 Update release notes 2021-10-26 18:47:42 +00:00
Sam Courtemanche
652cf4bb6b 🌐 Add French translation for Tutorial - First steps (#3455)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-26 18:47:01 +00:00
github-actions
08410ca568 📝 Update release notes 2021-10-26 18:34:11 +00:00
Sam Courtemanche
0d5e0ba5d5 🌐 Add French translation for docs/tutorial/path-params.md (#3548)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-26 18:33:34 +00:00
github-actions
b2c9574fc6 📝 Update release notes 2021-10-26 18:16:12 +00:00
Sam Courtemanche
a859497a72 🌐 Add French translation for docs/tutorial/query-params.md (#3556)
Co-authored-by: Ruidy <ruidy.nemausat@gmail.com>
2021-10-26 20:15:30 +02:00
github-actions
3c93e803d5 📝 Update release notes 2021-10-26 18:14:17 +00:00
bilal alpaslan
0bd8f901df 🌐 Add Turkish translation for docs/python-types.md (#3926) 2021-10-26 20:13:34 +02:00
Sebastián Ramírez
864643ef76 📝 Update release notes 2021-10-07 19:38:36 +02:00
Sebastián Ramírez
5d80e02ae8 🔖 Release version 0.70.0 2021-10-07 19:34:27 +02:00
Sebastián Ramírez
affe542753 📝 Update release notes 2021-10-07 19:33:35 +02:00
github-actions
8e887d7145 📝 Update release notes 2021-10-07 17:21:11 +00:00
Sebastián Ramírez
46cf92c55a ⬆️ Upgrade Starlette to 0.16.0 (#4016) 2021-10-07 19:20:30 +02:00
Sebastián Ramírez
921b6f742a 🔖 Release version 0.69.0 2021-10-07 18:45:43 +02:00
Sebastián Ramírez
c1fee263e1 📝 Update release notes 2021-10-07 18:43:50 +02:00
github-actions
42d10ef4bf 📝 Update release notes 2021-10-07 16:22:27 +00:00
Thomas Grainger
637cf89dbd 🔧 Correct DeprecationWarning config and comment in pytest settings (#4008)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 18:21:46 +02:00
github-actions
a81e2f20a5 📝 Update release notes 2021-10-07 16:15:21 +00:00
Andy Challis
53076170c0 ✏ Fix typos in Deployment Guide (#3975)
Co-authored-by: Anthony Lukach <anthonylukach@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 18:14:39 +02:00
github-actions
eb89968b36 📝 Update release notes 2021-10-07 15:58:17 +00:00
tomwei7
c54fb7e208 📝 Update docs with pip install calls when using extras with brackets, use quotes for compatibility with Zsh (#3131)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 17:57:38 +02:00
github-actions
077e5baf2c 📝 Update release notes 2021-10-07 15:56:18 +00:00
Kaustubh Gupta
9c6e0d02bb 📝 Add external link to article: Deploying ML Models as API Using FastAPI and Heroku (#3904)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 17:55:40 +02:00
github-actions
d198f38b45 📝 Update release notes 2021-10-07 15:45:28 +00:00
Nina Hwang
4ba1e81f16 ✏ Fix typo in file paths in docs/en/docs/contributing.md (#3752)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 17:44:46 +02:00
Jorge Alvarado
b1508dcacc ✏ Re-word and combine 2 paragraphs into 1 for readability (#3346) 2021-10-07 17:39:19 +02:00
github-actions
bb20f5e60d 📝 Update release notes 2021-10-07 15:30:34 +00:00
SaintMalik
7e4887ea55 ✏ Fix a typo in docs/en/docs/advanced/path-operation-advanced-configuration.md and docs/en/docs/release-notes.md (#3750)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 15:29:50 +00:00
github-actions
ffaecddbf6 📝 Update release notes 2021-10-07 14:37:59 +00:00
Jorge Alvarado
e43f434448 ✏️ Add a missing comma in the security tutorial (#3564)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 14:36:43 +00:00
github-actions
eb453a50b8 📝 Update release notes 2021-10-07 14:23:26 +00:00
jaystone776
5a28f95a93 ✏ Fix typo in docs/en/docs/help-fastapi.md (#3760)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 14:22:16 +00:00
github-actions
4093c35058 📝 Update release notes 2021-10-07 14:09:05 +00:00
Denys Marichev
7efdc11075 ✏ Fix typo about file path in docs/en/docs/tutorial/bigger-applications.md (#3285)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 14:07:46 +00:00
github-actions
24cda290e8 📝 Update release notes 2021-10-07 13:59:14 +00:00
Bharat Raghunathan
d06b4d7bb8 ✏ Re-word to clarify test client in docs/en/docs/tutorial/testing.md (#3382)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 13:57:51 +00:00
github-actions
1a8284725a 📝 Update release notes 2021-10-07 13:32:54 +00:00
Pax
4f168c5ada 📝 Fix incorrect highlighted code (#3325)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 13:32:14 +00:00
github-actions
b67532ee5c 📝 Update release notes 2021-10-07 13:27:16 +00:00
Edd Salkield
c29aa0bc87 🔧 Swap light/dark theme button icon (#3246)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 15:26:36 +02:00
github-actions
5551e7282c 📝 Update release notes 2021-10-07 13:14:08 +00:00
Somraj Saha
8e68ddbddf 📝 Add external link to article: How-to deploy FastAPI app to Heroku (#3241)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 13:13:10 +00:00
github-actions
46882b9ae1 📝 Update release notes 2021-10-07 13:07:24 +00:00
mori yuta
e423c8241a ✏ Fix link in Japanese docs for docs/ja/docs/deployment/docker.md (#3245)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 15:06:17 +02:00
github-actions
3581034eff 📝 Update release notes 2021-10-07 13:01:11 +00:00
Abraham Hinteregger
b69781b161 ✏ Fix typo (mistranslation) in docs/en/docs/advanced/templates.md (#3211)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 13:00:33 +00:00
github-actions
12db3926b5 📝 Update release notes 2021-10-07 12:57:15 +00:00
Greg Gandenberger
afe1f69e79 📝 Remove note about (now supported) feature from Swagger UI in docs/en/docs/tutorial/request-files.md (#2803)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 12:55:51 +00:00
raphaelauv
426bd096ad 📝 Update note about Falcon and ASGI, as now Falcon is also ASGI 🎉 (#3073)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 12:44:39 +00:00
Vijay Yarramsetty
0ceacef413 ✏ Fix typo in docs/en/docs/tutorial/body-nested-models.md (#2808)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 12:30:25 +00:00
github-actions
fee3126d3a 📝 Update release notes 2021-10-07 12:27:41 +00:00
Hasan Ramezani
8f4e3a4377 📝 Add supported Python versions badge (#2794)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 12:26:57 +00:00
github-actions
3b686c3774 📝 Update release notes 2021-10-07 12:22:16 +00:00
graue70
17f0ec8927 ✏ Fix typo re-word in docs/tutorial/handling-errors.md (#2700)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-07 12:21:34 +00:00
github-actions
a6ef62ce7b 📝 Update release notes 2021-10-07 10:36:53 +00:00
Sebastián Ramírez
d9fa2311b3 📝 Add docs for using Trio with Hypercorn (#4014) 2021-10-07 10:36:09 +00:00
github-actions
c15f042318 📝 Update release notes 2021-10-06 15:43:37 +00:00
Sebastián Ramírez
a8bde38f7c Remove graphene as an optional dependency (#4007) 2021-10-06 15:42:55 +00:00
github-actions
496ccc0f70 📝 Update release notes 2021-10-06 15:32:53 +00:00
Thomas Grainger
11d0a08acd Add support for Trio via AnyIO (#3372)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-06 17:32:11 +02:00
github-actions
4d26fa5c54 📝 Update release notes 2021-10-06 15:09:36 +00:00
Sebastián Ramírez
eb1d68c789 🔧 Lint only in Python 3.7 and above (#4006) 2021-10-06 15:08:57 +00:00
github-actions
292b8c8ce9 📝 Update release notes 2021-10-05 16:10:28 +00:00
Sebastián Ramírez
cce8d9e32c 🔧 Add GitHub Action notify-translations config for Azerbaijani (#3995) 2021-10-05 16:09:45 +00:00
github-actions
ac0f594305 📝 Update release notes 2021-10-05 16:08:13 +00:00
Madat Bay
cc0d0f3899 🌐 Initialize Azerbaijani translations (#3941)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 16:07:25 +00:00
github-actions
67d5ba1efd 📝 Update release notes 2021-10-05 15:53:54 +00:00
bilal alpaslan
2210c84efd 🌐 Add Turkish translation for docs/fastapi-people.md (#3848)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 15:47:51 +00:00
Sebastián Ramírez
378fa4ef75 🔖 Release version 0.68.2 2021-10-05 15:32:18 +02:00
Sebastián Ramírez
eb515b1af7 📝 Re-structure release notes 2021-10-05 15:31:39 +02:00
github-actions
19fd336cde 📝 Update release notes 2021-10-05 13:02:28 +00:00
Yagiz Degirmenci
63744b2e8a 🌐 Add Turkish translation for docs/features.md (#1950)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 15:01:50 +02:00
github-actions
85f0d2b924 📝 Update release notes 2021-10-05 12:51:14 +00:00
Hüseyin Emre Armağan
507e9baf9e 🌐 Add Turkish translation for docs/benchmarks.md (#2729)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 12:50:38 +00:00
github-actions
c6461ad7dc 📝 Update release notes 2021-10-05 12:46:49 +00:00
Yagiz Degirmenci
5fbf597cd5 🌐 Add Turkish translation for docs/index.md (#1908)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 12:46:11 +00:00
github-actions
bc99d2b7b8 📝 Update release notes 2021-10-05 12:31:22 +00:00
Sam Courtemanche
0eb27ab4d0 🌐 Add French translation for docs/tutorial/body.md (#3671)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 12:30:41 +00:00
github-actions
68c43eb126 📝 Update release notes 2021-10-05 12:28:05 +00:00
Ruidy
00ac07f65c 🌐 Add French translation for deployment/docker.md (#3694)
Co-authored-by: Sam Courtemanche <smlep.pro@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 14:27:24 +02:00
github-actions
d8b0a9dc6e 📝 Update release notes 2021-10-05 12:19:45 +00:00
Felipe Silva
8c36572d23 🌐 Add Portuguese translation for docs/tutorial/path-params.md (#3664)
Co-authored-by: Mário Victor Ribeiro Silva <mariovictorrs@gmail.com>
Co-authored-by: Izabela Guerreiro <izaguerreiro@gmail.com>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: Lucas <61513630+lsglucas@users.noreply.github.com>
Co-authored-by: Felipe <dasilva.delipex93@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 12:19:03 +00:00
jaystone776
e0e3224588 🌐 Delete old Chinese translation for docs/deployment.md (#3840)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 11:03:59 +00:00
github-actions
4e2595f928 📝 Update release notes 2021-10-05 10:40:42 +00:00
Lucas
6de8748788 🌐 Add Portuguese translation for docs/deployment/https.md (#3754) 2021-10-05 12:40:05 +02:00
github-actions
39ec5b33d9 📝 Update release notes 2021-10-05 10:24:47 +00:00
Sebastián Ramírez
557fe61d92 Update GitHub Action: notify-translations, to avoid a race conditon (#3989) 2021-10-05 10:24:02 +00:00
github-actions
458a7fbf15 📝 Update release notes 2021-10-05 10:18:13 +00:00
Sebastián Ramírez
ae22bca9fe ⬆️ Upgrade development autoflake, supporting multi-line imports (#3988) 2021-10-05 10:17:31 +00:00
github-actions
9229ba8078 📝 Update release notes 2021-10-05 10:08:26 +00:00
Sebastián Ramírez
96ca425b1f ⬆️ Increase dependency ranges for tests and docs: pytest-cov, pytest-asyncio, black, httpx, sqlalchemy, databases, mkdocs-markdownextradata-plugin (#3987) 2021-10-05 10:07:40 +00:00
github-actions
c86a4e1dd3 📝 Update release notes 2021-10-05 09:55:12 +00:00
github-actions[bot]
24749aef71 👥 Update FastAPI People (#3986)
Co-authored-by: github-actions <github-actions@github.com>
2021-10-05 11:54:36 +02:00
github-actions
f6a3bc2902 📝 Update release notes 2021-10-05 09:17:56 +00:00
SnkSynthesis
ba8c78d87f ⬆Increase supported version of aiofiles to suppress warnings (#2899)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 11:17:14 +02:00
github-actions
69784e5141 📝 Update release notes 2021-10-05 08:58:41 +00:00
Filipe Laíns
8a02a47124 Do not require backports in Python >= 3.7 (#1880)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 10:58:00 +02:00
github-actions
5607c198c4 📝 Update release notes 2021-10-05 08:47:25 +00:00
Taneli Hukkinen
cf5e67590a ⬆ Upgrade required Python version to >= 3.6.1, needed by typing.Deque, used by Pydantic (#2733)
Co-authored-by: Taneli Hukkinen <hukkinj1@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 10:46:42 +02:00
github-actions
655db2af1f 📝 Update release notes 2021-10-05 08:40:44 +00:00
ArcLight_Slavik
8c102814fd ⬆ Upgrade internal testing dependencies: mypy to version 0.910, add newly needed type packages (#3350)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 10:40:08 +02:00
github-actions
189ac3e280 📝 Update release notes 2021-10-05 08:07:20 +00:00
Marcelo Trylesinski
2680f369d0 ⬆️ Bump Uvicorn max range to 0.15.0 (#3345)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-05 10:06:35 +02:00
github-actions
284eb6615d 📝 Update release notes 2021-10-03 18:14:25 +00:00
Andy Challis
099c478655 💚 Fix badges in README and main page (#3979)
Co-authored-by: Anthony Lukach <anthonylukach@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-10-03 20:13:47 +02:00
github-actions
54c02d402a 📝 Update release notes 2021-10-03 18:01:11 +00:00
Sebastián Ramírez
4b968c4e39 📝 Update GraphQL docs, recommend Strawberry (#3981) 2021-10-03 20:00:28 +02:00
github-actions
1db0fc2953 📝 Update release notes 2021-10-02 10:17:32 +00:00
Sebastián Ramírez
d29aa3d436 Add Deepset Sponsorship (#3976) 2021-10-02 12:16:55 +02:00
github-actions
1b6350ad9e 📝 Update release notes 2021-10-01 20:44:53 +00:00
Sebastián Ramírez
cb7e79ab8a 📝 Re-write and extend Deployment guide: Concepts, Uvicorn, Gunicorn, Docker, Containers, Kubernetes (#3974) 2021-10-01 22:44:19 +02:00
github-actions
fe086a4903 📝 Update release notes 2021-09-27 14:41:20 +00:00
Sebastián Ramírez
64e7deaebc 📝 Upgrade HTTPS guide with more explanations and diagrams (#3950) 2021-09-27 14:40:38 +00:00
github-actions
bee35f5ae1 📝 Update release notes 2021-09-13 17:29:47 +00:00
Maximilian Wassink
3a786a7a3a 🌐 Add German translation for docs/features.md (#3699) 2021-09-13 19:29:03 +02:00
github-actions
eaeafc32c4 📝 Update release notes 2021-09-10 14:29:04 +00:00
Sebastián Ramírez
c8b4e4d455 🎨 Tweak CSS styles for shell animations (#3888) 2021-09-10 14:28:22 +00:00
github-actions
1760da0efa 📝 Update release notes 2021-08-27 08:49:40 +00:00
Sebastián Ramírez
f49ba24b71 🔧 Add new Sponsor Calmcode.io (#3777) 2021-08-27 08:49:08 +00:00
Sebastián Ramírez
7b6e198d31 🔖 Release version 0.68.1 2021-08-24 14:16:09 +02:00
Sebastián Ramírez
6ac35b1c2a 📝 Update release notes 2021-08-24 14:13:47 +02:00
github-actions
dc9c570733 📝 Update release notes 2021-08-24 10:21:45 +00:00
Sebastián Ramírez
20d4834546 Add support for read_with_orm_mode, to support SQLModel relationship attributes (#3757) 2021-08-24 10:21:05 +00:00
github-actions
f7d7c6c865 📝 Update release notes 2021-08-19 08:21:59 +00:00
Mário Victor Ribeiro Silva
c03b9b2d4c 🌐 Add Portuguese translation of docs/fastapi-people.md (#3461)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-08-19 10:21:21 +02:00
github-actions
70f1b8ebd0 📝 Update release notes 2021-08-18 13:50:17 +00:00
jaystone776
13bf477579 🌐 Add Chinese translation for docs/tutorial/dependencies/dependencies-in-path-operation-decorators.md (#3492)
Co-authored-by: Waynerv <ampedee@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-08-18 13:49:44 +00:00
github-actions
ab5afd0b42 📝 Update release notes 2021-08-18 13:44:46 +00:00
Sebastián Ramírez
b5dcd98605 🔧 Add new Translation tracking issues for German and Indonesian (#3718) 2021-08-18 13:44:11 +00:00
github-actions
2280a48c67 📝 Update release notes 2021-08-18 13:32:37 +00:00
jaystone776
8c5d1f30dc 🌐 Add Chinese translation for docs/tutorial/dependencies/sub-dependencies.md (#3491)
Co-authored-by: Waynerv <ampedee@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-08-18 13:31:59 +00:00
github-actions
98a0fe8628 📝 Update release notes 2021-08-18 13:27:46 +00:00
Mário Victor Ribeiro Silva
38c52fa12d 🌐 Add Portuguese translation for docs/advanced/index.md (#3460)
Co-authored-by: Lucas <61513630+lsglucas@users.noreply.github.com>
2021-08-18 15:27:05 +02:00
github-actions
7c2ed25d6f 📝 Update release notes 2021-08-18 13:24:58 +00:00
Fabio Serrao
dda105c50d 🌐 Portuguese translation of docs/async.md (#1330)
Co-authored-by: Lucas <61513630+lsglucas@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-08-18 13:24:21 +00:00
github-actions
326837443f 📝 Update release notes 2021-08-18 13:20:25 +00:00
Sam Courtemanche
cb5b4e1b7e 🌐 Add French translation for docs/async.md (#3416)
Co-authored-by: Jacquet Corentin <corentin.jacquet@telecomnancy.net>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-08-18 15:19:43 +02:00
github-actions
a23eaaeda8 📝 Update release notes 2021-08-18 13:07:50 +00:00
Sebastián Ramírez
d0ced2c7c9 Add GitHub Action: Notify Translations (#3715) 2021-08-18 15:07:08 +02:00
github-actions
3409c9e32f 📝 Update release notes 2021-08-18 09:48:18 +00:00
Sebastián Ramírez
53a86a885d Update computation of FastAPI People and sponsors (#3714) 2021-08-18 09:47:39 +00:00
github-actions
4ac310875d 📝 Update release notes 2021-08-17 20:47:40 +00:00
Sebastián Ramírez
30e742d566 Enable recent Material for MkDocs Insiders features (#3710) 2021-08-17 20:47:05 +00:00
github-actions
84490a2160 📝 Update release notes 2021-08-17 20:01:09 +00:00
Sebastián Ramírez
4d4452ede5 🔥 Remove/clean extra imports from examples in docs for features (#3709) 2021-08-17 20:00:29 +00:00
github-actions
25a48287ed 📝 Update release notes 2021-08-02 14:54:26 +00:00
Sebastián Ramírez
9a33a0e24c Update docs library to include sources in Markdown (#3648) 2021-08-02 14:53:52 +00:00
github-actions
27fd954a45 📝 Update release notes 2021-08-02 14:03:15 +00:00
Marcelo Trylesinski
ab33ba27af ⬆ Add support for Python 3.9 (#2298)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-08-02 16:02:34 +02:00
github-actions
e9ba01dc59 📝 Update release notes 2021-08-02 13:42:35 +00:00
github-actions[bot]
e809bdc170 👥 Update FastAPI People (#3642)
Co-authored-by: github-actions <github-actions@github.com>
2021-08-02 15:42:02 +02:00
Sebastián Ramírez
717a1ec409 🔖 Release version 0.68.0 2021-07-29 23:03:57 +02:00
Sebastián Ramírez
eba2c66532 🔖 Update release notes 2021-07-29 23:02:42 +02:00
github-actions
3788ca4640 📝 Update release notes 2021-07-29 21:00:53 +00:00
Sebastián Ramírez
97fa743ecb Update OpenAPI models, supporting recursive models and extensions (#3628) 2021-07-29 20:59:26 +00:00
github-actions
e726b7b771 📝 Update release notes 2021-07-29 20:28:25 +00:00
github-actions
6a22b75afd 📝 Update release notes 2021-07-29 20:25:17 +00:00
github-actions
4093d9b22a 📝 Update release notes 2021-07-29 20:23:19 +00:00
Urchin
18daf8f301 🌐 Add Russian translation for docs/python-types.md (#3039) 2021-07-29 22:22:43 +02:00
jaystone776
962578bec2 🌐 Add Chinese translation for docs/tutorial/dependencies/index.md (#3489)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-29 22:21:38 +02:00
Urchin
85cff59109 🌐 Add Russian translation for docs/external-links.md (#3036) 2021-07-29 20:21:06 +00:00
github-actions
b869c7c872 📝 Update release notes 2021-07-29 20:16:29 +00:00
jaystone776
016c3f0d5b 🌐 Add Chinese translation for docs/tutorial/dependencies/global-dependencies.md (#3493)
as title
2021-07-29 22:15:54 +02:00
github-actions
4eb9c60652 📝 Update release notes 2021-07-29 20:15:22 +00:00
Lucas
8879757a88 🌐 Add Portuguese translation for docs/deployment/versions.md (#3618)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2021-07-29 22:14:40 +02:00
Sebastián Ramírez
fadfcfda4a 📝 Update release notes 2021-07-29 22:12:55 +02:00
github-actions
b8c4149e89 📝 Update release notes 2021-07-29 20:01:49 +00:00
Edouard Lavery-Plante
836bb97a2d Add support for extensions and updates to the OpenAPI schema in path operations (#1922)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-29 22:01:13 +02:00
github-actions
7db359182d 📝 Update release notes 2021-07-29 15:30:57 +00:00
James Curtin
4eada92883 Import and re-export data structures from Starlette, used by Request properties, on fastapi.datastructures (#1872)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-29 17:30:18 +02:00
github-actions
6a74f3a0c1 📝 Update release notes 2021-07-29 15:18:55 +00:00
Edward Knight
daa0765653 📝 Update docs about async and response-model with more gender neutral language (#1869) 2021-07-29 17:18:20 +02:00
github-actions
27e26b5939 📝 Update release notes 2021-07-29 15:10:59 +00:00
dkreeft
6f45f43709 Add additonal OpenAPI metadata parameters to FastAPI class, shown on the automatic API docs UI (#1812)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: dkreeft <dkreeft@xccelerated.io>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-29 17:10:22 +02:00
github-actions
6c80e9a8e0 📝 Update release notes 2021-07-29 10:31:22 +00:00
Hylke Postma
3b2e891917 Add description parameter to all the security scheme classes, e.g. APIKeyQuery(name="key", description="A very cool API key") (#1757)
Co-authored-by: Hylke Postma <h.postma@docuwork.nl>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-29 12:30:48 +02:00
github-actions
9121fccf55 📝 Update release notes 2021-07-29 09:26:40 +00:00
Marcelo Trylesinski
fa2c750443 Add the docs_src directory to test coverage and update tests (#1904)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-29 11:26:07 +02:00
github-actions
29e7b31ee6 📝 Update release notes 2021-07-28 15:36:03 +00:00
Yuya Sato
bb6c6ed5d1 🌐 Add Japanese translation for docs/tutorial/security/oauth2-jwt.md (#3526)
Co-authored-by: tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Sho Nakamura <sh0nk.developer@gmail.com>
2021-07-28 17:35:25 +02:00
github-actions
1a5273773e 📝 Update release notes 2021-07-27 10:23:49 +00:00
Sebastián Ramírez
3f40c37905 🔧 Add new GitHub templates with forms for new issues (#3612) 2021-07-27 10:23:09 +00:00
Sebastián Ramírez
996dfd05bd 📝 Update release notes 2021-07-21 21:15:58 +02:00
github-actions
0a1dd7894c 📝 Update release notes 2021-07-21 19:14:32 +00:00
Sebastián Ramírez
dbfd3f7e18 📝 Add official FastAPI Twitter to docs (#3578) 2021-07-21 21:13:58 +02:00
Sebastián Ramírez
a0209a0d2c 🔖 Release version 0.67.0 2021-07-21 20:00:39 +02:00
Sebastián Ramírez
099aab79e6 📝 Update release notes 2021-07-21 19:59:38 +02:00
github-actions
7dc5b94d45 📝 Update release notes 2021-07-21 17:54:42 +00:00
Sebastián Ramírez
684c0077cc Add support for dataclasses in request bodies and response_model (#3577) 2021-07-21 19:54:08 +02:00
github-actions
75d8a6b5c2 📝 Update release notes 2021-07-21 14:39:54 +00:00
Sebastián Ramírez
96fdfc53cc Support dataclasses in responses (#3576)
Co-authored-by: amit lissack <amit@opentrons.com>
2021-07-21 14:39:12 +00:00
github-actions
49517d3310 📝 Update release notes 2021-07-21 13:16:08 +00:00
Ehigie Aito
9355cc4eaa 📝 Add external link: How to Create A Fake Certificate Authority And Generate TLS Certs for FastAPI (#2839)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-21 13:15:33 +00:00
github-actions
1ce59152e7 📝 Update release notes 2021-07-21 12:44:53 +00:00
jaystone776
1241f7f0b7 ✏ Fix code highlighted line in: body-nested-models.md (#3463) 2021-07-21 14:44:15 +02:00
github-actions
fd74c0f6a4 📝 Update release notes 2021-07-21 12:42:05 +00:00
jaystone776
e4eac12c34 ✏ Fix typo in body-nested-models.md (#3462)
Typo in line 201, *where* should be *were*
2021-07-21 14:41:24 +02:00
github-actions
b235653a6c 📝 Update release notes 2021-07-21 12:37:40 +00:00
David Brakman
4cb4bdb984 ✏ Fix typo "might me" -> "might be" in docs/en/docs/tutorial/schema-extra-example.md (#3362)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-21 12:37:06 +00:00
github-actions
ba596152d9 📝 Update release notes 2021-07-21 12:28:48 +00:00
Shahriyar Rzayev
a1227624c8 📝 Add external link: Building simple E-Commerce with NuxtJS and FastAPI (#3271)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-21 12:28:15 +00:00
github-actions
9ce1ae771c 📝 Update release notes 2021-07-21 12:21:46 +00:00
Rodrigo Arenas
b9fed9b485 📝 Add external link: Serve a machine learning model using Sklearn, FastAPI and Docker (#2974)
Co-authored-by: rodrigoarenas456 <31422766+rodrigoarenas456@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-21 14:20:53 +02:00
github-actions
0d97e1f97d 📝 Update release notes 2021-07-21 12:15:08 +00:00
Marcelo Trylesinski
1ce7258a01 ✏️ Fix typo on docstring in datastructures file (#2887) 2021-07-21 14:14:34 +02:00
github-actions
bcd06fdfdf 📝 Update release notes 2021-07-21 12:11:22 +00:00
Marcelo Trylesinski
fc35b7d18d 🎨 Improve style for sponsors, add radius border (#2388)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-21 14:10:47 +02:00
github-actions
8c12ab0d5b 📝 Update release notes 2021-07-21 11:15:03 +00:00
Sebastián Ramírez
38194a29bc 📝 Add External Link: Deploy FastAPI on Ubuntu and Serve using Caddy 2 Web Server (#3572) 2021-07-21 13:14:28 +02:00
github-actions
6b65de6033 📝 Update release notes 2021-07-21 11:12:47 +00:00
github-actions
f80230d654 📝 Update release notes 2021-07-21 11:11:43 +00:00
github-actions
f6cc418d79 📝 Update release notes 2021-07-21 11:10:13 +00:00
github-actions
3ce9407093 📝 Update release notes 2021-07-21 11:08:47 +00:00
github-actions
ef1716c39e 📝 Update release notes 2021-07-21 10:42:13 +00:00
Sebastián Ramírez
9ab7da6562 👷 Update GitHub Action latest-changes, strike 2 (#3575) 2021-07-21 10:41:32 +00:00
Sebastián Ramírez
fcfff5e8e5 👷 Update GitHub Action latest-changes (#3574) 2021-07-21 10:33:42 +00:00
Sebastián Ramírez
67ef62a4dd 👷 Update GitHub Action latest-changes (#3573) 2021-07-21 09:54:27 +00:00
Sebastián Ramírez
7741635b3b 🔧 Add External Link, replaces #1898 (#3571) 2021-07-21 09:39:12 +00:00
Sebastián Ramírez
3d81bc638b 👷 Rename and clarify CI workflow job names (#3570) 2021-07-21 11:24:40 +02:00
github-actions
c1801738b0 📝 Update release notes 2021-07-21 08:52:50 +00:00
Sebastián Ramírez
ba84f167f5 🔧 Sort external links in docs to have the most recent at the top (#3568) 2021-07-21 10:52:10 +02:00
Sebastián Ramírez
0a38c51b9e 🔖 Release 0.66.1 2021-07-19 21:26:52 +02:00
Sebastián Ramírez
db5b2bdf56 📝 Update release notes 2021-07-19 21:21:40 +02:00
github-actions
5ac84120b3 📝 Update release notes 2021-07-19 19:15:35 +00:00
Thomas Grainger
2d296c5d07 🔧 Configure strict pytest options and update/refactor tests (#2790)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-19 21:14:58 +02:00
github-actions
71c96d9eb9 📝 Update release notes 2021-07-19 12:49:41 +00:00
Mark H
5342a0a00f 🌐 Add basic setup for German translations (#3522) 2021-07-19 14:49:09 +02:00
github-actions
163b086f21 📝 Update release notes 2021-07-19 12:47:20 +00:00
oandersonmagalhaes
0876d3df1d 🌐 Add Portuguese translation for docs/tutorial/security/index.md (#3507)
Co-authored-by: Izabela Guerreiro <izaguerreiro@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-19 14:46:39 +02:00
github-actions
50baf5e804 📝 Update release notes 2021-07-19 12:33:34 +00:00
Lucas
3d6da2c32d 🌐 Add Portuguese translation for docs/deployment/index.md (#3337) 2021-07-19 14:32:54 +02:00
github-actions
e721d04350 📝 Update release notes 2021-07-05 11:45:43 +00:00
Sebastián Ramírez
8cc6f9baac ⬆️ Upgrade python-jose dependency for tests (#3468) 2021-07-05 13:45:03 +02:00
Sebastián Ramírez
dfd453e001 📝 Update release notes 2021-07-04 21:18:45 +02:00
Sebastián Ramírez
7e9d5aacf8 🔖 Release version 0.66.0 2021-07-04 20:59:46 +02:00
Sebastián Ramírez
d27a218bc3 📝 Update release notes 2021-07-04 20:58:49 +02:00
github-actions
0c4ded88fe 📝 Update release notes 2021-07-04 18:54:19 +00:00
Rubikoid
0e0931d308 🐛 Fix include/exclude for dicts in jsonable_encoder (#2016)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-04 20:53:40 +02:00
github-actions
dcfa9eb8fe 📝 Update release notes 2021-07-04 17:35:19 +00:00
Camila Gutierrez
6ebf60b175 🌐 Add Spanish translation for tutorial/query-params.md (#2243)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-04 19:34:46 +02:00
github-actions
a4d0724a97 📝 Update release notes 2021-07-04 17:06:51 +00:00
Juan Funez
c235e9b78c 🌐 Add Spanish translation for advanced/response-directly.md (#1253)
Co-authored-by: Camila Gutierrez <mariacamilagl30@gmail.com>
2021-07-04 19:06:18 +02:00
github-actions
5fa3e239db 📝 Update release notes 2021-07-04 14:15:04 +00:00
Juan Funez
3d1b107d70 🌐 Add Spanish translation for advanced/additional-status-codes.md (#1252)
Co-authored-by: Camila Gutierrez <mariacamilagl30@gmail.com>
2021-07-04 16:14:29 +02:00
github-actions
18e0828daf 📝 Update release notes 2021-07-04 12:50:02 +00:00
Juan Funez
f16c7729bd 🌐 Add Spanish translation for advanced/path-operation-advanced-configuration.md (#1251)
Co-authored-by: Camila Gutierrez <mariacamilagl@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Camila Gutierrez <mariacamilagl30@gmail.com>
2021-07-04 14:49:31 +02:00
Sebastián Ramírez
9f3c8cd139 📝 Update release notes, add links to docs 2021-07-03 21:59:39 +02:00
github-actions
a7a35aee61 📝 Update release notes 2021-07-03 19:52:03 +00:00
Sebastián Ramírez
dc5a966548 Allow setting the response_class to RedirectResponse and returning the URL from the function (#3457) 2021-07-03 21:51:28 +02:00
github-actions
ea8d7f689e 📝 Update release notes 2021-07-03 17:16:33 +00:00
Jacob Magnusson
0ed6c92341 🐛 Support custom OpenAPI / JSON Schema fields in the generated output OpenAPI (#1429)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-03 19:15:59 +02:00
Sebastián Ramírez
79f52c76cf 🔖 Release version 0.65.3 2021-07-03 18:33:32 +02:00
Sebastián Ramírez
b725e9eb45 📝 Update release notes 2021-07-03 18:32:50 +02:00
Sebastián Ramírez
787e54b096 📝 Update release notes 2021-07-03 18:30:46 +02:00
github-actions
15fd60b29a 📝 Update release notes 2021-07-03 16:26:48 +00:00
Sebastián Ramírez
edf6b2d61f ♻ Assume request bodies contain JSON when no Content-Type header is provided (#3456) 2021-07-03 18:25:12 +02:00
github-actions
7eb17fc874 📝 Update release notes 2021-07-03 15:13:30 +00:00
Nasaruddin
7e4bfaf0e9 🌐 Initialize Indonesian translations (#3014)
Co-authored-by: Nasaruddin <nasaruddin@skorpoints.com>
2021-07-03 17:12:51 +02:00
github-actions
e1d4fc5325 📝 Update release notes 2021-07-03 14:47:21 +00:00
Camila Gutierrez
faec748ef6 🌐 Add Spanish translation of Tutorial - Path Parameters (#2219)
Co-authored-by: Pedro A. Moreno <pedabraham@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-03 16:46:49 +02:00
github-actions
afec8c4580 📝 Update release notes 2021-07-03 14:14:01 +00:00
Camila Gutierrez
8a1f0aa3b6 🌐 Add Spanish translation of Tutorial - First Steps (#2208)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-03 16:13:28 +02:00
github-actions
f784644510 📝 Update release notes 2021-07-02 15:18:24 +00:00
github-actions[bot]
710a2f745c 👥 Update FastAPI People (#3450)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-02 17:17:49 +02:00
github-actions
bd230fe473 📝 Update release notes 2021-07-02 15:00:53 +00:00
Mário Victor Ribeiro Silva
9c5b000956 🌐 Portuguese translation of Tutorial - Body - Fields (#3420)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-02 17:00:11 +02:00
github-actions
a9f2a25feb 📝 Update release notes 2021-07-02 14:54:56 +00:00
jaystone776
c00c2d1ecf 🌐 Add Chinese translation for Tutorial - Request - Forms - and - Files (#3249)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-02 16:54:22 +02:00
github-actions
dd7bbae837 📝 Update release notes 2021-07-02 14:44:04 +00:00
jaystone776
0a84d48a82 🌐 Add Chinese translation for Tutorial - Handling - Errors (#3299)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-02 16:43:28 +02:00
github-actions
e5d0b97dee 📝 Update release notes 2021-07-02 14:36:34 +00:00
jaystone776
811c3f873f 🌐 Add Chinese translation for Tutorial - Form - Data (#3248)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-02 16:35:58 +02:00
github-actions
662fc81544 📝 Update release notes 2021-07-02 14:27:36 +00:00
github-actions[bot]
5e2f2d541d 👥 Update FastAPI People (#3319)
Co-authored-by: github-actions <github-actions@github.com>
2021-07-02 16:27:02 +02:00
github-actions
8116d8158b 📝 Update release notes 2021-07-02 14:24:16 +00:00
jaystone776
e6836781d5 🌐 Add Chinese translation for Tutorial - Body - Updates (#3237)
Co-authored-by: Xie Wei <ampedee@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-02 16:23:41 +02:00
github-actions
098088c763 📝 Update release notes 2021-07-02 14:21:11 +00:00
Hareru
4bf9a52043 🌐 Add Chinese translation for FastAPI People (#3112)
Co-authored-by: Xie Wei <ampedee@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-02 16:20:36 +02:00
github-actions
eb6f964ede 📝 Update release notes 2021-07-02 14:18:44 +00:00
Sam Courtemanche
4473a9bcbf 🌐 Add French translation for Project Generation (#3197)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-02 16:18:06 +02:00
github-actions
fdc7c96ece 📝 Update release notes 2021-07-02 14:14:28 +00:00
Sam Courtemanche
a694be81ae 🌐 Add French translation for Python Types Intro (#3185) 2021-07-02 16:13:52 +02:00
github-actions
0abb743e9c 📝 Update release notes 2021-07-02 14:12:43 +00:00
Sam Courtemanche
acda3f06b0 🌐 Add French translation for External Links (#3103)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-07-02 16:12:05 +02:00
github-actions
3127bc4e05 📝 Update release notes 2021-07-02 14:06:45 +00:00
Ruidy
18b24df9c8 🌐 Add French translation for Alternatives, Inspiration and Comparisons (#3020)
Co-authored-by: Jérôme Fink <jerome.fink@student.unamur.be>
Co-authored-by: Sam Courtemanche <sam.courtemanche.ipod@gmail.com>
2021-07-02 16:06:10 +02:00
github-actions
b27758fe13 📝 Update release notes 2021-07-02 14:03:22 +00:00
BoYanZh
a0b2006230 🌐 Fix Chinese translation code snippet mismatch in Tutorial - Python Types Intro 2021-07-02 16:02:45 +02:00
github-actions
bd143ffa5a 📝 Update release notes 2021-07-02 13:43:04 +00:00
Fabio Serrao
77c1988a8b 🌐 Add Portuguese translation for Development Contributing (#1364) 2021-07-02 15:42:29 +02:00
github-actions
26a36f79fa 📝 Update release notes 2021-06-29 21:23:00 +00:00
Sebastián Ramírez
97d8d4016b ⬆ Upgrade docs development dependency on typer-cli to >=0.0.12 to fix conflicts (#3429) 2021-06-29 23:22:23 +02:00
github-actions
246e80512d 📝 Update release notes 2021-06-29 12:24:59 +00:00
jaystone776
fc6827d68a 🌐 Add Chinese translation for Tutorial - Request - Files (#3244)
Co-authored-by: Xie Wei <ampedee@gmail.com>
2021-06-29 14:24:19 +02:00
1768 changed files with 179833 additions and 30648 deletions

View File

@@ -1,5 +0,0 @@
[flake8]
max-line-length = 88
select = C,E,F,W,B,B9
ignore = E203, E501, W503
exclude = __init__.py

View File

@@ -0,0 +1,158 @@
labels: [question]
body:
- type: markdown
attributes:
value: |
Thanks for your interest in FastAPI! 🚀
Please follow these instructions, fill every question, and do every step. 🙏
I'm asking this because answering questions and solving problems in GitHub is what consumes most of the time.
I end up not being able to add new features, fix bugs, review pull requests, etc. as fast as I wish because I have to spend too much time handling questions.
All that, on top of all the incredible help provided by a bunch of community members, the [FastAPI Experts](https://fastapi.tiangolo.com/fastapi-people/#experts), that give a lot of their time to come here and help others.
That's a lot of work they are doing, but if more FastAPI users came to help others like them just a little bit more, it would be much less effort for them (and you and me 😅).
By asking questions in a structured way (following this) it will be much easier to help you.
And there's a high chance that you will find the solution along the way and you won't even have to submit it and wait for an answer. 😎
As there are too many questions, I'll have to discard and close the incomplete ones. That will allow me (and others) to focus on helping people like you that follow the whole process and help us help you. 🤓
- type: checkboxes
id: checks
attributes:
label: First Check
description: Please confirm and check all the following options.
options:
- label: I added a very descriptive title here.
required: true
- label: I used the GitHub search to find a similar question and didn't find it.
required: true
- label: I searched the FastAPI documentation, with the integrated search.
required: true
- label: I already searched in Google "How to X in FastAPI" and didn't find any information.
required: true
- label: I already read and followed all the tutorial in the docs and didn't find an answer.
required: true
- label: I already checked if it is not related to FastAPI but to [Pydantic](https://github.com/pydantic/pydantic).
required: true
- label: I already checked if it is not related to FastAPI but to [Swagger UI](https://github.com/swagger-api/swagger-ui).
required: true
- label: I already checked if it is not related to FastAPI but to [ReDoc](https://github.com/Redocly/redoc).
required: true
- type: checkboxes
id: help
attributes:
label: Commit to Help
description: |
After submitting this, I commit to one of:
* Read open questions until I find 2 where I can help someone and add a comment to help there.
* I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future.
* Review one Pull Request by downloading the code and following [all the review process](https://fastapi.tiangolo.com/help-fastapi/#review-pull-requests).
options:
- label: I commit to help with one of those options 👆
required: true
- type: textarea
id: example
attributes:
label: Example Code
description: |
Please add a self-contained, [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example) with your use case.
If I (or someone) can copy it, run it, and see it right away, there's a much higher chance I (or someone) will be able to help you.
placeholder: |
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
render: python
validations:
required: true
- type: textarea
id: description
attributes:
label: Description
description: |
What is the problem, question, or error?
Write a short description telling me what you are doing, what you expect to happen, and what is currently happening.
placeholder: |
* Open the browser and call the endpoint `/`.
* It returns a JSON with `{"Hello": "World"}`.
* But I expected it to return `{"Hello": "Sara"}`.
validations:
required: true
- type: dropdown
id: os
attributes:
label: Operating System
description: What operating system are you on?
multiple: true
options:
- Linux
- Windows
- macOS
- Other
validations:
required: true
- type: textarea
id: os-details
attributes:
label: Operating System Details
description: You can add more details about your operating system here, in particular if you chose "Other".
- type: input
id: fastapi-version
attributes:
label: FastAPI Version
description: |
What FastAPI version are you using?
You can find the FastAPI version with:
```bash
python -c "import fastapi; print(fastapi.__version__)"
```
validations:
required: true
- type: input
id: pydantic-version
attributes:
label: Pydantic Version
description: |
What Pydantic version are you using?
You can find the Pydantic version with:
```bash
python -c "import pydantic; print(pydantic.version.VERSION)"
```
validations:
required: true
- type: input
id: python-version
attributes:
label: Python Version
description: |
What Python version are you using?
You can find the Python version with:
```bash
python --version
```
validations:
required: true
- type: textarea
id: context
attributes:
label: Additional Context
description: Add any additional context information or screenshots you think are useful.

View File

@@ -1 +1,16 @@
blank_issues_enabled: false
contact_links:
- name: Security Contact
about: Please report security vulnerabilities to security@tiangolo.com
- name: Question or Problem
about: Ask a question or ask about a problem in GitHub Discussions.
url: https://github.com/tiangolo/fastapi/discussions/categories/questions
- name: Feature Request
about: To suggest an idea or ask about a feature, please start with a question saying what you would like to achieve. There might be a way to do it already.
url: https://github.com/tiangolo/fastapi/discussions/categories/questions
- name: Show and tell
about: Show what you built with FastAPI or to be used with FastAPI.
url: https://github.com/tiangolo/fastapi/discussions/categories/show-and-tell
- name: Translations
about: Coordinate translations in GitHub Discussions.
url: https://github.com/tiangolo/fastapi/discussions/categories/translations

View File

@@ -1,104 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ""
labels: enhancement
assignees: ''
---
### First check
* [ ] I added a very descriptive title to this issue.
* [ ] I used the GitHub search to find a similar issue and didn't find it.
* [ ] I searched the FastAPI documentation, with the integrated search.
* [ ] I already searched in Google "How to X in FastAPI" and didn't find any information.
* [ ] I already read and followed all the tutorial in the docs and didn't find an answer.
* [ ] I already checked if it is not related to FastAPI but to [Pydantic](https://github.com/samuelcolvin/pydantic).
* [ ] I already checked if it is not related to FastAPI but to [Swagger UI](https://github.com/swagger-api/swagger-ui).
* [ ] I already checked if it is not related to FastAPI but to [ReDoc](https://github.com/Redocly/redoc).
* [ ] After submitting this, I commit to:
* Read open issues with questions until I find 2 issues where I can help someone and add a comment to help there.
* Or, I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future.
* Implement a Pull Request for a confirmed bug.
<!--
I'm asking all this because answering questions and solving problems in GitHub issues consumes a lot of time. I end up not being able to add new features, fix bugs, review Pull Requests, etc. as fast as I wish because I have to spend too much time handling issues.
All that, on top of all the incredible help provided by a bunch of community members that give a lot of their time to come here and help others.
That's a lot of work they are doing, but if more FastAPI users came to help others like them just a little bit more, it would be much less effort for them (and you and me 😅).
-->
### Example
Here's a self-contained [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example) with my use case:
<!-- Replace the code below with your own self-contained, minimal, reproducible, example -->
```Python
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
```
### Description
<!-- Replace the content below with your own feature request -->
* Open the browser and call the endpoint `/`.
* It returns a JSON with `{"Hello": "World"}`.
* I would like it to have an extra parameter to teleport me to the moon and back.
### The solution you would like
<!-- Replace this with your own content -->
I would like it to have a `teleport_to_moon` parameter that defaults to `False`, and can be set to `True` to teleport me:
```Python
from fastapi import FastAPI
app = FastAPI()
@app.get("/", teleport_to_moon=True)
def read_root():
return {"Hello": "World"}
```
### Describe alternatives you've considered
<!-- Replace this with your own ideas -->
To wait for Space X moon travel plans to drop down long after they release them. But I would rather teleport.
### Environment
* OS: [e.g. Linux / Windows / macOS]:
* FastAPI Version [e.g. 0.3.0]:
To know the FastAPI version use:
```bash
python -c "import fastapi; print(fastapi.__version__)"
```
* Python version:
To know the Python version use:
```bash
python --version
```
### Additional context
<!-- Add any other context or screenshots about the question here. -->

22
.github/ISSUE_TEMPLATE/privileged.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Privileged
description: You are @tiangolo or he asked you directly to create an issue here. If not, check the other options. 👇
body:
- type: markdown
attributes:
value: |
Thanks for your interest in FastAPI! 🚀
If you are not @tiangolo or he didn't ask you directly to create an issue here, please start the conversation in a [Question in GitHub Discussions](https://github.com/tiangolo/fastapi/discussions/categories/questions) instead.
- type: checkboxes
id: privileged
attributes:
label: Privileged issue
description: Confirm that you are allowed to create an issue here.
options:
- label: I'm @tiangolo or he asked me directly to create an issue here.
required: true
- type: textarea
id: content
attributes:
label: Issue Content
description: Add the content of the issue here.

View File

@@ -1,81 +0,0 @@
---
name: Question or Problem
about: Ask a question or ask about a problem
title: ""
labels: question
assignees: ""
---
### First check
* [ ] I added a very descriptive title to this issue.
* [ ] I used the GitHub search to find a similar issue and didn't find it.
* [ ] I searched the FastAPI documentation, with the integrated search.
* [ ] I already searched in Google "How to X in FastAPI" and didn't find any information.
* [ ] I already read and followed all the tutorial in the docs and didn't find an answer.
* [ ] I already checked if it is not related to FastAPI but to [Pydantic](https://github.com/samuelcolvin/pydantic).
* [ ] I already checked if it is not related to FastAPI but to [Swagger UI](https://github.com/swagger-api/swagger-ui).
* [ ] I already checked if it is not related to FastAPI but to [ReDoc](https://github.com/Redocly/redoc).
* [ ] After submitting this, I commit to one of:
* Read open issues with questions until I find 2 issues where I can help someone and add a comment to help there.
* I already hit the "watch" button in this repository to receive notifications and I commit to help at least 2 people that ask questions in the future.
* Implement a Pull Request for a confirmed bug.
<!--
I'm asking all this because answering questions and solving problems in GitHub issues consumes a lot of time. I end up not being able to add new features, fix bugs, review Pull Requests, etc. as fast as I wish because I have to spend too much time handling issues.
All that, on top of all the incredible help provided by a bunch of community members that give a lot of their time to come here and help others.
That's a lot of work they are doing, but if more FastAPI users came to help others like them just a little bit more, it would be much less effort for them (and you and me 😅).
-->
### Example
Here's a self-contained, [minimal, reproducible, example](https://stackoverflow.com/help/minimal-reproducible-example) with my use case:
<!-- Replace the code below with your own self-contained, minimal, reproducible, example, if I (or someone) can copy it, run it, and see it right away, there's a much higher chance I (or someone) will be able to help you -->
```Python
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
```
### Description
<!-- Replace the content below with your own problem, question, or error -->
* Open the browser and call the endpoint `/`.
* It returns a JSON with `{"Hello": "World"}`.
* But I expected it to return `{"Hello": "Sara"}`.
### Environment
* OS: [e.g. Linux / Windows / macOS]:
* FastAPI Version [e.g. 0.3.0]:
To know the FastAPI version use:
```bash
python -c "import fastapi; print(fastapi.__version__)"
```
* Python version:
To know the Python version use:
```bash
python --version
```
### Additional context
<!-- Add any other context or screenshots about the question here. -->

View File

@@ -1,6 +1,8 @@
FROM python:3.7
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

View File

@@ -1,12 +1,13 @@
import logging
import sys
from pathlib import Path
from typing import Optional
from typing import Union
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"
@@ -14,7 +15,7 @@ github_api = "https://api.github.com"
class Settings(BaseSettings):
github_repository: str
github_event_path: Path
github_event_name: Optional[str] = None
github_event_name: Union[str, None] = None
input_token: SecretStr
input_deploy_url: str
@@ -42,15 +43,13 @@ if __name__ == "__main__":
except ValidationError as e:
logging.error(f"Error parsing event file: {e.errors()}")
sys.exit(0)
use_pr: Optional[PullRequest] = None
use_pr: Union[PullRequest, None] = None
for pr in repo.get_pulls():
if pr.head.sha == event.workflow_run.head_commit.id:
use_pr = pr
break
if not use_pr:
logging.error(
f"No PR found for hash: {event.workflow_run.head_commit.id}"
)
logging.error(f"No PR found for hash: {event.workflow_run.head_commit.id}")
sys.exit(0)
github_headers = {
"Authorization": f"token {settings.input_token.get_secret_value()}"

View File

@@ -0,0 +1,4 @@
PyGithub
pydantic>=2.5.3,<3.0.0
pydantic-settings>=2.1.0,<3.0.0
httpx

View File

@@ -0,0 +1,7 @@
FROM python:3.9
RUN pip install httpx PyGithub "pydantic==1.5.1" "pyyaml>=5.3.1,<6.0.0"
COPY ./app /app
CMD ["python", "/app/main.py"]

View File

@@ -0,0 +1,10 @@
name: "Notify Translations"
description: "Notify in the issue for a translation when there's a new PR available"
author: "Sebastián Ramírez <tiangolo@gmail.com>"
inputs:
token:
description: 'Token, to read the GitHub API. Can be passed in using {{ secrets.GITHUB_TOKEN }}'
required: true
runs:
using: 'docker'
image: 'Dockerfile'

View File

@@ -0,0 +1,417 @@
import logging
import random
import sys
import time
from pathlib import Path
from typing import Any, Dict, List, Union, cast
import httpx
from github import Github
from pydantic import BaseModel, BaseSettings, SecretStr
awaiting_label = "awaiting-review"
lang_all_label = "lang-all"
approved_label = "approved-2"
translations_path = Path(__file__).parent / "translations.yml"
github_graphql_url = "https://api.github.com/graphql"
questions_translations_category_id = "DIC_kwDOCZduT84CT5P9"
all_discussions_query = """
query Q($category_id: ID) {
repository(name: "fastapi", owner: "tiangolo") {
discussions(categoryId: $category_id, first: 100) {
nodes {
title
id
number
labels(first: 10) {
edges {
node {
id
name
}
}
}
}
}
}
}
"""
translation_discussion_query = """
query Q($after: String, $discussion_number: Int!) {
repository(name: "fastapi", owner: "tiangolo") {
discussion(number: $discussion_number) {
comments(first: 100, after: $after) {
edges {
cursor
node {
id
url
body
}
}
}
}
}
}
"""
add_comment_mutation = """
mutation Q($discussion_id: ID!, $body: String!) {
addDiscussionComment(input: {discussionId: $discussion_id, body: $body}) {
comment {
id
url
body
}
}
}
"""
update_comment_mutation = """
mutation Q($comment_id: ID!, $body: String!) {
updateDiscussionComment(input: {commentId: $comment_id, body: $body}) {
comment {
id
url
body
}
}
}
"""
class Comment(BaseModel):
id: str
url: str
body: str
class UpdateDiscussionComment(BaseModel):
comment: Comment
class UpdateCommentData(BaseModel):
updateDiscussionComment: UpdateDiscussionComment
class UpdateCommentResponse(BaseModel):
data: UpdateCommentData
class AddDiscussionComment(BaseModel):
comment: Comment
class AddCommentData(BaseModel):
addDiscussionComment: AddDiscussionComment
class AddCommentResponse(BaseModel):
data: AddCommentData
class CommentsEdge(BaseModel):
node: Comment
cursor: str
class Comments(BaseModel):
edges: List[CommentsEdge]
class CommentsDiscussion(BaseModel):
comments: Comments
class CommentsRepository(BaseModel):
discussion: CommentsDiscussion
class CommentsData(BaseModel):
repository: CommentsRepository
class CommentsResponse(BaseModel):
data: CommentsData
class AllDiscussionsLabelNode(BaseModel):
id: str
name: str
class AllDiscussionsLabelsEdge(BaseModel):
node: AllDiscussionsLabelNode
class AllDiscussionsDiscussionLabels(BaseModel):
edges: List[AllDiscussionsLabelsEdge]
class AllDiscussionsDiscussionNode(BaseModel):
title: str
id: str
number: int
labels: AllDiscussionsDiscussionLabels
class AllDiscussionsDiscussions(BaseModel):
nodes: List[AllDiscussionsDiscussionNode]
class AllDiscussionsRepository(BaseModel):
discussions: AllDiscussionsDiscussions
class AllDiscussionsData(BaseModel):
repository: AllDiscussionsRepository
class AllDiscussionsResponse(BaseModel):
data: AllDiscussionsData
class Settings(BaseSettings):
github_repository: str
input_token: SecretStr
github_event_path: Path
github_event_name: Union[str, None] = None
httpx_timeout: int = 30
input_debug: Union[bool, None] = False
class PartialGitHubEventIssue(BaseModel):
number: int
class PartialGitHubEvent(BaseModel):
pull_request: PartialGitHubEventIssue
def get_graphql_response(
*,
settings: Settings,
query: str,
after: Union[str, None] = None,
category_id: Union[str, None] = None,
discussion_number: Union[int, None] = None,
discussion_id: Union[str, None] = None,
comment_id: Union[str, None] = None,
body: Union[str, None] = None,
) -> Dict[str, Any]:
headers = {"Authorization": f"token {settings.input_token.get_secret_value()}"}
# some fields are only used by one query, but GraphQL allows unused variables, so
# keep them here for simplicity
variables = {
"after": after,
"category_id": category_id,
"discussion_number": discussion_number,
"discussion_id": discussion_id,
"comment_id": comment_id,
"body": body,
}
response = httpx.post(
github_graphql_url,
headers=headers,
timeout=settings.httpx_timeout,
json={"query": query, "variables": variables, "operationName": "Q"},
)
if response.status_code != 200:
logging.error(
f"Response was not 200, after: {after}, category_id: {category_id}"
)
logging.error(response.text)
raise RuntimeError(response.text)
data = response.json()
if "errors" in data:
logging.error(f"Errors in response, after: {after}, category_id: {category_id}")
logging.error(response.text)
raise RuntimeError(response.text)
return cast(Dict[str, Any], data)
def get_graphql_translation_discussions(*, settings: Settings):
data = get_graphql_response(
settings=settings,
query=all_discussions_query,
category_id=questions_translations_category_id,
)
graphql_response = AllDiscussionsResponse.parse_obj(data)
return graphql_response.data.repository.discussions.nodes
def get_graphql_translation_discussion_comments_edges(
*, settings: Settings, discussion_number: int, after: Union[str, None] = None
):
data = get_graphql_response(
settings=settings,
query=translation_discussion_query,
discussion_number=discussion_number,
after=after,
)
graphql_response = CommentsResponse.parse_obj(data)
return graphql_response.data.repository.discussion.comments.edges
def get_graphql_translation_discussion_comments(
*, settings: Settings, discussion_number: int
):
comment_nodes: List[Comment] = []
discussion_edges = get_graphql_translation_discussion_comments_edges(
settings=settings, discussion_number=discussion_number
)
while discussion_edges:
for discussion_edge in discussion_edges:
comment_nodes.append(discussion_edge.node)
last_edge = discussion_edges[-1]
discussion_edges = get_graphql_translation_discussion_comments_edges(
settings=settings,
discussion_number=discussion_number,
after=last_edge.cursor,
)
return comment_nodes
def create_comment(*, settings: Settings, discussion_id: str, body: str):
data = get_graphql_response(
settings=settings,
query=add_comment_mutation,
discussion_id=discussion_id,
body=body,
)
response = AddCommentResponse.parse_obj(data)
return response.data.addDiscussionComment.comment
def update_comment(*, settings: Settings, comment_id: str, body: str):
data = get_graphql_response(
settings=settings,
query=update_comment_mutation,
comment_id=comment_id,
body=body,
)
response = UpdateCommentResponse.parse_obj(data)
return response.data.updateDiscussionComment.comment
if __name__ == "__main__":
settings = Settings()
if settings.input_debug:
logging.basicConfig(level=logging.DEBUG)
else:
logging.basicConfig(level=logging.INFO)
logging.debug(f"Using config: {settings.json()}")
g = Github(settings.input_token.get_secret_value())
repo = g.get_repo(settings.github_repository)
if not settings.github_event_path.is_file():
raise RuntimeError(
f"No github event file available at: {settings.github_event_path}"
)
contents = settings.github_event_path.read_text()
github_event = PartialGitHubEvent.parse_raw(contents)
# Avoid race conditions with multiple labels
sleep_time = random.random() * 10 # random number between 0 and 10 seconds
logging.info(
f"Sleeping for {sleep_time} seconds to avoid "
"race conditions and multiple comments"
)
time.sleep(sleep_time)
# Get PR
logging.debug(f"Processing PR: #{github_event.pull_request.number}")
pr = repo.get_pull(github_event.pull_request.number)
label_strs = {label.name for label in pr.get_labels()}
langs = []
for label in label_strs:
if label.startswith("lang-") and not label == lang_all_label:
langs.append(label[5:])
logging.info(f"PR #{pr.number} has labels: {label_strs}")
if not langs or lang_all_label not in label_strs:
logging.info(f"PR #{pr.number} doesn't seem to be a translation PR, skipping")
sys.exit(0)
# Generate translation map, lang ID to discussion
discussions = get_graphql_translation_discussions(settings=settings)
lang_to_discussion_map: Dict[str, AllDiscussionsDiscussionNode] = {}
for discussion in discussions:
for edge in discussion.labels.edges:
label = edge.node.name
if label.startswith("lang-") and not label == lang_all_label:
lang = label[5:]
lang_to_discussion_map[lang] = discussion
logging.debug(f"Using translations map: {lang_to_discussion_map}")
# Messages to create or check
new_translation_message = f"Good news everyone! 😉 There's a new translation PR to be reviewed: #{pr.number} by @{pr.user.login}. 🎉 This requires 2 approvals from native speakers to be merged. 🤓"
done_translation_message = f"~There's a new translation PR to be reviewed: #{pr.number} by @{pr.user.login}~ Good job! This is done. 🍰☕"
# Normally only one language, but still
for lang in langs:
if lang not in lang_to_discussion_map:
log_message = f"Could not find discussion for language: {lang}"
logging.error(log_message)
raise RuntimeError(log_message)
discussion = lang_to_discussion_map[lang]
logging.info(
f"Found a translation discussion for language: {lang} in discussion: #{discussion.number}"
)
already_notified_comment: Union[Comment, None] = None
already_done_comment: Union[Comment, None] = None
logging.info(
f"Checking current comments in discussion: #{discussion.number} to see if already notified about this PR: #{pr.number}"
)
comments = get_graphql_translation_discussion_comments(
settings=settings, discussion_number=discussion.number
)
for comment in comments:
if new_translation_message in comment.body:
already_notified_comment = comment
elif done_translation_message in comment.body:
already_done_comment = comment
logging.info(
f"Already notified comment: {already_notified_comment}, already done comment: {already_done_comment}"
)
if pr.state == "open" and awaiting_label in label_strs:
logging.info(
f"This PR seems to be a language translation and awaiting reviews: #{pr.number}"
)
if already_notified_comment:
logging.info(
f"This PR #{pr.number} was already notified in comment: {already_notified_comment.url}"
)
else:
logging.info(
f"Writing notification comment about PR #{pr.number} in Discussion: #{discussion.number}"
)
comment = create_comment(
settings=settings,
discussion_id=discussion.id,
body=new_translation_message,
)
logging.info(f"Notified in comment: {comment.url}")
elif pr.state == "closed" or approved_label in label_strs:
logging.info(f"Already approved or closed PR #{pr.number}")
if already_done_comment:
logging.info(
f"This PR #{pr.number} was already marked as done in comment: {already_done_comment.url}"
)
elif already_notified_comment:
updated_comment = update_comment(
settings=settings,
comment_id=already_notified_comment.id,
body=done_translation_message,
)
logging.info(f"Marked as done in comment: {updated_comment.url}")
else:
logging.info(
f"There doesn't seem to be anything to be done about PR #{pr.number}"
)
logging.info("Finished")

View File

@@ -1,6 +1,6 @@
FROM python:3.7
FROM python:3.9
RUN pip install httpx PyGithub "pydantic==1.5.1" "pyyaml>=5.3.1,<6.0.0"
RUN pip install httpx PyGithub "pydantic==2.0.2" pydantic-settings "pyyaml>=5.3.1,<6.0.0"
COPY ./app /app

View File

@@ -3,10 +3,7 @@ description: "Generate the data for the FastAPI People page"
author: "Sebastián Ramírez <tiangolo@gmail.com>"
inputs:
token:
description: 'User token, to read the GitHub API. Can be passed in using {{ secrets.ACTION_TOKEN }}'
required: true
standard_token:
description: 'Default GitHub Action token, used for the PR. Can be passed in using {{ secrets.GITHUB_TOKEN }}'
description: 'User token, to read the GitHub API. Can be passed in using {{ secrets.FASTAPI_PEOPLE }}'
required: true
runs:
using: 'docker'

View File

@@ -4,17 +4,62 @@ import sys
from collections import Counter, defaultdict
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Container, DefaultDict, Dict, List, Optional, Set
from typing import Any, Container, DefaultDict, Dict, List, Set, Union
import httpx
import yaml
from github import Github
from pydantic import BaseModel, BaseSettings, SecretStr
from pydantic import BaseModel, SecretStr
from pydantic_settings import BaseSettings
github_graphql_url = "https://api.github.com/graphql"
questions_category_id = "MDE4OkRpc2N1c3Npb25DYXRlZ29yeTMyMDAxNDM0"
discussions_query = """
query Q($after: String, $category_id: ID) {
repository(name: "fastapi", owner: "tiangolo") {
discussions(first: 100, after: $after, categoryId: $category_id) {
edges {
cursor
node {
number
author {
login
avatarUrl
url
}
title
createdAt
comments(first: 100) {
nodes {
createdAt
author {
login
avatarUrl
url
}
isAnswer
replies(first: 10) {
nodes {
createdAt
author {
login
avatarUrl
url
}
}
}
}
}
}
}
}
}
}
"""
issues_query = """
query Q($after: String) {
query Q($after: String) {
repository(name: "fastapi", owner: "tiangolo") {
issues(first: 100, after: $after) {
edges {
@@ -47,7 +92,7 @@ query Q($after: String) {
"""
prs_query = """
query Q($after: String) {
query Q($after: String) {
repository(name: "fastapi", owner: "tiangolo") {
pullRequests(first: 100, after: $after) {
edges {
@@ -131,45 +176,92 @@ class Author(BaseModel):
url: str
# Issues and Discussions
class CommentsNode(BaseModel):
createdAt: datetime
author: Optional[Author] = None
author: Union[Author, None] = None
class Replies(BaseModel):
nodes: List[CommentsNode]
class DiscussionsCommentsNode(CommentsNode):
replies: Replies
class Comments(BaseModel):
nodes: List[CommentsNode]
class DiscussionsComments(BaseModel):
nodes: List[DiscussionsCommentsNode]
class IssuesNode(BaseModel):
number: int
author: Optional[Author] = None
author: Union[Author, None] = None
title: str
createdAt: datetime
state: str
comments: Comments
class DiscussionsNode(BaseModel):
number: int
author: Union[Author, None] = None
title: str
createdAt: datetime
comments: DiscussionsComments
class IssuesEdge(BaseModel):
cursor: str
node: IssuesNode
class DiscussionsEdge(BaseModel):
cursor: str
node: DiscussionsNode
class Issues(BaseModel):
edges: List[IssuesEdge]
class Discussions(BaseModel):
edges: List[DiscussionsEdge]
class IssuesRepository(BaseModel):
issues: Issues
class DiscussionsRepository(BaseModel):
discussions: Discussions
class IssuesResponseData(BaseModel):
repository: IssuesRepository
class DiscussionsResponseData(BaseModel):
repository: DiscussionsRepository
class IssuesResponse(BaseModel):
data: IssuesResponseData
class DiscussionsResponse(BaseModel):
data: DiscussionsResponseData
# PRs
class LabelNode(BaseModel):
name: str
@@ -179,7 +271,7 @@ class Labels(BaseModel):
class ReviewNode(BaseModel):
author: Optional[Author] = None
author: Union[Author, None] = None
state: str
@@ -190,7 +282,7 @@ class Reviews(BaseModel):
class PullRequestNode(BaseModel):
number: int
labels: Labels
author: Optional[Author] = None
author: Union[Author, None] = None
title: str
createdAt: datetime
state: str
@@ -219,6 +311,9 @@ class PRsResponse(BaseModel):
data: PRsResponseData
# Sponsors
class SponsorEntity(BaseModel):
login: str
avatarUrl: str
@@ -258,47 +353,76 @@ class SponsorsResponse(BaseModel):
class Settings(BaseSettings):
input_token: SecretStr
input_standard_token: SecretStr
github_repository: str
httpx_timeout: int = 30
def get_graphql_response(
*, settings: Settings, query: str, after: Optional[str] = None
):
*,
settings: Settings,
query: str,
after: Union[str, None] = None,
category_id: Union[str, None] = None,
) -> Dict[str, Any]:
headers = {"Authorization": f"token {settings.input_token.get_secret_value()}"}
variables = {"after": after}
# category_id is only used by one query, but GraphQL allows unused variables, so
# keep it here for simplicity
variables = {"after": after, "category_id": category_id}
response = httpx.post(
github_graphql_url,
headers=headers,
timeout=settings.httpx_timeout,
json={"query": query, "variables": variables, "operationName": "Q"},
)
if not response.status_code == 200:
logging.error(f"Response was not 200, after: {after}")
if response.status_code != 200:
logging.error(
f"Response was not 200, after: {after}, category_id: {category_id}"
)
logging.error(response.text)
raise RuntimeError(response.text)
data = response.json()
if "errors" in data:
logging.error(f"Errors in response, after: {after}, category_id: {category_id}")
logging.error(data["errors"])
logging.error(response.text)
raise RuntimeError(response.text)
return data
def get_graphql_issue_edges(*, settings: Settings, after: Optional[str] = None):
def get_graphql_issue_edges(*, settings: Settings, after: Union[str, None] = None):
data = get_graphql_response(settings=settings, query=issues_query, after=after)
graphql_response = IssuesResponse.parse_obj(data)
graphql_response = IssuesResponse.model_validate(data)
return graphql_response.data.repository.issues.edges
def get_graphql_pr_edges(*, settings: Settings, after: Optional[str] = None):
def get_graphql_question_discussion_edges(
*,
settings: Settings,
after: Union[str, None] = None,
):
data = get_graphql_response(
settings=settings,
query=discussions_query,
after=after,
category_id=questions_category_id,
)
graphql_response = DiscussionsResponse.model_validate(data)
return graphql_response.data.repository.discussions.edges
def get_graphql_pr_edges(*, settings: Settings, after: Union[str, None] = None):
data = get_graphql_response(settings=settings, query=prs_query, after=after)
graphql_response = PRsResponse.parse_obj(data)
graphql_response = PRsResponse.model_validate(data)
return graphql_response.data.repository.pullRequests.edges
def get_graphql_sponsor_edges(*, settings: Settings, after: Optional[str] = None):
def get_graphql_sponsor_edges(*, settings: Settings, after: Union[str, None] = None):
data = get_graphql_response(settings=settings, query=sponsors_query, after=after)
graphql_response = SponsorsResponse.parse_obj(data)
graphql_response = SponsorsResponse.model_validate(data)
return graphql_response.data.user.sponsorshipsAsMaintainer.edges
def get_experts(settings: Settings):
def get_issues_experts(settings: Settings):
issue_nodes: List[IssuesNode] = []
issue_edges = get_graphql_issue_edges(settings=settings)
@@ -324,13 +448,78 @@ def get_experts(settings: Settings):
for comment in issue.comments.nodes:
if comment.author:
authors[comment.author.login] = comment.author
if comment.author.login == issue_author_name:
continue
issue_commentors.add(comment.author.login)
if comment.author.login != issue_author_name:
issue_commentors.add(comment.author.login)
for author_name in issue_commentors:
commentors[author_name] += 1
if issue.createdAt > one_month_ago:
last_month_commentors[author_name] += 1
return commentors, last_month_commentors, authors
def get_discussions_experts(settings: Settings):
discussion_nodes: List[DiscussionsNode] = []
discussion_edges = get_graphql_question_discussion_edges(settings=settings)
while discussion_edges:
for discussion_edge in discussion_edges:
discussion_nodes.append(discussion_edge.node)
last_edge = discussion_edges[-1]
discussion_edges = get_graphql_question_discussion_edges(
settings=settings, after=last_edge.cursor
)
commentors = Counter()
last_month_commentors = Counter()
authors: Dict[str, Author] = {}
now = datetime.now(tz=timezone.utc)
one_month_ago = now - timedelta(days=30)
for discussion in discussion_nodes:
discussion_author_name = None
if discussion.author:
authors[discussion.author.login] = discussion.author
discussion_author_name = discussion.author.login
discussion_commentors = set()
for comment in discussion.comments.nodes:
if comment.author:
authors[comment.author.login] = comment.author
if comment.author.login != discussion_author_name:
discussion_commentors.add(comment.author.login)
for reply in comment.replies.nodes:
if reply.author:
authors[reply.author.login] = reply.author
if reply.author.login != discussion_author_name:
discussion_commentors.add(reply.author.login)
for author_name in discussion_commentors:
commentors[author_name] += 1
if discussion.createdAt > one_month_ago:
last_month_commentors[author_name] += 1
return commentors, last_month_commentors, authors
def get_experts(settings: Settings):
# Migrated to only use GitHub Discussions
# (
# issues_commentors,
# issues_last_month_commentors,
# issues_authors,
# ) = get_issues_experts(settings=settings)
(
discussions_commentors,
discussions_last_month_commentors,
discussions_authors,
) = get_discussions_experts(settings=settings)
# commentors = issues_commentors + discussions_commentors
commentors = discussions_commentors
# last_month_commentors = (
# issues_last_month_commentors + discussions_last_month_commentors
# )
last_month_commentors = discussions_last_month_commentors
# authors = {**issues_authors, **discussions_authors}
authors = {**discussions_authors}
return commentors, last_month_commentors, authors
@@ -420,25 +609,25 @@ def get_top_users(
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
settings = Settings()
logging.info(f"Using config: {settings.json()}")
g = Github(settings.input_standard_token.get_secret_value())
logging.info(f"Using config: {settings.model_dump_json()}")
g = Github(settings.input_token.get_secret_value())
repo = g.get_repo(settings.github_repository)
issue_commentors, issue_last_month_commentors, issue_authors = get_experts(
question_commentors, question_last_month_commentors, question_authors = get_experts(
settings=settings
)
contributors, pr_commentors, reviewers, pr_authors = get_contributors(
settings=settings
)
authors = {**issue_authors, **pr_authors}
authors = {**question_authors, **pr_authors}
maintainers_logins = {"tiangolo"}
bot_names = {"codecov", "github-actions"}
bot_names = {"codecov", "github-actions", "pre-commit-ci", "dependabot"}
maintainers = []
for login in maintainers_logins:
user = authors[login]
maintainers.append(
{
"login": login,
"answers": issue_commentors[login],
"answers": question_commentors[login],
"prs": contributors[login],
"avatarUrl": user.avatarUrl,
"url": user.url,
@@ -451,13 +640,13 @@ if __name__ == "__main__":
min_count_reviewer = 4
skip_users = maintainers_logins | bot_names
experts = get_top_users(
counter=issue_commentors,
counter=question_commentors,
min_count=min_count_expert,
authors=authors,
skip_users=skip_users,
)
last_month_active = get_top_users(
counter=issue_last_month_commentors,
counter=question_last_month_commentors,
min_count=min_count_last_month,
authors=authors,
skip_users=skip_users,
@@ -476,21 +665,16 @@ if __name__ == "__main__":
)
tiers = get_individual_sponsors(settings=settings)
sponsors_50 = []
for login, sponsor in tiers[50].items():
sponsors_50.append(
{"login": login, "avatarUrl": sponsor.avatarUrl, "url": sponsor.url}
)
keys = list(tiers.keys())
keys.sort(reverse=True)
sponsors = []
for key in keys:
if key >= 50:
continue
sponsor_group = []
for login, sponsor in tiers[key].items():
sponsors.append(
sponsor_group.append(
{"login": login, "avatarUrl": sponsor.avatarUrl, "url": sponsor.url}
)
sponsors.append(sponsor_group)
people = {
"maintainers": maintainers,
@@ -498,16 +682,28 @@ if __name__ == "__main__":
"last_month_active": last_month_active,
"top_contributors": top_contributors,
"top_reviewers": top_reviewers,
"sponsors_50": sponsors_50,
}
github_sponsors = {
"sponsors": sponsors,
}
people_path = Path("./docs/en/data/people.yml")
github_sponsors_path = Path("./docs/en/data/github_sponsors.yml")
people_old_content = people_path.read_text(encoding="utf-8")
new_content = yaml.dump(people, sort_keys=False, width=200, allow_unicode=True)
if people_old_content == new_content:
github_sponsors_old_content = github_sponsors_path.read_text(encoding="utf-8")
new_people_content = yaml.dump(
people, sort_keys=False, width=200, allow_unicode=True
)
new_github_sponsors_content = yaml.dump(
github_sponsors, sort_keys=False, width=200, allow_unicode=True
)
if (
people_old_content == new_people_content
and github_sponsors_old_content == new_github_sponsors_content
):
logging.info("The FastAPI People data hasn't changed, finishing.")
sys.exit(0)
people_path.write_text(new_content, encoding="utf-8")
people_path.write_text(new_people_content, encoding="utf-8")
github_sponsors_path.write_text(new_github_sponsors_content, encoding="utf-8")
logging.info("Setting up GitHub Actions git user")
subprocess.run(["git", "config", "user.name", "github-actions"], check=True)
subprocess.run(
@@ -517,7 +713,9 @@ if __name__ == "__main__":
logging.info(f"Creating a new branch {branch_name}")
subprocess.run(["git", "checkout", "-b", branch_name], check=True)
logging.info("Adding updated file")
subprocess.run(["git", "add", str(people_path)], check=True)
subprocess.run(
["git", "add", str(people_path), str(github_sponsors_path)], check=True
)
logging.info("Committing updated file")
message = "👥 Update FastAPI People"
result = subprocess.run(["git", "commit", "-m", message], check=True)

View File

@@ -1,7 +0,0 @@
FROM python:3.7
RUN pip install httpx PyGithub "pydantic==1.5.1"
COPY ./app /app
CMD ["python", "/app/main.py"]

View File

@@ -1,10 +0,0 @@
name: "Watch docs previews in PRs"
description: "Check PRs and trigger new docs deploys"
author: "Sebastián Ramírez <tiangolo@gmail.com>"
inputs:
token:
description: 'Token for the repo. Can be passed in using {{ secrets.GITHUB_TOKEN }}'
required: true
runs:
using: 'docker'
image: 'Dockerfile'

View File

@@ -1,101 +0,0 @@
import logging
from datetime import datetime
from pathlib import Path
from typing import List, Optional
import httpx
from github import Github
from github.NamedUser import NamedUser
from pydantic import BaseModel, BaseSettings, SecretStr
github_api = "https://api.github.com"
netlify_api = "https://api.netlify.com"
class Settings(BaseSettings):
input_token: SecretStr
github_repository: str
github_event_path: Path
github_event_name: Optional[str] = None
class Artifact(BaseModel):
id: int
node_id: str
name: str
size_in_bytes: int
url: str
archive_download_url: str
expired: bool
created_at: datetime
updated_at: datetime
class ArtifactResponse(BaseModel):
total_count: int
artifacts: List[Artifact]
def get_message(commit: str) -> str:
return f"Docs preview for commit {commit} at"
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
settings = Settings()
logging.info(f"Using config: {settings.json()}")
g = Github(settings.input_token.get_secret_value())
repo = g.get_repo(settings.github_repository)
owner: NamedUser = repo.owner
headers = {"Authorization": f"token {settings.input_token.get_secret_value()}"}
prs = list(repo.get_pulls(state="open"))
response = httpx.get(
f"{github_api}/repos/{settings.github_repository}/actions/artifacts",
headers=headers,
)
data = response.json()
artifacts_response = ArtifactResponse.parse_obj(data)
for pr in prs:
logging.info("-----")
logging.info(f"Processing PR #{pr.number}: {pr.title}")
pr_comments = list(pr.get_issue_comments())
pr_commits = list(pr.get_commits())
last_commit = pr_commits[0]
for pr_commit in pr_commits:
if pr_commit.commit.author.date > last_commit.commit.author.date:
last_commit = pr_commit
commit = last_commit.commit.sha
logging.info(f"Last commit: {commit}")
message = get_message(commit)
notified = False
for pr_comment in pr_comments:
if message in pr_comment.body:
notified = True
logging.info(f"Docs preview was notified: {notified}")
if not notified:
artifact_name = f"docs-zip-{commit}"
use_artifact: Optional[Artifact] = None
for artifact in artifacts_response.artifacts:
if artifact.name == artifact_name:
use_artifact = artifact
break
if not use_artifact:
logging.info("Artifact not available")
else:
logging.info(f"Existing artifact: {use_artifact.name}")
response = httpx.post(
"https://api.github.com/repos/tiangolo/fastapi/actions/workflows/preview-docs.yml/dispatches",
headers=headers,
json={
"ref": "master",
"inputs": {
"pr": f"{pr.number}",
"name": artifact_name,
"commit": commit,
},
},
)
logging.info(
f"Trigger sent, response status: {response.status_code} - content: {response.content}"
)
logging.info("Finished")

20
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix:
# Python
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "monthly"
groups:
python-packages:
patterns:
- "*"
commit-message:
prefix:

View File

@@ -1,50 +1,124 @@
name: Build Docs
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize]
types:
- opened
- synchronize
jobs:
build:
runs-on: ubuntu-18.04
changes:
runs-on: ubuntu-latest
# Required permissions
permissions:
pull-requests: read
# Set job outputs to values from filter step
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- uses: actions/checkout@v4
# For pull requests it's not necessary to checkout the code but for master it is
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
docs:
- README.md
- docs/**
- docs_src/**
- requirements-docs.txt
- .github/workflows/build-docs.yml
- .github/workflows/deploy-docs.yml
langs:
needs:
- changes
runs-on: ubuntu-latest
outputs:
langs: ${{ steps.show-langs.outputs.langs }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-tests.txt') }}-v06
- name: Install docs extras
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-docs.txt
# Install MkDocs Material Insiders here just to put it in the cache for the rest of the steps
- name: Install Material for MkDocs Insiders
if: ( github.event_name != 'pull_request' || github.secret_source == 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
run: |
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/mkdocstrings-python.git
- name: Verify Docs
run: python ./scripts/docs.py verify-docs
- name: Export Language Codes
id: show-langs
run: |
echo "langs=$(python ./scripts/docs.py langs-json)" >> $GITHUB_OUTPUT
build-docs:
needs:
- changes
- langs
if: ${{ needs.changes.outputs.docs == 'true' }}
runs-on: ubuntu-latest
strategy:
matrix:
lang: ${{ fromJson(needs.langs.outputs.langs) }}
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.7"
- uses: actions/cache@v2
python-version: "3.11"
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-docs
- name: Install Flit
if: steps.cache.outputs.cache-hit != 'true'
run: python3.7 -m pip install flit
key: ${{ runner.os }}-python-docs-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-docs.txt', 'requirements-docs-tests.txt') }}-v06
- name: Install docs extras
if: steps.cache.outputs.cache-hit != 'true'
run: python3.7 -m flit install --extras doc
run: pip install -r requirements-docs.txt
- name: Install Material for MkDocs Insiders
if: github.event.pull_request.head.repo.fork == false && steps.cache.outputs.cache-hit != 'true'
run: pip install git+https://${{ secrets.ACTIONS_TOKEN }}@github.com/squidfunk/mkdocs-material-insiders.git
if: ( github.event_name != 'pull_request' || github.secret_source != 'Actions' ) && steps.cache.outputs.cache-hit != 'true'
run: |
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/squidfunk/mkdocs-material-insiders.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/griffe-typing-deprecated.git
pip install git+https://${{ secrets.FASTAPI_MKDOCS_MATERIAL_INSIDERS }}@github.com/pawamoy-insiders/mkdocstrings-python.git
- name: Update Languages
run: python ./scripts/docs.py update-languages
- uses: actions/cache@v3
with:
key: mkdocs-cards-${{ matrix.lang }}-${{ github.ref }}
path: docs/${{ matrix.lang }}/.cache
- name: Build Docs
run: python3.7 ./scripts/docs.py build-all
- name: Zip docs
run: bash ./scripts/zip-docs.sh
- uses: actions/upload-artifact@v2
run: python ./scripts/docs.py build-lang ${{ matrix.lang }}
- uses: actions/upload-artifact@v3
with:
name: docs-zip
path: ./docs.zip
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.1.5
name: docs-site
path: ./site/**
# https://github.com/marketplace/actions/alls-green#why
docs-all-green: # This job does nothing and is only used for the branch protection
if: always()
needs:
- build-docs
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
publish-dir: './site'
production-branch: master
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
jobs: ${{ toJSON(needs) }}
allowed-skips: build-docs

48
.github/workflows/deploy-docs.yml vendored Normal file
View File

@@ -0,0 +1,48 @@
name: Deploy Docs
on:
workflow_run:
workflows:
- Build Docs
types:
- completed
jobs:
deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Clean site
run: |
rm -rf ./site
mkdir ./site
- name: Download Artifact Docs
id: download
uses: dawidd6/action-download-artifact@v3.0.0
with:
if_no_artifact_found: ignore
github_token: ${{ secrets.FASTAPI_PREVIEW_DOCS_DOWNLOAD_ARTIFACTS }}
workflow: build-docs.yml
run_id: ${{ github.event.workflow_run.id }}
name: docs-site
path: ./site/
- name: Deploy to Cloudflare Pages
if: steps.download.outputs.found_artifact == 'true'
id: deploy
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: fastapitiangolo
directory: './site'
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ ( github.event.workflow_run.head_repository.full_name == github.repository && github.event.workflow_run.head_branch == 'master' && 'main' ) || ( github.event.workflow_run.head_sha ) }}
- name: Comment Deploy
if: steps.deploy.outputs.url != ''
uses: ./.github/actions/comment-docs-preview-in-pr
with:
token: ${{ secrets.FASTAPI_PREVIEW_DOCS_COMMENT_DEPLOY }}
deploy_url: "${{ steps.deploy.outputs.url }}"

View File

@@ -2,7 +2,7 @@ name: Issue Manager
on:
schedule:
- cron: "0 0 * * *"
- cron: "10 3 * * *"
issue_comment:
types:
- created
@@ -16,15 +16,24 @@ on:
jobs:
issue-manager:
if: github.repository_owner == 'tiangolo'
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: tiangolo/issue-manager@0.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.FASTAPI_ISSUE_MANAGER }}
config: >
{
"answered": {
"delay": 864000,
"message": "Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs."
},
"changes-requested": {
"delay": 2628000,
"message": "As this PR had requested changes to be applied but has been inactive for a while, it's now going to be closed. But if there's anyone interested, feel free to create a new PR."
}
}

View File

@@ -3,11 +3,25 @@ name: Label Approved
on:
schedule:
- cron: "0 12 * * *"
workflow_dispatch:
jobs:
label-approved:
if: github.repository_owner == 'tiangolo'
runs-on: ubuntu-latest
steps:
- uses: docker://tiangolo/label-approved:0.0.2
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: docker://tiangolo/label-approved:0.0.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.FASTAPI_LABEL_APPROVED }}
config: >
{
"approved-1":
{
"number": 1,
"await_label": "awaiting-review"
}
}

View File

@@ -11,15 +11,35 @@ on:
number:
description: PR number
required: true
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: 'false'
jobs:
latest-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker://tiangolo/latest-changes:0.0.3
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
with:
# To allow latest-changes to commit to the main branch
token: ${{ secrets.FASTAPI_LATEST_CHANGES }}
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- uses: docker://tiangolo/latest-changes:0.3.0
# - uses: tiangolo/latest-changes@main
with:
token: ${{ secrets.GITHUB_TOKEN }}
latest_changes_file: docs/en/docs/release-notes.md
latest_changes_header: '## Latest Changes\n\n'
latest_changes_header: '## Latest Changes'
end_regex: '^## '
debug_logs: true
label_header_prefix: '### '

View File

@@ -0,0 +1,35 @@
name: Notify Translations
on:
pull_request_target:
types:
- labeled
- closed
workflow_dispatch:
inputs:
number:
description: PR number
required: true
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: 'false'
jobs:
notify-translations:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
- uses: ./.github/actions/notify-translations
with:
token: ${{ secrets.FASTAPI_NOTIFY_TRANSLATIONS }}

View File

@@ -6,24 +6,29 @@ on:
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
default: 'false'
jobs:
fastapi-people:
if: github.repository_owner == 'tiangolo'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
# Ref: https://github.com/actions/runner/issues/2033
- name: Fix git safe.directory in container
run: mkdir -p /home/runner/work/_temp/_github_home && printf "[safe]\n\tdirectory = /github/workspace" > /home/runner/work/_temp/_github_home/.gitconfig
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
with:
limit-access-to-actor: true
token: ${{ secrets.ACTIONS_TOKEN }}
standard_token: ${{ secrets.GITHUB_TOKEN }}
- uses: ./.github/actions/people
with:
token: ${{ secrets.ACTIONS_TOKEN }}
standard_token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.FASTAPI_PEOPLE }}

View File

@@ -1,41 +0,0 @@
name: Preview Docs
on:
workflow_run:
workflows:
- Build Docs
types:
- completed
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Download Artifact Docs
uses: dawidd6/action-download-artifact@v2.9.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build-docs.yml
run_id: ${{ github.event.workflow_run.id }}
name: docs-zip
- name: Unzip docs
run: |
rm -rf ./site
unzip docs.zip
rm -f docs.zip
- name: Deploy to Netlify
id: netlify
uses: nwtgck/actions-netlify@v1.1.5
with:
publish-dir: './site'
production-deploy: false
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
- name: Comment Deploy
uses: ./.github/actions/comment-docs-preview-in-pr
with:
token: ${{ secrets.GITHUB_TOKEN }}
deploy_url: "${{ steps.netlify.outputs.deploy-url }}"

View File

@@ -13,34 +13,29 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.6"
- uses: actions/cache@v2
python-version: "3.10"
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
cache-dependency-path: pyproject.toml
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-publish
- name: Install Flit
- name: Install build dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install flit
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: flit install --symlink
run: pip install build
- name: Build distribution
run: python -m build
- name: Publish
env:
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
run: bash scripts/publish.sh
uses: pypa/gh-action-pypi-publish@v1.8.11
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
# - name: Notify
# env:
# GITTER_TOKEN: ${{ secrets.GITTER_TOKEN }}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TAG: ${{ github.event.release.name }}
# run: bash scripts/notify.sh

40
.github/workflows/smokeshow.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Smokeshow
on:
workflow_run:
workflows: [Test]
types: [completed]
permissions:
statuses: write
jobs:
smokeshow:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/setup-python@v5
with:
python-version: '3.9'
- run: pip install smokeshow
- uses: dawidd6/action-download-artifact@v3.0.0
with:
github_token: ${{ secrets.FASTAPI_SMOKESHOW_DOWNLOAD_ARTIFACTS }}
workflow: test.yml
commit: ${{ github.event.workflow_run.head_sha }}
- run: smokeshow upload coverage-html
env:
SMOKESHOW_GITHUB_STATUS_DESCRIPTION: Coverage {coverage-percentage}
SMOKESHOW_GITHUB_COVERAGE_THRESHOLD: 100
SMOKESHOW_GITHUB_CONTEXT: coverage
SMOKESHOW_GITHUB_TOKEN: ${{ secrets.FASTAPI_SMOKESHOW_UPLOAD }}
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }}

View File

@@ -2,35 +2,136 @@ name: Test
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize]
types:
- opened
- synchronize
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-pydantic-v2-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v07
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -r requirements-tests.txt
- name: Install Pydantic v2
run: pip install "pydantic>=2.0.2,<3.0.0"
- name: Lint
run: bash scripts/lint.sh
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
pydantic-version: ["pydantic-v1", "pydantic-v2"]
fail-fast: false
steps:
- uses: actions/checkout@v2
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- uses: actions/cache@v3
id: cache
with:
path: ${{ env.pythonLocation }}
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml') }}-test
- name: Install Flit
if: steps.cache.outputs.cache-hit != 'true'
run: pip install flit
key: ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ matrix.pydantic-version }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt', 'requirements-docs-tests.txt') }}-test-v07
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: flit install --symlink
run: pip install -r requirements-tests.txt
- name: Install Pydantic v1
if: matrix.pydantic-version == 'pydantic-v1'
run: pip install "pydantic>=1.10.0,<2.0.0"
- name: Install Pydantic v2
if: matrix.pydantic-version == 'pydantic-v2'
run: pip install "pydantic>=2.0.2,<3.0.0"
- run: mkdir coverage
- name: Test
run: bash scripts/test.sh
- name: Upload coverage
uses: codecov/codecov-action@v1
env:
COVERAGE_FILE: coverage/.coverage.${{ runner.os }}-py${{ matrix.python-version }}
CONTEXT: ${{ runner.os }}-py${{ matrix.python-version }}
- name: Store coverage files
uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
coverage-combine:
needs: [test]
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.8'
# Issue ref: https://github.com/actions/setup-python/issues/436
# cache: "pip"
# cache-dependency-path: pyproject.toml
- name: Get coverage files
uses: actions/download-artifact@v3
with:
name: coverage
path: coverage
- run: pip install coverage[toml]
- run: ls -la coverage
- run: coverage combine coverage
- run: coverage report
- run: coverage html --show-contexts --title "Coverage for ${{ github.sha }}"
- name: Store coverage HTML
uses: actions/upload-artifact@v3
with:
name: coverage-html
path: htmlcov
# https://github.com/marketplace/actions/alls-green#why
check: # This job does nothing and is only used for the branch protection
if: always()
needs:
- coverage-combine
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

5
.gitignore vendored
View File

@@ -16,6 +16,7 @@ Pipfile.lock
env3.*
env
docs_build
site_build
venv
docs.zip
archive.zip
@@ -23,3 +24,7 @@ archive.zip
# vim temporary files
*~
.*.sw?
.cache
# macOS
.DS_Store

25
.pre-commit-config.yaml Normal file
View File

@@ -0,0 +1,25 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
default_language_version:
python: python3.10
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-toml
- id: check-yaml
args:
- --unsafe
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.1.2
hooks:
- id: ruff
args:
- --fix
- id: ruff-format
ci:
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate

24
CITATION.cff Normal file
View File

@@ -0,0 +1,24 @@
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: FastAPI
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- given-names: Sebastián
family-names: Ramírez
email: tiangolo@gmail.com
identifiers:
repository-code: 'https://github.com/tiangolo/fastapi'
url: 'https://fastapi.tiangolo.com'
abstract: >-
FastAPI framework, high performance, easy to learn, fast to code,
ready for production
keywords:
- fastapi
- pydantic
- starlette
license: MIT

View File

@@ -5,15 +5,18 @@
<em>FastAPI framework, high performance, easy to learn, fast to code, ready for production</em>
</p>
<p align="center">
<a href="https://github.com/tiangolo/fastapi/actions?query=workflow%3ATest" target="_blank">
<img src="https://github.com/tiangolo/fastapi/workflows/Test/badge.svg" alt="Test">
<a href="https://github.com/tiangolo/fastapi/actions?query=workflow%3ATest+event%3Apush+branch%3Amaster" target="_blank">
<img src="https://github.com/tiangolo/fastapi/workflows/Test/badge.svg?event=push&branch=master" alt="Test">
</a>
<a href="https://codecov.io/gh/tiangolo/fastapi" target="_blank">
<img src="https://img.shields.io/codecov/c/github/tiangolo/fastapi?color=%2334D058" alt="Coverage">
<a href="https://coverage-badge.samuelcolvin.workers.dev/redirect/tiangolo/fastapi" target="_blank">
<img src="https://coverage-badge.samuelcolvin.workers.dev/tiangolo/fastapi.svg" alt="Coverage">
</a>
<a href="https://pypi.org/project/fastapi" target="_blank">
<img src="https://img.shields.io/pypi/v/fastapi?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://pypi.org/project/fastapi" target="_blank">
<img src="https://img.shields.io/pypi/pyversions/fastapi.svg?color=%2334D058" alt="Supported Python versions">
</a>
</p>
---
@@ -24,12 +27,11 @@
---
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ based on standard Python type hints.
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.8+ based on standard Python type hints.
The key features are:
* **Fast**: Very high performance, on par with **NodeJS** and **Go** (thanks to Starlette and Pydantic). [One of the fastest Python frameworks available](#performance).
* **Fast to code**: Increase the speed to develop features by about 200% to 300%. *
* **Fewer bugs**: Reduce about 40% of human (developer) induced errors. *
* **Intuitive**: Great editor support. <abbr title="also known as auto-complete, autocompletion, IntelliSense">Completion</abbr> everywhere. Less time debugging.
@@ -44,11 +46,22 @@ The key features are:
<!-- sponsors -->
<a href="https://cryptapi.io/" target="_blank" title="CryptAPI: Your easy to use, secure and privacy oriented payment gateway."><img src="https://fastapi.tiangolo.com/img/sponsors/cryptapi.svg"></a>
<a href="https://platform.sh/try-it-now/?utm_source=fastapi-signup&utm_medium=banner&utm_campaign=FastAPI-signup-June-2023" target="_blank" title="Build, run and scale your apps on a modern, reliable, and secure PaaS."><img src="https://fastapi.tiangolo.com/img/sponsors/platform-sh.png"></a>
<a href="https://www.porter.run" target="_blank" title="Deploy FastAPI on AWS with a few clicks"><img src="https://fastapi.tiangolo.com/img/sponsors/porter.png"></a>
<a href="https://bump.sh/fastapi?utm_source=fastapi&utm_medium=referral&utm_campaign=sponsor" target="_blank" title="Automate FastAPI documentation generation with Bump.sh"><img src="https://fastapi.tiangolo.com/img/sponsors/bump-sh.svg"></a>
<a href="https://reflex.dev" target="_blank" title="Reflex"><img src="https://fastapi.tiangolo.com/img/sponsors/reflex.png"></a>
<a href="https://github.com/scalar/scalar/?utm_source=fastapi&utm_medium=website&utm_campaign=main-badge" target="_blank" title="Scalar: Beautiful Open-Source API References from Swagger/OpenAPI files"><img src="https://fastapi.tiangolo.com/img/sponsors/scalar.svg"></a>
<a href="https://www.propelauth.com/?utm_source=fastapi&utm_campaign=1223&utm_medium=mainbadge" target="_blank" title="Auth, user management and more for your B2B product"><img src="https://fastapi.tiangolo.com/img/sponsors/propelauth.png"></a>
<a href="https://www.deta.sh/?ref=fastapi" target="_blank" title="The launchpad for all your (team's) ideas"><img src="https://fastapi.tiangolo.com/img/sponsors/deta.svg"></a>
<a href="https://bit.ly/2QSouzH" target="_blank" title="Jina: build neural search-as-a-service for any kind of data in just minutes."><img src="https://fastapi.tiangolo.com/img/sponsors/jina.svg"></a>
<a href="https://www.investsuite.com/jobs" target="_blank" title="Wealthtech jobs with FastAPI"><img src="https://fastapi.tiangolo.com/img/sponsors/investsuite.svg"></a>
<a href="https://www.vim.so/?utm_source=FastAPI" target="_blank" title="We help you master vim with interactive exercises"><img src="https://fastapi.tiangolo.com/img/sponsors/vimso.png"></a>
<a href="https://talkpython.fm/fastapi-sponsor" target="_blank" title="FastAPI video courses on demand from people you trust"><img src="https://fastapi.tiangolo.com/img/sponsors/talkpython.png"></a>
<a href="https://training.talkpython.fm/fastapi-courses" target="_blank" title="FastAPI video courses on demand from people you trust"><img src="https://fastapi.tiangolo.com/img/sponsors/talkpython.png"></a>
<a href="https://testdriven.io/courses/tdd-fastapi/" target="_blank" title="Learn to build high-quality web apps with best practices"><img src="https://fastapi.tiangolo.com/img/sponsors/testdriven.svg"></a>
<a href="https://github.com/deepset-ai/haystack/" target="_blank" title="Build powerful search from composable, open source building blocks"><img src="https://fastapi.tiangolo.com/img/sponsors/haystack-fastapi.svg"></a>
<a href="https://careers.powens.com/" target="_blank" title="Powens is hiring!"><img src="https://fastapi.tiangolo.com/img/sponsors/powens.png"></a>
<a href="https://databento.com/" target="_blank" title="Pay as you go for market data"><img src="https://fastapi.tiangolo.com/img/sponsors/databento.svg"></a>
<a href="https://speakeasyapi.dev?utm_source=fastapi+repo&utm_medium=github+sponsorship" target="_blank" title="SDKs for your API | Speakeasy"><img src="https://fastapi.tiangolo.com/img/sponsors/speakeasy.png"></a>
<a href="https://www.svix.com/" target="_blank" title="Svix - Webhooks as a service"><img src="https://fastapi.tiangolo.com/img/sponsors/svix.svg"></a>
<a href="https://www.codacy.com/?utm_source=github&utm_medium=sponsors&utm_id=pioneers" target="_blank" title="Take code reviews from hours to minutes"><img src="https://fastapi.tiangolo.com/img/sponsors/codacy.png"></a>
<!-- /sponsors -->
@@ -94,6 +107,12 @@ The key features are:
---
"_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._"
<div style="text-align: right; margin-right: 10%;">Deon Pillsbury - <strong>Cisco</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/" target="_blank"><small>(ref)</small></a></div>
---
## **Typer**, the FastAPI of CLIs
<a href="https://typer.tiangolo.com" target="_blank"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" style="width: 20%;"></a>
@@ -104,7 +123,7 @@ If you are building a <abbr title="Command Line Interface">CLI</abbr> app to be
## Requirements
Python 3.6+
Python 3.8+
FastAPI stands on the shoulders of giants:
@@ -123,12 +142,12 @@ $ pip install fastapi
</div>
You will also need an ASGI server, for production such as <a href="https://www.uvicorn.org" class="external-link" target="_blank">Uvicorn</a> or <a href="https://gitlab.com/pgjones/hypercorn" class="external-link" target="_blank">Hypercorn</a>.
You will also need an ASGI server, for production such as <a href="https://www.uvicorn.org" class="external-link" target="_blank">Uvicorn</a> or <a href="https://github.com/pgjones/hypercorn" class="external-link" target="_blank">Hypercorn</a>.
<div class="termy">
```console
$ pip install uvicorn[standard]
$ pip install "uvicorn[standard]"
---> 100%
```
@@ -142,7 +161,7 @@ $ pip install uvicorn[standard]
* Create a file `main.py` with:
```Python
from typing import Optional
from typing import Union
from fastapi import FastAPI
@@ -155,7 +174,7 @@ def read_root():
@app.get("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = None):
def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
```
@@ -165,7 +184,7 @@ def read_item(item_id: int, q: Optional[str] = None):
If your code uses `async` / `await`, use `async def`:
```Python hl_lines="9 14"
from typing import Optional
from typing import Union
from fastapi import FastAPI
@@ -178,7 +197,7 @@ async def read_root():
@app.get("/items/{item_id}")
async def read_item(item_id: int, q: Optional[str] = None):
async def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
```
@@ -257,7 +276,7 @@ Now modify the file `main.py` to receive a body from a `PUT` request.
Declare the body using standard Python types, thanks to Pydantic.
```Python hl_lines="4 9-12 25-27"
from typing import Optional
from typing import Union
from fastapi import FastAPI
from pydantic import BaseModel
@@ -268,7 +287,7 @@ app = FastAPI()
class Item(BaseModel):
name: str
price: float
is_offer: Optional[bool] = None
is_offer: Union[bool, None] = None
@app.get("/")
@@ -277,7 +296,7 @@ def read_root():
@app.get("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = None):
def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
@@ -314,13 +333,13 @@ And now, go to <a href="http://127.0.0.1:8000/redoc" class="external-link" targe
### Recap
In summary, you declare **once** the types of parameters, body, etc. as function parameters.
In summary, you declare **once** the types of parameters, body, etc. as function parameters.
You do that with standard modern Python types.
You don't have to learn a new syntax, the methods or classes of a specific library, etc.
Just standard **Python 3.6+**.
Just standard **Python 3.8+**.
For example, for an `int`:
@@ -371,7 +390,7 @@ Coming back to the previous code example, **FastAPI** will:
* As the `q` parameter is declared with `= None`, it is optional.
* Without the `None` it would be required (as is the body in the case with `PUT`).
* For `PUT` requests to `/items/{item_id}`, Read the body as JSON:
* Check that it has a required attribute `name` that should be a `str`.
* Check that it has a required attribute `name` that should be a `str`.
* Check that it has a required attribute `price` that has to be a `float`.
* Check that it has an optional attribute `is_offer`, that should be a `bool`, if present.
* All this would also work for deeply nested JSON objects.
@@ -416,10 +435,10 @@ For a more complete example including more features, see the <a href="https://fa
* A very powerful and easy to use **<abbr title="also known as components, resources, providers, services, injectables">Dependency Injection</abbr>** system.
* Security and authentication, including support for **OAuth2** with **JWT tokens** and **HTTP Basic** auth.
* More advanced (but equally easy) techniques for declaring **deeply nested JSON models** (thanks to Pydantic).
* **GraphQL** integration with <a href="https://strawberry.rocks" class="external-link" target="_blank">Strawberry</a> and other libraries.
* Many extra features (thanks to Starlette) as:
* **WebSockets**
* **GraphQL**
* extremely easy tests based on `requests` and `pytest`
* extremely easy tests based on HTTPX and `pytest`
* **CORS**
* **Cookie Sessions**
* ...and more.
@@ -434,26 +453,24 @@ To understand more about it, see the section <a href="https://fastapi.tiangolo.c
Used by Pydantic:
* <a href="https://github.com/esnme/ultrajson" target="_blank"><code>ujson</code></a> - for faster JSON <abbr title="converting the string that comes from an HTTP request into Python data">"parsing"</abbr>.
* <a href="https://github.com/JoshData/python-email-validator" target="_blank"><code>email_validator</code></a> - for email validation.
* <a href="https://docs.pydantic.dev/latest/usage/pydantic_settings/" target="_blank"><code>pydantic-settings</code></a> - for settings management.
* <a href="https://docs.pydantic.dev/latest/usage/types/extra_types/extra_types/" target="_blank"><code>pydantic-extra-types</code></a> - for extra types to be used with Pydantic.
Used by Starlette:
* <a href="https://requests.readthedocs.io" target="_blank"><code>requests</code></a> - Required if you want to use the `TestClient`.
* <a href="https://github.com/Tinche/aiofiles" target="_blank"><code>aiofiles</code></a> - Required if you want to use `FileResponse` or `StaticFiles`.
* <a href="https://www.python-httpx.org" target="_blank"><code>httpx</code></a> - Required if you want to use the `TestClient`.
* <a href="https://jinja.palletsprojects.com" target="_blank"><code>jinja2</code></a> - Required if you want to use the default template configuration.
* <a href="https://andrew-d.github.io/python-multipart/" target="_blank"><code>python-multipart</code></a> - Required if you want to support form <abbr title="converting the string that comes from an HTTP request into Python data">"parsing"</abbr>, with `request.form()`.
* <a href="https://pythonhosted.org/itsdangerous/" target="_blank"><code>itsdangerous</code></a> - Required for `SessionMiddleware` support.
* <a href="https://pyyaml.org/wiki/PyYAMLDocumentation" target="_blank"><code>pyyaml</code></a> - Required for Starlette's `SchemaGenerator` support (you probably don't need it with FastAPI).
* <a href="https://graphene-python.org/" target="_blank"><code>graphene</code></a> - Required for `GraphQLApp` support.
* <a href="https://github.com/esnme/ultrajson" target="_blank"><code>ujson</code></a> - Required if you want to use `UJSONResponse`.
Used by FastAPI / Starlette:
* <a href="https://www.uvicorn.org" target="_blank"><code>uvicorn</code></a> - for the server that loads and serves your application.
* <a href="https://github.com/ijl/orjson" target="_blank"><code>orjson</code></a> - Required if you want to use `ORJSONResponse`.
You can install all of these with `pip install fastapi[all]`.
You can install all of these with `pip install "fastapi[all]"`.
## License

View File

@@ -6,7 +6,7 @@ Learn more about it below. 👇
## Versions
The latest versions of FastAPI are supported.
The latest version of FastAPI is supported.
You are encouraged to [write tests](https://fastapi.tiangolo.com/tutorial/testing/) for your application and update your FastAPI version frequently after ensuring that your tests are passing. This way you will benefit from the latest features, bug fixes, and **security fixes**.

464
docs/bn/docs/index.md Normal file
View File

@@ -0,0 +1,464 @@
<p align="center">
<a href="https://fastapi.tiangolo.com"><img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" alt="FastAPI"></a>
</p>
<p align="center">
<em>FastAPI উচ্চক্ষমতা সম্পন্ন, সহজে শেখার এবং দ্রুত কোড করে প্রোডাকশনের জন্য ফ্রামওয়ার্ক।</em>
</p>
<p align="center">
<a href="https://github.com/tiangolo/fastapi/actions?query=workflow%3ATest" target="_blank">
<img src="https://github.com/tiangolo/fastapi/workflows/Test/badge.svg" alt="Test">
</a>
<a href="https://codecov.io/gh/tiangolo/fastapi" target="_blank">
<img src="https://img.shields.io/codecov/c/github/tiangolo/fastapi?color=%2334D058" alt="Coverage">
</a>
<a href="https://pypi.org/project/fastapi" target="_blank">
<img src="https://img.shields.io/pypi/v/fastapi?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
</p>
---
**নির্দেশিকা নথি**: <a href="https://fastapi.tiangolo.com" target="_blank">https://fastapi.tiangolo.com</a>
**সোর্স কোড**: <a href="https://github.com/tiangolo/fastapi" target="_blank">https://github.com/tiangolo/fastapi</a>
---
FastAPI একটি আধুনিক, দ্রুত ( বেশি ক্ষমতা ) সম্পন্ন, Python 3.6+ দিয়ে API তৈরির জন্য স্ট্যান্ডার্ড পাইথন টাইপ ইঙ্গিত ভিত্তিক ওয়েব ফ্রেমওয়ার্ক।
এর মূল বৈশিষ্ট্য গুলো হলঃ
- **গতি**: এটি **NodeJS** এবং **Go** এর মত কার্যক্ষমতা সম্পন্ন (Starlette এবং Pydantic এর সাহায্যে)। [পাইথন এর দ্রুততম ফ্রেমওয়ার্ক গুলোর মধ্যে এটি একটি](#_11)।
- **দ্রুত কোড করা**:বৈশিষ্ট্য তৈরির গতি ২০০% থেকে ৩০০% বৃদ্ধি করে৷ \*
- **স্বল্প bugs**: মানুব (ডেভেলপার) সৃষ্ট ত্রুটির প্রায় % হ্রাস করে। \*
- **স্বজ্ঞাত**: দুর্দান্ত এডিটর সাহায্য <abbr title="also known as auto-complete, autocompletion, IntelliSense">Completion</abbr> নামেও পরিচিত। দ্রুত ডিবাগ করা যায়।
- **সহজ**: এটি এমন ভাবে সজানো হয়েছে যেন নির্দেশিকা নথি পড়ে সহজে শেখা এবং ব্যবহার করা যায়।
- **সংক্ষিপ্ত**: কোড পুনরাবৃত্তি কমানোর পাশাপাশি, bug কমায় এবং প্রতিটি প্যারামিটার ঘোষণা থেকে একাধিক ফিচার পাওয়া যায় ।
- **জোরালো**: স্বয়ংক্রিয় ভাবে তৈরি ক্রিয়াশীল নির্দেশনা নথি (documentation) সহ উৎপাদন উপযোগি (Production-ready) কোড পাওয়া যায়।
- **মান-ভিত্তিক**: এর ভিত্তি <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a> (যা পুর্বে Swagger নামে পরিচিত ছিল) এবং <a href="https://json-schema.org/" class="external-link" target="_blank">JSON Schema</a> এর আদর্শের মানের ওপর
<small>\* উৎপাদনমুখি এপ্লিকেশন বানানোর এক দল ডেভেলপার এর মতামত ভিত্তিক ফলাফল।</small>
## স্পনসর গণ
<!-- sponsors -->
{% if sponsors %}
{% for sponsor in sponsors.gold -%}
<a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
{% endfor -%}
{%- for sponsor in sponsors.silver -%}
<a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
{% endfor %}
{% endif %}
<!-- /sponsors -->
<a href="https://fastapi.tiangolo.com/fastapi-people/#sponsors" class="external-link" target="_blank">অন্যান্য স্পনসর গণ</a>
## মতামত সমূহ
"_আমি আজকাল **FastAPI** ব্যবহার করছি। [...] আমরা ভাবছি মাইক্রোসফ্টে **ML সার্ভিস** এ সকল দলের জন্য এটি ব্যবহার করব। যার মধ্যে কিছু পণ্য **Windows** এ সংযোযন হয় এবং কিছু **Office** এর সাথে সংযোযন হচ্ছে।_"
<div style="text-align: right; margin-right: 10%;">কবির খান - <strong>মাইক্রোসফ্টে</strong> <a href="https://github.com/tiangolo/fastapi/pull/26" target="_blank"><small>(ref)</small></a></div>
---
"_আমরা **FastAPI** লাইব্রেরি গ্রহণ করেছি একটি **REST** সার্ভার তৈরি করতে, যা **ভবিষ্যদ্বাণী** পাওয়ার জন্য কুয়েরি করা যেতে পারে। [লুডউইগের জন্য]_"
<div style="text-align: right; margin-right: 10%;">পিয়েরো মোলিনো, ইয়ারোস্লাভ দুদিন, এবং সাই সুমন্থ মিরিয়ালা - <strong>উবার</strong> <a href="https://eng.uber.com/ludwig-v0-2/" target="_blank"><small>(ref)</small></a></div>
---
"_**Netflix** আমাদের **ক্রাইসিস ম্যানেজমেন্ট** অর্কেস্ট্রেশন ফ্রেমওয়ার্ক: **ডিসপ্যাচ** এর ওপেন সোর্স রিলিজ ঘোষণা করতে পেরে আনন্দিত! [যাকিনা **FastAPI** দিয়ে নির্মিত]_"
<div style="text-align: right; margin-right: 10%;">কেভিন গ্লিসন, মার্ক ভিলানোভা, ফরেস্ট মনসেন - <strong>নেটফ্লিক্স</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072" target="_blank"><small>(ref)</small></a></div>
---
"_আমি **FastAPI** নিয়ে চাঁদের সমান উৎসাহিত। এটি খুবই মজার!_"
<div style="text-align: right; margin-right: 10%;">ব্রায়ান ওকেন - <strong><a href="https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855" target="_blank">পাইথন বাইটস</a> পডকাস্ট হোস্ট</strong> <a href="https://twitter.com/brianokken/status/1112220079972728832" target="_blank"><small>(ref)</small></a></div>
---
"\_সত্যিই, আপনি যা তৈরি করেছেন তা খুব মজবুত এবং পরিপূর্ন৷ অনেক উপায়ে, আমি যা **Hug** এ করতে চেয়েছিলাম - তা কাউকে তৈরি করতে দেখে আমি সত্যিই অনুপ্রানিত৷\_"
<div style="text-align: right; margin-right: 10%;">টিমোথি ক্রসলে - <strong><a href="https://www.hug.rest/" target="_blank">Hug</a> স্রষ্টা</strong> <a href="https://news.ycombinator.com/item?id=19455465" target="_blank"><small>(ref)</small></a></div>
---
"আপনি যদি REST API তৈরির জন্য একটি **আধুনিক ফ্রেমওয়ার্ক** শিখতে চান, তাহলে **FastAPI** দেখুন [...] এটি দ্রুত, ব্যবহার করা সহজ এবং শিখতেও সহজ [...]\_"
"_আমরা আমাদের **APIs** [...] এর জন্য **FastAPI**- তে এসেছি [...] আমি মনে করি আপনিও এটি পছন্দ করবেন [...]_"
<div style="text-align: right; margin-right: 10%;">ইনেস মন্টানি - ম্যাথিউ হোনিবাল - <strong><a href="https://explosion.ai" target="_blank">Explosion AI</a> প্রতিষ্ঠাতা - <a href="https://spacy.io" target="_blank">spaCy</a> স্রষ্টা</strong> <a href="https://twitter.com/_inesmontani/status/1144173225322143744" target="_blank"><small>(ref)</small></a> - <a href="https://twitter.com/honnibal/status/1144031421859655680" target="_blank"><small>(ref)</small></a></div>
---
## **Typer**, CLI এর জন্য FastAPI
<a href="https://typer.tiangolo.com" target="_blank"><img src="https://typer.tiangolo.com/img/logo-margin/logo-margin-vector.svg" style="width: 20%;"></a>
আপনি যদি <abbr title="Command Line Interface">CLI</abbr> অ্যাপ বানাতে চান, যা কিনা ওয়েব API এর পরিবর্তে টার্মিনালে ব্যবহার হবে, তাহলে দেখুন<a href="https://typer.tiangolo.com/" class="external-link" target="_blank">**Typer**</a>.
**টাইপার** হল FastAPI এর ছোট ভাইয়ের মত। এবং এটির উদ্দেশ্য ছিল **CLIs এর FastAPI** হওয়া। ⌨️ 🚀
## প্রয়োজনীয়তা গুলো
Python 3.7+
FastAPI কিছু দানবেদের কাঁধে দাঁড়িয়ে আছে:
- <a href="https://www.starlette.io/" class="external-link" target="_blank">Starlette</a> ওয়েব অংশের জন্য.
- <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> ডেটা অংশগুলির জন্য.
## ইনস্টলেশন প্রক্রিয়া
<div class="termy">
```console
$ pip install fastapi
---> 100%
```
</div>
আপনার একটি ASGI সার্ভারেরও প্রয়োজন হবে, প্রোডাকশনের জন্য <a href="https://www.uvicorn.org" class="external-link" target="_blank">Uvicorn</a> অথবা <a href="https://gitlab.com/pgjones/hypercorn" class="external-link" target="_blank">Hypercorn</a>.
<div class="termy">
```console
$ pip install "uvicorn[standard]"
---> 100%
```
</div>
## উদাহরণ
### তৈরি
- `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}
```
<details markdown="1">
<summary>অথবা ব্যবহার করুন <code>async def</code>...</summary>
যদি আপনার কোড `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}
```
**টীকা**:
আপনি যদি না জানেন, _"তাড়াহুড়ো?"_ বিভাগটি দেখুন <a href="https://fastapi.tiangolo.com/async/#in-a-hurry" target="_blank">`async` এবং `await` নথির মধ্যে দেখুন </a>.
</details>
### এটি চালান
সার্ভার চালু করুন:
<div class="termy">
```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.
```
</div>
<details markdown="1">
<summary>নির্দেশনা সম্পর্কে <code>uvicorn main:app --reload</code>...</summary>
`uvicorn main:app` নির্দেশনাটি দ্বারা বোঝায়:
- `main`: ফাইল `main.py` (পাইথন "মডিউল")।
- `app`: `app = FastAPI()` লাইন দিয়ে `main.py` এর ভিতরে তৈরি করা অবজেক্ট।
- `--reload`: কোড পরিবর্তনের পরে সার্ভার পুনরায় চালু করুন। এটি শুধুমাত্র ডেভেলপমেন্ট এর সময় ব্যবহার করুন।
</details>
### এটা চেক করুন
আপনার ব্রাউজার খুলুন <a href="http://127.0.0.1:8000/items/5?q=somequery" class="external-link" target="_blank">http://127.0.0.1:8000/items/5?q=somequery</a> এ।
আপনি JSON রেসপন্স দেখতে পাবেন:
```JSON
{"item_id": 5, "q": "somequery"}
```
আপনি ইতিমধ্যে একটি API তৈরি করেছেন যা:
- `/` এবং `/items/{item_id}` _paths_ এ HTTP অনুরোধ গ্রহণ করে।
- উভয় *path*ই `GET` <em>অপারেশন</em> নেয় ( যা HTTP _methods_ নামেও পরিচিত)।
- _path_ `/items/{item_id}`-এ একটি _path প্যারামিটার_ `item_id` আছে যা কিনা `int` হতে হবে।
- _path_ `/items/{item_id}`-এর একটি ঐচ্ছিক `str` _query প্যারামিটার_ `q` আছে।
### ক্রিয়াশীল API নির্দেশিকা নথি
এখন যান <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
আপনি স্বয়ংক্রিয় ভাবে প্রস্তুত ক্রিয়াশীল API নির্দেশিকা নথি দেখতে পাবেন (<a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">Swagger UI</a> প্রদত্ত):
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
### বিকল্প API নির্দেশিকা নথি
এবং এখন <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> এ যান.
আপনি স্বয়ংক্রিয় ভাবে প্রস্তুত বিকল্প নির্দেশিকা নথি দেখতে পাবেন (<a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">ReDoc</a> প্রদত্ত):
![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 নির্দেশিকা নথি উন্নীতকরণ
এখন <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> এডড্রেসে যান.
- ক্রিয়াশীল 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 নির্দেশিকা নথি আপগ্রেড
এবং এখন <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> এ যান।
- বিকল্প নির্দেশিকা নথিতেও নতুন কুয়েরি প্যারামিটার এবং বডি প্রতিফলিত হবে:
![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 অবজেক্টের জন্য বৈধতা।
- প্রেরিত তথ্য <abbr title="যা পরিচিত: serialization, parsing, marshalling">রূপান্তর</abbr>: যা নেটওয়ার্ক থেকে পাইথনের তথ্য এবং ধরনে আসে, এবং সেখান থেকে পড়া:
- JSON।
- পাথ প্যারামিটার।
- কুয়েরি প্যারামিটার।
- কুকিজ
- হেডার
- ফর্ম
- ফাইল
- আউটপুট ডেটার <abbr title="যা পরিচিত: serialization, parsing, marshalling">রূপান্তর</abbr>: পাইথন ডেটা এবং টাইপ থেকে নেটওয়ার্ক ডেটাতে রূপান্তর করা (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)
আরও বৈশিষ্ট্য সম্পন্ন উদাহরণের জন্য, দেখুন <a href="https://fastapi.tiangolo.com/tutorial/">টিউটোরিয়াল - ব্যবহারকারীর গাইড</a>.
**স্পয়লার সতর্কতা**: টিউটোরিয়াল - ব্যবহারকারীর গাইড নিম্নোক্ত বিষয়গুলি অন্তর্ভুক্ত করে:
- **হেডার**, **কুকিজ**, **ফর্ম ফিল্ড** এবং **ফাইলগুলি** এমন অন্যান্য জায়গা থেকে প্যারামিটার ঘোষণা করা।
- `maximum_length` বা `regex` এর মতো **যাচাইকরণ বাধামুক্তি** সেট করা হয় কিভাবে, তা নিয়ে আলোচনা করা হবে।
- একটি খুব শক্তিশালী এবং ব্যবহার করা সহজ <abbr title="also known as components, resources, providers, services, injectables">ডিপেন্ডেন্সি ইনজেকশন</abbr> পদ্ধতি
- **OAuth2** এবং **JWT টোকেন** এবং **HTTP Basic** auth সহ নিরাপত্তা এবং অনুমোদনপ্রাপ্তি সম্পর্কিত বিষয়সমূহের উপর।
- **গভীরভাবে অবস্থানরত JSON মডেল** ঘোষণা করার জন্য আরও উন্নত (কিন্তু সমান সহজ) কৌশল (Pydantic কে ধন্যবাদ)।
- আরো অতিরিক্ত বৈশিষ্ট্য (স্টারলেটকে ধন্যবাদ) হিসাবে:
- **WebSockets**
- **GraphQL**
- HTTPX এবং `pytest` ভিত্তিক অত্যন্ত সহজ পরীক্ষা
- **CORS**
- **Cookie Sessions**
- ...এবং আরো।
## কর্মক্ষমতা
স্বাধীন TechEmpower Benchmarks দেখায় যে **FastAPI** অ্যাপ্লিকেশনগুলি Uvicorn-এর অধীনে চলমান দ্রুততম<a href="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7" class="external-link" target="_blank">পাইথন ফ্রেমওয়ার্কগুলির মধ্যে একটি,</a> শুধুমাত্র Starlette এবং Uvicorn-এর পর (FastAPI দ্বারা অভ্যন্তরীণভাবে ব্যবহৃত)। (\*)
এটি সম্পর্কে আরও বুঝতে, দেখুন <a href="https://fastapi.tiangolo.com/benchmarks/" class="internal-link" target="_blank">Benchmarks</a>.
## ঐচ্ছিক নির্ভরশীলতা
Pydantic দ্বারা ব্যবহৃত:
- <a href="https://github.com/esnme/ultrajson" target="_blank"><code>ujson</code></a> - দ্রুত JSON এর জন্য <abbr title="converting the string that comes from an HTTP request into Python data">"parsing"</abbr>.
- <a href="https://github.com/JoshData/python-email-validator" target="_blank"><code>email_validator</code></a> - ইমেল যাচাইকরণের জন্য।
স্টারলেট দ্বারা ব্যবহৃত:
- <a href="https://www.python-httpx.org" target="_blank"><code>httpx</code></a> - আপনি যদি `TestClient` ব্যবহার করতে চান তাহলে আবশ্যক।
- <a href="https://jinja.palletsprojects.com" target="_blank"><code>jinja2</code></a> - আপনি যদি প্রদত্ত টেমপ্লেট রূপরেখা ব্যবহার করতে চান তাহলে প্রয়োজন।
- <a href="https://andrew-d.github.io/python-multipart/" target="_blank"><code>python-multipart</code></a> - আপনি যদি ফর্ম সহায়তা করতে চান তাহলে প্রয়োজন <abbr title="converting the string that comes from an HTTP request into Python data">"parsing"</abbr>, `request.form()` সহ।
- <a href="https://pythonhosted.org/itsdangerous/" target="_blank"><code>itsdangerous</code></a> - `SessionMiddleware` সহায়তার জন্য প্রয়োজন।
- <a href="https://pyyaml.org/wiki/PyYAMLDocumentation" target="_blank"><code>pyyaml</code></a> - স্টারলেটের SchemaGenerator সাপোর্ট এর জন্য প্রয়োজন (আপনার সম্ভাবত FastAPI প্রয়োজন নেই)।
- <a href="https://graphene-python.org/" target="_blank"><code>graphene</code></a> - `GraphQLApp` সহায়তার জন্য প্রয়োজন।
- <a href="https://github.com/esnme/ultrajson" target="_blank"><code>ujson</code></a> - আপনি `UJSONResponse` ব্যবহার করতে চাইলে প্রয়োজন।
FastAPI / Starlette দ্বারা ব্যবহৃত:
- <a href="https://www.uvicorn.org" target="_blank"><code>uvicorn</code></a> - সার্ভারের জন্য যা আপনার অ্যাপ্লিকেশন লোড করে এবং পরিবেশন করে।
- <a href="https://github.com/ijl/orjson" target="_blank"><code>orjson</code></a> - আপনি `ORJSONResponse` ব্যবহার করতে চাইলে প্রয়োজন।
আপনি এই সব ইনস্টল করতে পারেন `pip install fastapi[all]` দিয়ে.
## লাইসেন্স
এই প্রজেক্ট MIT লাইসেন্স নীতিমালার অধীনে শর্তায়িত।

1
docs/bn/mkdocs.yml Normal file
View File

@@ -0,0 +1 @@
INHERIT: ../en/mkdocs.yml

View File

@@ -0,0 +1,3 @@
# Über
Über FastAPI, sein Design, seine Inspiration und mehr. 🤓

View File

@@ -0,0 +1,69 @@
# Zusätzliche Statuscodes
Standardmäßig liefert **FastAPI** die Rückgabewerte (Responses) als `JSONResponse` zurück und fügt den Inhalt der jeweiligen *Pfadoperation* in das `JSONResponse` Objekt ein.
Es wird der Default-Statuscode oder derjenige verwendet, den Sie in Ihrer *Pfadoperation* festgelegt haben.
## Zusätzliche Statuscodes
Wenn Sie neben dem Hauptstatuscode weitere Statuscodes zurückgeben möchten, können Sie dies tun, indem Sie direkt eine `Response` zurückgeben, wie etwa eine `JSONResponse`, und den zusätzlichen Statuscode direkt festlegen.
Angenommen, Sie möchten eine *Pfadoperation* haben, die das Aktualisieren von Artikeln ermöglicht und bei Erfolg den HTTP-Statuscode 200 „OK“ zurückgibt.
Sie möchten aber auch, dass sie neue Artikel akzeptiert. Und wenn die Elemente vorher nicht vorhanden waren, werden diese Elemente erstellt und der HTTP-Statuscode 201 „Created“ zurückgegeben.
Um dies zu erreichen, importieren Sie `JSONResponse`, und geben Sie Ihren Inhalt direkt zurück, indem Sie den gewünschten `status_code` setzen:
=== "Python 3.10+"
```Python hl_lines="4 25"
{!> ../../../docs_src/additional_status_codes/tutorial001_an_py310.py!}
```
=== "Python 3.9+"
```Python hl_lines="4 25"
{!> ../../../docs_src/additional_status_codes/tutorial001_an_py39.py!}
```
=== "Python 3.8+"
```Python hl_lines="4 26"
{!> ../../../docs_src/additional_status_codes/tutorial001_an.py!}
```
=== "Python 3.10+ nicht annotiert"
!!! tip "Tipp"
Bevorzugen Sie die `Annotated`-Version, falls möglich.
```Python hl_lines="2 23"
{!> ../../../docs_src/additional_status_codes/tutorial001_py310.py!}
```
=== "Python 3.8+ nicht annotiert"
!!! tip "Tipp"
Bevorzugen Sie die `Annotated`-Version, falls möglich.
```Python hl_lines="4 25"
{!> ../../../docs_src/additional_status_codes/tutorial001.py!}
```
!!! warning "Achtung"
Wenn Sie eine `Response` direkt zurückgeben, wie im obigen Beispiel, wird sie direkt zurückgegeben.
Sie wird nicht mit einem Modell usw. serialisiert.
Stellen Sie sicher, dass sie die gewünschten Daten enthält und dass die Werte gültiges JSON sind (wenn Sie `JSONResponse` verwenden).
!!! note "Technische Details"
Sie können auch `from starlette.responses import JSONResponse` verwenden.
**FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette. Das Gleiche gilt für `status`.
## OpenAPI- und API-Dokumentation
Wenn Sie zusätzliche Statuscodes und Responses direkt zurückgeben, werden diese nicht in das OpenAPI-Schema (die API-Dokumentation) aufgenommen, da FastAPI keine Möglichkeit hat, im Voraus zu wissen, was Sie zurückgeben werden.
Sie können das jedoch in Ihrem Code dokumentieren, indem Sie Folgendes verwenden: [Zusätzliche Responses](additional-responses.md){.internal-link target=_blank}.

View File

@@ -0,0 +1,300 @@
# Benutzerdefinierte Response HTML, Stream, Datei, andere
Standardmäßig gibt **FastAPI** die Responses mittels `JSONResponse` zurück.
Sie können das überschreiben, indem Sie direkt eine `Response` zurückgeben, wie in [Eine Response direkt zurückgeben](response-directly.md){.internal-link target=_blank} gezeigt.
Wenn Sie jedoch direkt eine `Response` zurückgeben, werden die Daten nicht automatisch konvertiert und die Dokumentation wird nicht automatisch generiert (zum Beispiel wird der spezifische „Medientyp“, der im HTTP-Header `Content-Type` angegeben ist, nicht Teil der generierten OpenAPI).
Sie können aber auch die `Response`, die Sie verwenden möchten, im *Pfadoperation-Dekorator* deklarieren.
Der Inhalt, den Sie von Ihrer *Pfadoperation-Funktion* zurückgeben, wird in diese `Response` eingefügt.
Und wenn diese `Response` einen JSON-Medientyp (`application/json`) hat, wie es bei `JSONResponse` und `UJSONResponse` der Fall ist, werden die von Ihnen zurückgegebenen Daten automatisch mit jedem Pydantic `response_model` konvertiert (und gefiltert), das Sie im *Pfadoperation-Dekorator* deklariert haben.
!!! note "Hinweis"
Wenn Sie eine Response-Klasse ohne Medientyp verwenden, erwartet FastAPI, dass Ihre Response keinen Inhalt hat, und dokumentiert daher das Format der Response nicht in deren generierter OpenAPI-Dokumentation.
## `ORJSONResponse` verwenden
Um beispielsweise noch etwas Leistung herauszuholen, können Sie <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> installieren und verwenden, und die Response als `ORJSONResponse` deklarieren.
Importieren Sie die `Response`-Klasse (-Unterklasse), die Sie verwenden möchten, und deklarieren Sie sie im *Pfadoperation-Dekorator*.
Bei umfangreichen Responses ist die direkte Rückgabe einer `Response` viel schneller als ein Dictionary zurückzugeben.
Das liegt daran, dass FastAPI standardmäßig jedes enthaltene Element überprüft und sicherstellt, dass es als JSON serialisierbar ist, und zwar unter Verwendung desselben [JSON-kompatiblen Encoders](../tutorial/encoder.md){.internal-link target=_blank}, der im Tutorial erläutert wurde. Dadurch können Sie **beliebige Objekte** zurückgeben, zum Beispiel Datenbankmodelle.
Wenn Sie jedoch sicher sind, dass der von Ihnen zurückgegebene Inhalt **mit JSON serialisierbar** ist, können Sie ihn direkt an die Response-Klasse übergeben und die zusätzliche Arbeit vermeiden, die FastAPI hätte, indem es Ihren zurückgegebenen Inhalt durch den `jsonable_encoder` leitet, bevor es ihn an die Response-Klasse übergibt.
```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial001b.py!}
```
!!! info
Der Parameter `response_class` wird auch verwendet, um den „Medientyp“ der Response zu definieren.
In diesem Fall wird der HTTP-Header `Content-Type` auf `application/json` gesetzt.
Und er wird als solcher in OpenAPI dokumentiert.
!!! tip "Tipp"
Die `ORJSONResponse` ist derzeit nur in FastAPI verfügbar, nicht in Starlette.
## HTML-Response
Um eine Response mit HTML direkt von **FastAPI** zurückzugeben, verwenden Sie `HTMLResponse`.
* Importieren Sie `HTMLResponse`.
* Übergeben Sie `HTMLResponse` als den Parameter `response_class` Ihres *Pfadoperation-Dekorators*.
```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial002.py!}
```
!!! info
Der Parameter `response_class` wird auch verwendet, um den „Medientyp“ der Response zu definieren.
In diesem Fall wird der HTTP-Header `Content-Type` auf `text/html` gesetzt.
Und er wird als solcher in OpenAPI dokumentiert.
### Eine `Response` zurückgeben
Wie in [Eine Response direkt zurückgeben](response-directly.md){.internal-link target=_blank} gezeigt, können Sie die Response auch direkt in Ihrer *Pfadoperation* überschreiben, indem Sie diese zurückgeben.
Das gleiche Beispiel von oben, das eine `HTMLResponse` zurückgibt, könnte so aussehen:
```Python hl_lines="2 7 19"
{!../../../docs_src/custom_response/tutorial003.py!}
```
!!! warning "Achtung"
Eine `Response`, die direkt von Ihrer *Pfadoperation-Funktion* zurückgegeben wird, wird in OpenAPI nicht dokumentiert (zum Beispiel wird der `Content-Type` nicht dokumentiert) und ist in der automatischen interaktiven Dokumentation nicht sichtbar.
!!! info
Natürlich stammen der eigentliche `Content-Type`-Header, der Statuscode, usw., aus dem `Response`-Objekt, das Sie zurückgegeben haben.
### In OpenAPI dokumentieren und `Response` überschreiben
Wenn Sie die Response innerhalb der Funktion überschreiben und gleichzeitig den „Medientyp“ in OpenAPI dokumentieren möchten, können Sie den `response_class`-Parameter verwenden UND ein `Response`-Objekt zurückgeben.
Die `response_class` wird dann nur zur Dokumentation der OpenAPI-Pfadoperation* verwendet, Ihre `Response` wird jedoch unverändert verwendet.
#### Eine `HTMLResponse` direkt zurückgeben
Es könnte zum Beispiel so etwas sein:
```Python hl_lines="7 21 23"
{!../../../docs_src/custom_response/tutorial004.py!}
```
In diesem Beispiel generiert die Funktion `generate_html_response()` bereits eine `Response` und gibt sie zurück, anstatt das HTML in einem `str` zurückzugeben.
Indem Sie das Ergebnis des Aufrufs von `generate_html_response()` zurückgeben, geben Sie bereits eine `Response` zurück, die das Standardverhalten von **FastAPI** überschreibt.
Aber da Sie die `HTMLResponse` auch in der `response_class` übergeben haben, weiß **FastAPI**, dass sie in OpenAPI und der interaktiven Dokumentation als HTML mit `text/html` zu dokumentieren ist:
<img src="/img/tutorial/custom-response/image01.png">
## Verfügbare Responses
Hier sind einige der verfügbaren Responses.
Bedenken Sie, dass Sie `Response` verwenden können, um alles andere zurückzugeben, oder sogar eine benutzerdefinierte Unterklasse zu erstellen.
!!! note "Technische Details"
Sie können auch `from starlette.responses import HTMLResponse` verwenden.
**FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette.
### `Response`
Die Hauptklasse `Response`, alle anderen Responses erben von ihr.
Sie können sie direkt zurückgeben.
Sie akzeptiert die folgenden Parameter:
* `content` Ein `str` oder `bytes`.
* `status_code` Ein `int`-HTTP-Statuscode.
* `headers` Ein `dict` von Strings.
* `media_type` Ein `str`, der den Medientyp angibt. Z. B. `"text/html"`.
FastAPI (eigentlich Starlette) fügt automatisch einen Content-Length-Header ein. Außerdem wird es einen Content-Type-Header einfügen, der auf dem media_type basiert, und für Texttypen einen Zeichensatz (charset) anfügen.
```Python hl_lines="1 18"
{!../../../docs_src/response_directly/tutorial002.py!}
```
### `HTMLResponse`
Nimmt Text oder Bytes entgegen und gibt eine HTML-Response zurück, wie Sie oben gelesen haben.
### `PlainTextResponse`
Nimmt Text oder Bytes entgegen und gibt eine Plain-Text-Response zurück.
```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial005.py!}
```
### `JSONResponse`
Nimmt einige Daten entgegen und gibt eine `application/json`-codierte Response zurück.
Dies ist die Standard-Response, die in **FastAPI** verwendet wird, wie Sie oben gelesen haben.
### `ORJSONResponse`
Eine schnelle alternative JSON-Response mit <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a>, wie Sie oben gelesen haben.
### `UJSONResponse`
Eine alternative JSON-Response mit <a href="https://github.com/ultrajson/ultrajson" class="external-link" target="_blank">`ujson`</a>.
!!! warning "Achtung"
`ujson` ist bei der Behandlung einiger Sonderfälle weniger sorgfältig als Pythons eingebaute Implementierung.
```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial001.py!}
```
!!! tip "Tipp"
Möglicherweise ist `ORJSONResponse` eine schnellere Alternative.
### `RedirectResponse`
Gibt eine HTTP-Weiterleitung (HTTP-Redirect) zurück. Verwendet standardmäßig den Statuscode 307 Temporäre Weiterleitung (Temporary Redirect).
Sie können eine `RedirectResponse` direkt zurückgeben:
```Python hl_lines="2 9"
{!../../../docs_src/custom_response/tutorial006.py!}
```
---
Oder Sie können sie im Parameter `response_class` verwenden:
```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial006b.py!}
```
Wenn Sie das tun, können Sie die URL direkt von Ihrer *Pfadoperation*-Funktion zurückgeben.
In diesem Fall ist der verwendete `status_code` der Standardcode für die `RedirectResponse`, also `307`.
---
Sie können den Parameter `status_code` auch in Kombination mit dem Parameter `response_class` verwenden:
```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial006c.py!}
```
### `StreamingResponse`
Nimmt einen asynchronen Generator oder einen normalen Generator/Iterator und streamt den Responsebody.
```Python hl_lines="2 14"
{!../../../docs_src/custom_response/tutorial007.py!}
```
#### Verwendung von `StreamingResponse` mit dateiähnlichen Objekten
Wenn Sie ein dateiähnliches (file-like) Objekt haben (z. B. das von `open()` zurückgegebene Objekt), können Sie eine Generatorfunktion erstellen, um über dieses dateiähnliche Objekt zu iterieren.
Auf diese Weise müssen Sie nicht alles zuerst in den Arbeitsspeicher lesen und können diese Generatorfunktion an `StreamingResponse` übergeben und zurückgeben.
Das umfasst viele Bibliotheken zur Interaktion mit Cloud-Speicher, Videoverarbeitung und anderen.
```{ .python .annotate hl_lines="2 10-12 14" }
{!../../../docs_src/custom_response/tutorial008.py!}
```
1. Das ist die Generatorfunktion. Es handelt sich um eine „Generatorfunktion“, da sie `yield`-Anweisungen enthält.
2. Durch die Verwendung eines `with`-Blocks stellen wir sicher, dass das dateiähnliche Objekt geschlossen wird, nachdem die Generatorfunktion fertig ist. Also, nachdem sie mit dem Senden der Response fertig ist.
3. Dieses `yield from` weist die Funktion an, über das Ding namens `file_like` zu iterieren. Und dann für jeden iterierten Teil, diesen Teil so zurückzugeben, als wenn er aus dieser Generatorfunktion (`iterfile`) stammen würde.
Es handelt sich also hier um eine Generatorfunktion, die die „generierende“ Arbeit intern auf etwas anderes überträgt.
Auf diese Weise können wir das Ganze in einen `with`-Block einfügen und so sicherstellen, dass das dateiartige Objekt nach Abschluss geschlossen wird.
!!! tip "Tipp"
Beachten Sie, dass wir, da wir Standard-`open()` verwenden, welches `async` und `await` nicht unterstützt, hier die Pfadoperation mit normalen `def` deklarieren.
### `FileResponse`
Streamt eine Datei asynchron als Response.
Nimmt zur Instanziierung einen anderen Satz von Argumenten entgegen als die anderen Response-Typen:
* `path` Der Dateipfad zur Datei, die gestreamt werden soll.
* `headers` Alle benutzerdefinierten Header, die inkludiert werden sollen, als Dictionary.
* `media_type` Ein String, der den Medientyp angibt. Wenn nicht gesetzt, wird der Dateiname oder Pfad verwendet, um auf einen Medientyp zu schließen.
* `filename` Wenn gesetzt, wird das in der `Content-Disposition` der Response eingefügt.
Datei-Responses enthalten die entsprechenden `Content-Length`-, `Last-Modified`- und `ETag`-Header.
```Python hl_lines="2 10"
{!../../../docs_src/custom_response/tutorial009.py!}
```
Sie können auch den Parameter `response_class` verwenden:
```Python hl_lines="2 8 10"
{!../../../docs_src/custom_response/tutorial009b.py!}
```
In diesem Fall können Sie den Dateipfad direkt von Ihrer *Pfadoperation*-Funktion zurückgeben.
## Benutzerdefinierte Response-Klasse
Sie können Ihre eigene benutzerdefinierte Response-Klasse erstellen, die von `Response` erbt und diese verwendet.
Nehmen wir zum Beispiel an, dass Sie <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> verwenden möchten, aber mit einigen benutzerdefinierten Einstellungen, die in der enthaltenen `ORJSONResponse`-Klasse nicht verwendet werden.
Sie möchten etwa, dass Ihre Response eingerücktes und formatiertes JSON zurückgibt. Dafür möchten Sie die orjson-Option `orjson.OPT_INDENT_2` verwenden.
Sie könnten eine `CustomORJSONResponse` erstellen. Das Wichtigste, was Sie tun müssen, ist, eine `Response.render(content)`-Methode zu erstellen, die den Inhalt als `bytes` zurückgibt:
```Python hl_lines="9-14 17"
{!../../../docs_src/custom_response/tutorial009c.py!}
```
Statt:
```json
{"message": "Hello World"}
```
... wird die Response jetzt Folgendes zurückgeben:
```json
{
"message": "Hello World"
}
```
Natürlich werden Sie wahrscheinlich viel bessere Möglichkeiten finden, Vorteil daraus zu ziehen, als JSON zu formatieren. 😉
## Standard-Response-Klasse
Beim Erstellen einer **FastAPI**-Klasseninstanz oder eines `APIRouter`s können Sie angeben, welche Response-Klasse standardmäßig verwendet werden soll.
Der Parameter, der das definiert, ist `default_response_class`.
Im folgenden Beispiel verwendet **FastAPI** standardmäßig `ORJSONResponse` in allen *Pfadoperationen*, anstelle von `JSONResponse`.
```Python hl_lines="2 4"
{!../../../docs_src/custom_response/tutorial010.py!}
```
!!! tip "Tipp"
Sie können dennoch weiterhin `response_class` in *Pfadoperationen* überschreiben, wie bisher.
## Zusätzliche Dokumentation
Sie können auch den Medientyp und viele andere Details in OpenAPI mit `responses` deklarieren: [Zusätzliche Responses in OpenAPI](additional-responses.md){.internal-link target=_blank}.

View File

@@ -0,0 +1,286 @@
# Clients generieren
Da **FastAPI** auf der OpenAPI-Spezifikation basiert, erhalten Sie automatische Kompatibilität mit vielen Tools, einschließlich der automatischen API-Dokumentation (bereitgestellt von Swagger UI).
Ein besonderer Vorteil, der nicht unbedingt offensichtlich ist, besteht darin, dass Sie für Ihre API **Clients generieren** können (manchmal auch <abbr title="Software Development Kits">**SDKs**</abbr> genannt), für viele verschiedene **Programmiersprachen**.
## OpenAPI-Client-Generatoren
Es gibt viele Tools zum Generieren von Clients aus **OpenAPI**.
Ein gängiges Tool ist <a href="https://openapi-generator.tech/" class="external-link" target="_blank">OpenAPI Generator</a>.
Wenn Sie ein **Frontend** erstellen, ist <a href="https://github.com/ferdikoomen/openapi-typescript-codegen" class="external-link" target="_blank">openapi-typescript-codegen</a> eine sehr interessante Alternative.
## Client- und SDK-Generatoren Sponsor
Es gibt auch einige **vom Unternehmen entwickelte** Client- und SDK-Generatoren, die auf OpenAPI (FastAPI) basieren. In einigen Fällen können diese Ihnen **weitere Funktionalität** zusätzlich zu qualitativ hochwertigen generierten SDKs/Clients bieten.
Einige von diesen ✨ [**sponsern FastAPI**](../help-fastapi.md#den-autor-sponsern){.internal-link target=_blank} ✨, das gewährleistet die kontinuierliche und gesunde **Entwicklung** von FastAPI und seinem **Ökosystem**.
Und es zeigt deren wahres Engagement für FastAPI und seine **Community** (Sie), da diese Ihnen nicht nur einen **guten Service** bieten möchten, sondern auch sicherstellen möchten, dass Sie über ein **gutes und gesundes Framework** verfügen, FastAPI. 🙇
Beispielsweise könnten Sie <a href="https://speakeasyapi.dev/?utm_source=fastapi+repo&utm_medium=github+sponsorship" class="external-link" target="_blank">Speakeasy</a> ausprobieren.
Es gibt auch mehrere andere Unternehmen, welche ähnliche Dienste anbieten und die Sie online suchen und finden können. 🤓
## Einen TypeScript-Frontend-Client generieren
Beginnen wir mit einer einfachen FastAPI-Anwendung:
=== "Python 3.9+"
```Python hl_lines="7-9 12-13 16-17 21"
{!> ../../../docs_src/generate_clients/tutorial001_py39.py!}
```
=== "Python 3.8+"
```Python hl_lines="9-11 14-15 18 19 23"
{!> ../../../docs_src/generate_clients/tutorial001.py!}
```
Beachten Sie, dass die *Pfadoperationen* die Modelle definieren, welche diese für die Request- und Response-<abbr title="Die eigentlichen Nutzdaten, abzüglich der Metadaten">Payload</abbr> verwenden, indem sie die Modelle `Item` und `ResponseMessage` verwenden.
### API-Dokumentation
Wenn Sie zur API-Dokumentation gehen, werden Sie sehen, dass diese die **Schemas** für die Daten enthält, welche in Requests gesendet und in Responses empfangen werden:
<img src="/img/tutorial/generate-clients/image01.png">
Sie können diese Schemas sehen, da sie mit den Modellen in der Anwendung deklariert wurden.
Diese Informationen sind im **OpenAPI-Schema** der Anwendung verfügbar und werden dann in der API-Dokumentation angezeigt (von Swagger UI).
Und dieselben Informationen aus den Modellen, die in OpenAPI enthalten sind, können zum **Generieren des Client-Codes** verwendet werden.
### Einen TypeScript-Client generieren
Nachdem wir nun die Anwendung mit den Modellen haben, können wir den Client-Code für das Frontend generieren.
#### `openapi-typescript-codegen` installieren
Sie können `openapi-typescript-codegen` in Ihrem Frontend-Code installieren mit:
<div class="termy">
```console
$ npm install openapi-typescript-codegen --save-dev
---> 100%
```
</div>
#### Client-Code generieren
Um den Client-Code zu generieren, können Sie das Kommandozeilentool `openapi` verwenden, das soeben installiert wurde.
Da es im lokalen Projekt installiert ist, könnten Sie diesen Befehl wahrscheinlich nicht direkt aufrufen, sondern würden ihn in Ihre Datei `package.json` einfügen.
Diese könnte so aussehen:
```JSON hl_lines="7"
{
"name": "frontend-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"generate-client": "openapi --input http://localhost:8000/openapi.json --output ./src/client --client axios --useOptions --useUnionTypes"
},
"author": "",
"license": "",
"devDependencies": {
"openapi-typescript-codegen": "^0.20.1",
"typescript": "^4.6.2"
}
}
```
Nachdem Sie das NPM-Skript `generate-client` dort stehen haben, können Sie es ausführen mit:
<div class="termy">
```console
$ npm run generate-client
frontend-app@1.0.0 generate-client /home/user/code/frontend-app
> openapi --input http://localhost:8000/openapi.json --output ./src/client --client axios --useOptions --useUnionTypes
```
</div>
Dieser Befehl generiert Code in `./src/client` und verwendet intern `axios` (die Frontend-HTTP-Bibliothek).
### Den Client-Code ausprobieren
Jetzt können Sie den Client-Code importieren und verwenden. Er könnte wie folgt aussehen, beachten Sie, dass Sie automatische Codevervollständigung für die Methoden erhalten:
<img src="/img/tutorial/generate-clients/image02.png">
Sie erhalten außerdem automatische Vervollständigung für die zu sendende Payload:
<img src="/img/tutorial/generate-clients/image03.png">
!!! tip "Tipp"
Beachten Sie die automatische Vervollständigung für `name` und `price`, welche in der FastAPI-Anwendung im `Item`-Modell definiert wurden.
Sie erhalten Inline-Fehlerberichte für die von Ihnen gesendeten Daten:
<img src="/img/tutorial/generate-clients/image04.png">
Das Response-Objekt hat auch automatische Vervollständigung:
<img src="/img/tutorial/generate-clients/image05.png">
## FastAPI-Anwendung mit Tags
In vielen Fällen wird Ihre FastAPI-Anwendung größer sein und Sie werden wahrscheinlich Tags verwenden, um verschiedene Gruppen von *Pfadoperationen* zu separieren.
Beispielsweise könnten Sie einen Abschnitt für **Items (Artikel)** und einen weiteren Abschnitt für **Users (Benutzer)** haben, und diese könnten durch Tags getrennt sein:
=== "Python 3.9+"
```Python hl_lines="21 26 34"
{!> ../../../docs_src/generate_clients/tutorial002_py39.py!}
```
=== "Python 3.8+"
```Python hl_lines="23 28 36"
{!> ../../../docs_src/generate_clients/tutorial002.py!}
```
### Einen TypeScript-Client mit Tags generieren
Wenn Sie unter Verwendung von Tags einen Client für eine FastAPI-Anwendung generieren, wird normalerweise auch der Client-Code anhand der Tags getrennt.
Auf diese Weise können Sie die Dinge für den Client-Code richtig ordnen und gruppieren:
<img src="/img/tutorial/generate-clients/image06.png">
In diesem Fall haben Sie:
* `ItemsService`
* `UsersService`
### Client-Methodennamen
Im Moment sehen die generierten Methodennamen wie `createItemItemsPost` nicht sehr sauber aus:
```TypeScript
ItemsService.createItemItemsPost({name: "Plumbus", price: 5})
```
... das liegt daran, dass der Client-Generator für jede *Pfadoperation* die OpenAPI-interne **Operation-ID** verwendet.
OpenAPI erfordert, dass jede Operation-ID innerhalb aller *Pfadoperationen* eindeutig ist. Daher verwendet FastAPI den **Funktionsnamen**, den **Pfad** und die **HTTP-Methode/-Operation**, um diese Operation-ID zu generieren. Denn so kann sichergestellt werden, dass die Operation-IDs eindeutig sind.
Aber ich zeige Ihnen als nächstes, wie Sie das verbessern können. 🤓
## Benutzerdefinierte Operation-IDs und bessere Methodennamen
Sie können die Art und Weise, wie diese Operation-IDs **generiert** werden, **ändern**, um sie einfacher zu machen und **einfachere Methodennamen** in den Clients zu haben.
In diesem Fall müssen Sie auf andere Weise sicherstellen, dass jede Operation-ID **eindeutig** ist.
Sie könnten beispielsweise sicherstellen, dass jede *Pfadoperation* einen Tag hat, und dann die Operation-ID basierend auf dem **Tag** und dem **Namen** der *Pfadoperation* (dem Funktionsnamen) generieren.
### Funktion zum Generieren einer eindeutigen ID erstellen
FastAPI verwendet eine **eindeutige ID** für jede *Pfadoperation*, diese wird für die **Operation-ID** und auch für die Namen aller benötigten benutzerdefinierten Modelle für Requests oder Responses verwendet.
Sie können diese Funktion anpassen. Sie nimmt eine `APIRoute` und gibt einen String zurück.
Hier verwendet sie beispielsweise den ersten Tag (Sie werden wahrscheinlich nur einen Tag haben) und den Namen der *Pfadoperation* (den Funktionsnamen).
Anschließend können Sie diese benutzerdefinierte Funktion als Parameter `generate_unique_id_function` an **FastAPI** übergeben:
=== "Python 3.9+"
```Python hl_lines="6-7 10"
{!> ../../../docs_src/generate_clients/tutorial003_py39.py!}
```
=== "Python 3.8+"
```Python hl_lines="8-9 12"
{!> ../../../docs_src/generate_clients/tutorial003.py!}
```
### Einen TypeScript-Client mit benutzerdefinierten Operation-IDs generieren
Wenn Sie nun den Client erneut generieren, werden Sie feststellen, dass er über die verbesserten Methodennamen verfügt:
<img src="/img/tutorial/generate-clients/image07.png">
Wie Sie sehen, haben die Methodennamen jetzt den Tag und dann den Funktionsnamen, aber keine Informationen aus dem URL-Pfad und der HTTP-Operation.
### Vorab-Modifikation der OpenAPI-Spezifikation für den Client-Generator
Der generierte Code enthält immer noch etwas **verdoppelte Information**.
Wir wissen bereits, dass diese Methode mit den **Items** zusammenhängt, da sich dieses Wort in `ItemsService` befindet (vom Tag übernommen), aber wir haben auch immer noch den Tagnamen im Methodennamen vorangestellt. 😕
Wir werden das wahrscheinlich weiterhin für OpenAPI im Allgemeinen beibehalten wollen, da dadurch sichergestellt wird, dass die Operation-IDs **eindeutig** sind.
Aber für den generierten Client könnten wir die OpenAPI-Operation-IDs direkt vor der Generierung der Clients **modifizieren**, um diese Methodennamen schöner und **sauberer** zu machen.
Wir könnten das OpenAPI-JSON in eine Datei `openapi.json` herunterladen und dann mit einem Skript wie dem folgenden **den vorangestellten Tag entfernen**:
=== "Python"
```Python
{!> ../../../docs_src/generate_clients/tutorial004.py!}
```
=== "Node.js"
```Javascript
{!> ../../../docs_src/generate_clients/tutorial004.js!}
```
Damit würden die Operation-IDs von Dingen wie `items-get_items` in `get_items` umbenannt, sodass der Client-Generator einfachere Methodennamen generieren kann.
### Einen TypeScript-Client mit der modifizierten OpenAPI generieren
Da das Endergebnis nun in einer Datei `openapi.json` vorliegt, würden Sie die `package.json` ändern, um diese lokale Datei zu verwenden, zum Beispiel:
```JSON hl_lines="7"
{
"name": "frontend-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"generate-client": "openapi --input ./openapi.json --output ./src/client --client axios --useOptions --useUnionTypes"
},
"author": "",
"license": "",
"devDependencies": {
"openapi-typescript-codegen": "^0.20.1",
"typescript": "^4.6.2"
}
}
```
Nach der Generierung des neuen Clients hätten Sie nun **saubere Methodennamen** mit allen **Autovervollständigungen**, **Inline-Fehlerberichten**, usw.:
<img src="/img/tutorial/generate-clients/image08.png">
## Vorteile
Wenn Sie die automatisch generierten Clients verwenden, erhalten Sie **automatische Codevervollständigung** für:
* Methoden.
* Request-Payloads im Body, Query-Parameter, usw.
* Response-Payloads.
Außerdem erhalten Sie für alles **Inline-Fehlerberichte**.
Und wann immer Sie den Backend-Code aktualisieren und das Frontend **neu generieren**, stehen alle neuen *Pfadoperationen* als Methoden zur Verfügung, die alten werden entfernt und alle anderen Änderungen werden im generierten Code reflektiert. 🤓
Das bedeutet auch, dass, wenn sich etwas ändert, dies automatisch im Client-Code **reflektiert** wird. Und wenn Sie den Client **erstellen**, kommt es zu einer Fehlermeldung, wenn die verwendeten Daten **nicht übereinstimmen**.
Sie würden also sehr früh im Entwicklungszyklus **viele Fehler erkennen**, anstatt darauf warten zu müssen, dass die Fehler Ihren Endbenutzern in der Produktion angezeigt werden, und dann zu versuchen, zu debuggen, wo das Problem liegt. ✨

View File

@@ -0,0 +1,51 @@
# OpenAPI-Webhooks
Es gibt Fälle, in denen Sie Ihren API-Benutzern mitteilen möchten, dass Ihre Anwendung mit einigen Daten *deren* Anwendung aufrufen (ein Request senden) könnte, normalerweise um über ein bestimmtes **Event** zu **benachrichtigen**.
Das bedeutet, dass anstelle des normalen Prozesses, bei dem Benutzer Requests an Ihre API senden, **Ihre API** (oder Ihre Anwendung) **Requests an deren System** (an deren API, deren Anwendung) senden könnte.
Das wird normalerweise als **Webhook** bezeichnet.
## Webhooks-Schritte
Der Prozess besteht normalerweise darin, dass **Sie in Ihrem Code definieren**, welche Nachricht Sie senden möchten, den **Body des Requests**.
Sie definieren auch auf irgendeine Weise, zu welchen **Momenten** Ihre Anwendung diese Requests oder Events sendet.
Und **Ihre Benutzer** definieren auf irgendeine Weise (zum Beispiel irgendwo in einem Web-Dashboard) die **URL**, an die Ihre Anwendung diese Requests senden soll.
Die gesamte **Logik** zur Registrierung der URLs für Webhooks und der Code zum tatsächlichen Senden dieser Requests liegt bei Ihnen. Sie schreiben es so, wie Sie möchten, in **Ihrem eigenen Code**.
## Webhooks mit **FastAPI** und OpenAPI dokumentieren
Mit **FastAPI** können Sie mithilfe von OpenAPI die Namen dieser Webhooks, die Arten von HTTP-Operationen, die Ihre Anwendung senden kann (z. B. `POST`, `PUT`, usw.) und die Request**bodys** definieren, die Ihre Anwendung senden würde.
Dies kann es Ihren Benutzern viel einfacher machen, **deren APIs zu implementieren**, um Ihre **Webhook**-Requests zu empfangen. Möglicherweise können diese sogar einen Teil des eigenem API-Codes automatisch generieren.
!!! info
Webhooks sind in OpenAPI 3.1.0 und höher verfügbar und werden von FastAPI `0.99.0` und höher unterstützt.
## Eine Anwendung mit Webhooks
Wenn Sie eine **FastAPI**-Anwendung erstellen, gibt es ein `webhooks`-Attribut, mit dem Sie *Webhooks* definieren können, genauso wie Sie *Pfadoperationen* definieren würden, zum Beispiel mit `@app.webhooks.post()`.
```Python hl_lines="9-13 36-53"
{!../../../docs_src/openapi_webhooks/tutorial001.py!}
```
Die von Ihnen definierten Webhooks landen im **OpenAPI**-Schema und der automatischen **Dokumentations-Oberfläche**.
!!! info
Das `app.webhooks`-Objekt ist eigentlich nur ein `APIRouter`, derselbe Typ, den Sie verwenden würden, wenn Sie Ihre Anwendung mit mehreren Dateien strukturieren.
Beachten Sie, dass Sie bei Webhooks tatsächlich keinen *Pfad* (wie `/items/`) deklarieren, sondern dass der Text, den Sie dort übergeben, lediglich eine **Kennzeichnung** des Webhooks (der Name des Events) ist. Zum Beispiel ist in `@app.webhooks.post("new-subscription")` der Webhook-Name `new-subscription`.
Das liegt daran, dass erwartet wird, dass **Ihre Benutzer** den tatsächlichen **URL-Pfad**, an dem diese den Webhook-Request empfangen möchten, auf andere Weise definieren (z. B. über ein Web-Dashboard).
### Es in der Dokumentation ansehen
Jetzt können Sie Ihre Anwendung mit Uvicorn starten und auf <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> gehen.
Sie werden sehen, dass Ihre Dokumentation die normalen *Pfadoperationen* und jetzt auch einige **Webhooks** enthält:
<img src="/img/tutorial/openapi-webhooks/image01.png">

View File

@@ -0,0 +1,34 @@
# Benchmarks
Unabhängige TechEmpower-Benchmarks zeigen, **FastAPI**-Anwendungen, die unter Uvicorn ausgeführt werden, gehören zu <a href="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7" class="external-link" target="_blank">den schnellsten existierenden Python-Frameworks</a>, nur Starlette und Uvicorn selbst (intern von FastAPI verwendet) sind schneller.
Beim Ansehen von Benchmarks und Vergleichen sollten Sie jedoch Folgende Punkte beachten.
## Benchmarks und Geschwindigkeit
Wenn Sie sich die Benchmarks ansehen, werden häufig mehrere Tools mit unterschiedlichen Eigenschaften als gleichwertig verglichen.
Konkret geht es darum, Uvicorn, Starlette und FastAPI miteinander zu vergleichen (neben vielen anderen Tools).
Je einfacher das Problem, welches durch das Tool gelöst wird, desto besser ist die Performanz. Und die meisten Benchmarks testen nicht die zusätzlichen Funktionen, welche das Tool bietet.
Die Hierarchie ist wie folgt:
* **Uvicorn**: ein ASGI-Server
* **Starlette**: (verwendet Uvicorn) ein Web-Mikroframework
* **FastAPI**: (verwendet Starlette) ein API-Mikroframework mit mehreren zusätzlichen Funktionen zum Erstellen von APIs, mit Datenvalidierung, usw.
* **Uvicorn**:
* Bietet die beste Leistung, da außer dem Server selbst nicht viel zusätzlicher Code vorhanden ist.
* Sie würden eine Anwendung nicht direkt in Uvicorn schreiben. Das würde bedeuten, dass Ihr Code zumindest mehr oder weniger den gesamten von Starlette (oder **FastAPI**) bereitgestellten Code enthalten müsste. Und wenn Sie das täten, hätte Ihre endgültige Anwendung den gleichen Overhead wie die Verwendung eines Frameworks nebst Minimierung Ihres Anwendungscodes und der Fehler.
* Wenn Sie Uvicorn vergleichen, vergleichen Sie es mit Anwendungsservern wie Daphne, Hypercorn, uWSGI, usw.
* **Starlette**:
* Wird nach Uvicorn die nächstbeste Performanz erbringen. Tatsächlich nutzt Starlette intern Uvicorn. Daher kann es wahrscheinlich nur „langsamer“ als Uvicorn sein, weil mehr Code ausgeführt wird.
* Aber es bietet Ihnen die Tools zum Erstellen einfacher Webanwendungen, mit Routing basierend auf Pfaden, usw.
* Wenn Sie Starlette vergleichen, vergleichen Sie es mit Webframeworks (oder Mikroframeworks) wie Sanic, Flask, Django, usw.
* **FastAPI**:
* So wie Starlette Uvicorn verwendet und nicht schneller als dieses sein kann, verwendet **FastAPI** Starlette, sodass es nicht schneller als dieses sein kann.
* FastAPI bietet zusätzlich zu Starlette weitere Funktionen. Funktionen, die Sie beim Erstellen von APIs fast immer benötigen, wie Datenvalidierung und Serialisierung. Und wenn Sie es verwenden, erhalten Sie kostenlos automatische Dokumentation (die automatische Dokumentation verursacht nicht einmal zusätzlichen Aufwand für laufende Anwendungen, sie wird beim Start generiert).
* Wenn Sie FastAPI nicht, und direkt Starlette (oder ein anderes Tool wie Sanic, Flask, Responder, usw.) verwenden würden, müssten Sie die gesamte Datenvalidierung und Serialisierung selbst implementieren. Ihre finale Anwendung hätte also immer noch den gleichen Overhead, als ob sie mit FastAPI erstellt worden wäre. Und in vielen Fällen ist diese Datenvalidierung und Serialisierung der größte Teil des in Anwendungen geschriebenen Codes.
* Durch die Verwendung von FastAPI sparen Sie also Entwicklungszeit, Fehler und Codezeilen und würden wahrscheinlich die gleiche Leistung (oder eine bessere) erzielen, die Sie hätten, wenn Sie es nicht verwenden würden (da Sie alles in Ihrem Code implementieren müssten).
* Wenn Sie FastAPI vergleichen, vergleichen Sie es mit einem Webanwendung-Framework (oder einer Reihe von Tools), welche Datenvalidierung, Serialisierung und Dokumentation bereitstellen, wie Flask-apispec, NestJS, Molten, usw. Frameworks mit integrierter automatischer Datenvalidierung, Serialisierung und Dokumentation.

203
docs/de/docs/features.md Normal file
View File

@@ -0,0 +1,203 @@
# Merkmale
## FastAPI Merkmale
**FastAPI** ermöglicht Ihnen folgendes:
### Basiert auf offenen Standards
* <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank"><strong>OpenAPI</strong></a> für API-Erstellung, zusammen mit Deklarationen von <abbr title="auch genannt: Endpunkte, Routen">Pfad</abbr> <abbr title="gemeint sind: HTTP-Methoden, wie POST, GET, PUT, DELETE">Operationen</abbr>, Parameter, Nachrichtenrumpf-Anfragen (englisch: body request), Sicherheit, etc.
* Automatische Dokumentation der Datenentitäten mit dem <a href="https://json-schema.org/" class="external-link" target="_blank"><strong>JSON Schema</strong></a> (OpenAPI basiert selber auf dem JSON Schema).
* Entworfen auf Grundlage dieser Standards nach einer sorgfältigen Studie, statt einer nachträglichen Schicht über diesen Standards.
* Dies ermöglicht automatische **Quellcode-Generierung auf Benutzerebene** in vielen Sprachen.
### Automatische Dokumentation
Mit einer interaktiven API-Dokumentation und explorativen webbasierten Benutzerschnittstellen. Da FastAPI auf OpenAPI basiert, gibt es hierzu mehrere Optionen, wobei zwei standardmäßig vorhanden sind.
* <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank"><strong>Swagger UI</strong></a>, bietet interaktive Exploration: testen und rufen Sie ihre API direkt vom Webbrowser auf.
![Swagger UI Interaktion](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
* Alternative API-Dokumentation mit <a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank"><strong>ReDoc</strong></a>.
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
### Nur modernes Python
Alles basiert auf **Python 3.8 Typ**-Deklarationen (dank Pydantic). Es muss keine neue Syntax gelernt werden, nur standardisiertes modernes Python.
Wenn Sie eine kurze, zweiminütige, Auffrischung in der Benutzung von Python Typ-Deklarationen benötigen (auch wenn Sie FastAPI nicht nutzen), schauen Sie sich diese kurze Einführung an (Englisch): Python Types{.internal-link target=_blank}.
Sie schreiben Standard-Python mit Typ-Deklarationen:
```Python
from typing import List, Dict
from datetime import date
from pydantic import BaseModel
# Deklariere eine Variable als str
# und bekomme Editor-Unterstütung innerhalb der Funktion
def main(user_id: str):
return user_id
# Ein Pydantic model
class User(BaseModel):
id: int
name: str
joined: date
```
Dies kann nun wiefolgt benutzt werden:
```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` bedeutet:
Übergebe die Schlüssel und die zugehörigen Werte des `second_user_data` Datenwörterbuches direkt als Schlüssel-Wert Argumente, äquivalent zu: `User(id=4, name="Mary", joined="2018-11-30")`
### Editor Unterstützung
FastAPI wurde so entworfen, dass es einfach und intuitiv zu benutzen ist; alle Entscheidungen wurden auf mehreren Editoren getestet (sogar vor der eigentlichen Implementierung), um so eine best mögliche Entwicklererfahrung zu gewährleisten.
In der letzen Python Entwickler Umfrage stellte sich heraus, dass <a href="https://www.jetbrains.com/research/python-developers-survey-2017/#tools-and-features" class="external-link" target="_blank">die meist genutzte Funktion die "Autovervollständigung" ist</a>.
Die gesamte Struktur von **FastAPI** soll dem gerecht werden. Autovervollständigung funktioniert überall.
Sie müssen selten in die Dokumentation schauen.
So kann ihr Editor Sie unterstützen:
* in <a href="https://code.visualstudio.com/" class="external-link" target="_blank">Visual Studio Code</a>:
![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
* in <a href="https://www.jetbrains.com/pycharm/" class="external-link" target="_blank">PyCharm</a>:
![editor support](https://fastapi.tiangolo.com/img/pycharm-completion.png)
Sie bekommen Autovervollständigung an Stellen, an denen Sie dies vorher nicht für möglich gehalten hätten. Zum Beispiel der `price` Schlüssel aus einem JSON Datensatz (dieser könnte auch verschachtelt sein) aus einer Anfrage.
Hierdurch werden Sie nie wieder einen falschen Schlüsselnamen benutzen und sparen sich lästiges Suchen in der Dokumentation, um beispielsweise herauszufinden ob Sie `username` oder `user_name` als Schlüssel verwenden.
### Kompakt
FastAPI nutzt für alles sensible **Standard-Einstellungen**, welche optional überall konfiguriert werden können. Alle Parameter können ganz genau an Ihre Bedürfnisse angepasst werden, sodass sie genau die API definieren können, die sie brauchen.
Aber standardmäßig, **"funktioniert einfach"** alles.
### Validierung
* Validierung für die meisten (oder alle?) Python **Datentypen**, hierzu gehören:
* JSON Objekte (`dict`).
* JSON Listen (`list`), die den Typ ihrer Elemente definieren.
* Zeichenketten (`str`), mit definierter minimaler und maximaler Länge.
* Zahlen (`int`, `float`) mit minimaler und maximaler Größe, usw.
* Validierung für ungewöhnliche Typen, wie:
* URL.
* Email.
* UUID.
* ... und andere.
Die gesamte Validierung übernimmt das etablierte und robuste **Pydantic**.
### Sicherheit und Authentifizierung
Integrierte Sicherheit und Authentifizierung. Ohne Kompromisse bei Datenbanken oder Datenmodellen.
Unterstützt werden alle von OpenAPI definierten Sicherheitsschemata, hierzu gehören:
* HTTP Basis Authentifizierung.
* **OAuth2** (auch mit **JWT Zugriffstokens**). Schauen Sie sich hierzu dieses Tutorial an: [OAuth2 mit JWT](tutorial/security/oauth2-jwt.md){.internal-link target=_blank}.
* API Schlüssel in:
* Kopfzeile (HTTP Header).
* Anfrageparametern.
* Cookies, etc.
Zusätzlich gibt es alle Sicherheitsfunktionen von Starlette (auch **session cookies**).
Alles wurde als wiederverwendbare Werkzeuge und Komponenten geschaffen, die einfach in ihre Systeme, Datenablagen, relationale und nicht-relationale Datenbanken, ..., integriert werden können.
### Einbringen von Abhängigkeiten (meist: Dependency Injection)
FastAPI enthält ein extrem einfaches, aber extrem mächtiges <abbr title='oft verwendet im Zusammenhang von: Komponenten, Resourcen, Diensten, Dienstanbieter'><strong>Dependency Injection</strong></abbr> System.
* Selbst Abhängigkeiten können Abhängigkeiten haben, woraus eine Hierachie oder ein **"Graph" von Abhängigkeiten** entsteht.
* **Automatische Umsetzung** durch FastAPI.
* Alle abhängigen Komponenten könnten Daten von Anfragen, **Erweiterungen der Pfadoperations-**Einschränkungen und der automatisierten Dokumentation benötigen.
* **Automatische Validierung** selbst für *Pfadoperationen*-Parameter, die in den Abhängigkeiten definiert wurden.
* Unterstützt komplexe Benutzerauthentifizierungssysteme, **Datenbankverbindungen**, usw.
* **Keine Kompromisse** bei Datenbanken, Eingabemasken, usw. Sondern einfache Integration von allen.
### Unbegrenzte Erweiterungen
Oder mit anderen Worten, sie werden nicht benötigt. Importieren und nutzen Sie Quellcode nach Bedarf.
Jede Integration wurde so entworfen, dass sie einfach zu nutzen ist (mit Abhängigkeiten), sodass Sie eine Erweiterung für Ihre Anwendung mit nur zwei Zeilen an Quellcode implementieren können. Hierbei nutzen Sie die selbe Struktur und Syntax, wie bei Pfadoperationen.
### Getestet
* 100% <abbr title="Die Anzahl an Code, die automatisch getestet wird">Testabdeckung</abbr>.
* 100% <abbr title="Python Typ Annotationen, mit dennen Ihr Editor und andere exteren Werkezuge Sie besser unterstützen können">Typen annotiert</abbr>.
* Verwendet in Produktionsanwendungen.
## Starlette's Merkmale
**FastAPI** ist vollkommen kompatibel (und basiert auf) <a href="https://www.starlette.io/" class="external-link" target="_blank"><strong>Starlette</strong></a>. Das bedeutet, auch ihr eigener Starlette Quellcode funktioniert.
`FastAPI` ist eigentlich eine Unterklasse von `Starlette`. Wenn Sie also bereits Starlette kennen oder benutzen, können Sie das meiste Ihres Wissens direkt anwenden.
Mit **FastAPI** bekommen Sie viele von **Starlette**'s Funktionen (da FastAPI nur Starlette auf Steroiden ist):
* Stark beeindruckende Performanz. Es ist <a href="https://github.com/encode/starlette#performance" class="external-link" target="_blank">eines der schnellsten Python Frameworks, auf Augenhöhe mit **NodeJS** und **Go**</a>.
* **WebSocket**-Unterstützung.
* Hintergrundaufgaben im selben Prozess.
* Ereignisse für das Starten und Herunterfahren.
* Testclient basierend auf HTTPX.
* **CORS**, GZip, statische Dateien, Antwortfluss.
* **Sitzungs und Cookie** Unterstützung.
* 100% Testabdeckung.
* 100% Typen annotiert.
## Pydantic's Merkmale
**FastAPI** ist vollkommen kompatibel (und basiert auf) <a href="https://pydantic-docs.helpmanual.io" class="external-link" target="_blank"><strong>Pydantic</strong></a>. Das bedeutet, auch jeder zusätzliche Pydantic Quellcode funktioniert.
Verfügbar sind ebenso externe auf Pydantic basierende Bibliotheken, wie <abbr title="Object-Relational Mapper (Abbildung von Objekten auf relationale Strukturen)">ORM</abbr>s, <abbr title="Object-Document Mapper (Abbildung von Objekten auf nicht-relationale Strukturen)">ODM</abbr>s für Datenbanken.
Daher können Sie in vielen Fällen das Objekt einer Anfrage **direkt zur Datenbank** schicken, weil alles automatisch validiert wird.
Das selbe gilt auch für die andere Richtung: Sie können jedes Objekt aus der Datenbank **direkt zum Klienten** schicken.
Mit **FastAPI** bekommen Sie alle Funktionen von **Pydantic** (da FastAPI für die gesamte Datenverarbeitung Pydantic nutzt):
* **Kein Kopfzerbrechen**:
* Sie müssen keine neue Schemadefinitionssprache lernen.
* Wenn Sie mit Python's Typisierung arbeiten können, können Sie auch mit Pydantic arbeiten.
* Gutes Zusammenspiel mit Ihrer/Ihrem **<abbr title="Integrierten Entwicklungsumgebung, ähnlich zu (Quellcode-)Editor">IDE</abbr>/<abbr title="Ein Programm, was Fehler im Quellcode sucht">linter</abbr>/Gehirn**:
* Weil Datenstrukturen von Pydantic einfach nur Instanzen ihrer definierten Klassen sind, sollten Autovervollständigung, Linting, mypy und ihre Intuition einwandfrei funktionieren.
* **Schnell**:
* In <a href="https://pydantic-docs.helpmanual.io/benchmarks/" class="external-link" target="_blank">Vergleichen</a> ist Pydantic schneller als jede andere getestete Bibliothek.
* Validierung von **komplexen Strukturen**:
* Benutzung von hierachischen Pydantic Schemata, Python `typing`s `List` und `Dict`, etc.
* Validierungen erlauben eine klare und einfache Datenschemadefinition, überprüft und dokumentiert als JSON Schema.
* Sie können stark **verschachtelte JSON** Objekte haben und diese sind trotzdem validiert und annotiert.
* **Erweiterbar**:
* Pydantic erlaubt die Definition von eigenen Datentypen oder sie können die Validierung mit einer `validator` dekorierten Methode erweitern.
* 100% Testabdeckung.

View File

@@ -0,0 +1,3 @@
# Hilfe
Helfen und Hilfe erhalten, beitragen, mitmachen. 🤝

View File

@@ -0,0 +1,5 @@
# Lernen
Hier finden Sie die einführenden Kapitel und Tutorials zum Erlernen von **FastAPI**.
Sie könnten dies als **Buch**, als **Kurs**, als **offizielle** und empfohlene Methode zum Erlernen von FastAPI betrachten. 😎

View File

@@ -0,0 +1,8 @@
# Referenz Code-API
Hier ist die Referenz oder Code-API, die Klassen, Funktionen, Parameter, Attribute und alle FastAPI-Teile, die Sie in Ihren Anwendungen verwenden können.
Wenn Sie **FastAPI** lernen möchten, ist es viel besser, das [FastAPI-Tutorial](https://fastapi.tiangolo.com/tutorial/) zu lesen.
!!! note "Hinweis Deutsche Übersetzung"
Die nachfolgende API wird aus der Quelltext-Dokumentation erstellt, daher sind nur die Einleitungen auf Deutsch.

View File

@@ -0,0 +1,3 @@
# Ressourcen
Zusätzliche Ressourcen, externe Links, Artikel und mehr. ✈️

View File

@@ -0,0 +1,126 @@
# Hintergrundtasks
Sie können Hintergrundtasks (Hintergrund-Aufgaben) definieren, die *nach* der Rückgabe einer Response ausgeführt werden sollen.
Das ist nützlich für Vorgänge, die nach einem Request ausgeführt werden müssen, bei denen der Client jedoch nicht unbedingt auf den Abschluss des Vorgangs warten muss, bevor er die Response erhält.
Hierzu zählen beispielsweise:
* E-Mail-Benachrichtigungen, die nach dem Ausführen einer Aktion gesendet werden:
* Da die Verbindung zu einem E-Mail-Server und das Senden einer E-Mail in der Regel „langsam“ ist (einige Sekunden), können Sie die Response sofort zurücksenden und die E-Mail-Benachrichtigung im Hintergrund senden.
* Daten verarbeiten:
* Angenommen, Sie erhalten eine Datei, die einen langsamen Prozess durchlaufen muss. Sie können als Response „Accepted“ (HTTP 202) zurückgeben und die Datei im Hintergrund verarbeiten.
## `BackgroundTasks` verwenden
Importieren Sie zunächst `BackgroundTasks` und definieren Sie einen Parameter in Ihrer *Pfadoperation-Funktion* mit der Typdeklaration `BackgroundTasks`:
```Python hl_lines="1 13"
{!../../../docs_src/background_tasks/tutorial001.py!}
```
**FastAPI** erstellt für Sie das Objekt vom Typ `BackgroundTasks` und übergibt es als diesen Parameter.
## Eine Taskfunktion erstellen
Erstellen Sie eine Funktion, die als Hintergrundtask ausgeführt werden soll.
Es handelt sich schlicht um eine Standard-Funktion, die Parameter empfangen kann.
Es kann sich um eine `async def`- oder normale `def`-Funktion handeln. **FastAPI** weiß, wie damit zu verfahren ist.
In diesem Fall schreibt die Taskfunktion in eine Datei (den Versand einer E-Mail simulierend).
Und da der Schreibvorgang nicht `async` und `await` verwendet, definieren wir die Funktion mit normalem `def`:
```Python hl_lines="6-9"
{!../../../docs_src/background_tasks/tutorial001.py!}
```
## Den Hintergrundtask hinzufügen
Übergeben Sie innerhalb Ihrer *Pfadoperation-Funktion* Ihre Taskfunktion mit der Methode `.add_task()` an das *Hintergrundtasks*-Objekt:
```Python hl_lines="14"
{!../../../docs_src/background_tasks/tutorial001.py!}
```
`.add_task()` erhält als Argumente:
* Eine Taskfunktion, die im Hintergrund ausgeführt wird (`write_notification`).
* Eine beliebige Folge von Argumenten, die der Reihe nach an die Taskfunktion übergeben werden sollen (`email`).
* Alle Schlüsselwort-Argumente, die an die Taskfunktion übergeben werden sollen (`message="some notification"`).
## Dependency Injection
Die Verwendung von `BackgroundTasks` funktioniert auch mit dem <abbr title="Einbringen von Abhängigkeiten">Dependency Injection</abbr> System. Sie können einen Parameter vom Typ `BackgroundTasks` auf mehreren Ebenen deklarieren: in einer *Pfadoperation-Funktion*, in einer Abhängigkeit (Dependable), in einer Unterabhängigkeit usw.
**FastAPI** weiß, was jeweils zu tun ist und wie dasselbe Objekt wiederverwendet werden kann, sodass alle Hintergrundtasks zusammengeführt und anschließend im Hintergrund ausgeführt werden:
=== "Python 3.10+"
```Python hl_lines="13 15 22 25"
{!> ../../../docs_src/background_tasks/tutorial002_an_py310.py!}
```
=== "Python 3.9+"
```Python hl_lines="13 15 22 25"
{!> ../../../docs_src/background_tasks/tutorial002_an_py39.py!}
```
=== "Python 3.8+"
```Python hl_lines="14 16 23 26"
{!> ../../../docs_src/background_tasks/tutorial002_an.py!}
```
=== "Python 3.10+ nicht annotiert"
!!! tip "Tipp"
Bevorzugen Sie die `Annotated`-Version, falls möglich.
```Python hl_lines="11 13 20 23"
{!> ../../../docs_src/background_tasks/tutorial002_py310.py!}
```
=== "Python 3.8+ nicht annotiert"
!!! tip "Tipp"
Bevorzugen Sie die `Annotated`-Version, falls möglich.
```Python hl_lines="13 15 22 25"
{!> ../../../docs_src/background_tasks/tutorial002.py!}
```
In obigem Beispiel werden die Nachrichten, *nachdem* die Response gesendet wurde, in die Datei `log.txt` geschrieben.
Wenn im Request ein Query-Parameter enthalten war, wird dieser in einem Hintergrundtask in das Log geschrieben.
Und dann schreibt ein weiterer Hintergrundtask, der in der *Pfadoperation-Funktion* erstellt wird, eine Nachricht unter Verwendung des Pfad-Parameters `email`.
## Technische Details
Die Klasse `BackgroundTasks` stammt direkt von <a href="https://www.starlette.io/background/" class="external-link" target="_blank">`starlette.background`</a>.
Sie wird direkt in FastAPI importiert/inkludiert, sodass Sie sie von `fastapi` importieren können und vermeiden, versehentlich das alternative `BackgroundTask` (ohne das `s` am Ende) von `starlette.background` zu importieren.
Indem Sie nur `BackgroundTasks` (und nicht `BackgroundTask`) verwenden, ist es dann möglich, es als *Pfadoperation-Funktion*-Parameter zu verwenden und **FastAPI** den Rest für Sie erledigen zu lassen, genau wie bei der direkten Verwendung des `Request`-Objekts.
Es ist immer noch möglich, `BackgroundTask` allein in FastAPI zu verwenden, aber Sie müssen das Objekt in Ihrem Code erstellen und eine Starlette-`Response` zurückgeben, die es enthält.
Weitere Details finden Sie in der <a href="https://www.starlette.io/background/" class="external-link" target="_blank">offiziellen Starlette-Dokumentation für Hintergrundtasks</a>.
## Vorbehalt
Wenn Sie umfangreiche Hintergrundberechnungen durchführen müssen und diese nicht unbedingt vom selben Prozess ausgeführt werden müssen (z. B. müssen Sie Speicher, Variablen, usw. nicht gemeinsam nutzen), könnte die Verwendung anderer größerer Tools wie z. B. <a href="https://docs.celeryq.dev" class="external-link" target="_blank">Celery</a> von Vorteil sein.
Sie erfordern in der Regel komplexere Konfigurationen und einen Nachrichten-/Job-Queue-Manager wie RabbitMQ oder Redis, ermöglichen Ihnen jedoch die Ausführung von Hintergrundtasks in mehreren Prozessen und insbesondere auf mehreren Servern.
Um ein Beispiel zu sehen, sehen Sie sich die [Projektgeneratoren](../project-generation.md){.internal-link target=_blank} an. Sie alle enthalten Celery, bereits konfiguriert.
Wenn Sie jedoch über dieselbe **FastAPI**-Anwendung auf Variablen und Objekte zugreifen oder kleine Hintergrundtasks ausführen müssen (z. B. das Senden einer E-Mail-Benachrichtigung), können Sie einfach `BackgroundTasks` verwenden.
## Zusammenfassung
Importieren und verwenden Sie `BackgroundTasks` mit Parametern in *Pfadoperation-Funktionen* und Abhängigkeiten, um Hintergrundtasks hinzuzufügen.

View File

@@ -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:
<div class="termy">
```console
$ uvicorn main:app --reload
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
<span style="color: green;">INFO</span>: Started reloader process [28720]
<span style="color: green;">INFO</span>: Started server process [28722]
<span style="color: green;">INFO</span>: Waiting for application startup.
<span style="color: green;">INFO</span>: Application startup complete.
```
</div>
!!! 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 <a href="http://127.0.0.1:8000" class="external-link" target="_blank">http://127.0.0.1:8000.</a>
Sie werden folgende JSON-Response sehen:
```JSON
{"message": "Hello World"}
```
### Interaktive API-Dokumentation
Gehen Sie als Nächstes auf <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs </a>.
Sie werden die automatisch erzeugte, interaktive API-Dokumentation sehen (bereitgestellt durch <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">Swagger UI</a>):
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
### Alternative API-Dokumentation
Gehen Sie nun auf <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
Dort sehen Sie die alternative, automatische Dokumentation (bereitgestellt durch <a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">ReDoc</a>):
![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 <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a> 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: <a href="http://127.0.0.1:8000/openapi.json" class="external-link" target="_blank">http://127.0.0.1:8000/openapi.json</a>.
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 <a href="https://www.starlette.io/" class="external-link" target="_blank">Starlette</a>-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:
<div class="termy">
```console
$ uvicorn main:app --reload
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
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:
<div class="termy">
```console
$ uvicorn main:my_awesome_api --reload
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
### 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 <abbr title="eine HTTP GET Methode"><code>get</code>-Operation</abbr> 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`).

View File

@@ -0,0 +1,80 @@
# Tutorial Benutzerhandbuch
Dieses Tutorial zeigt Ihnen Schritt für Schritt, wie Sie **FastAPI** und die meisten seiner Funktionen verwenden können.
Jeder Abschnitt baut schrittweise auf den vorhergehenden auf. Diese Abschnitte sind aber nach einzelnen Themen gegliedert, sodass Sie direkt zu einem bestimmten Thema übergehen können, um Ihre speziellen API-Anforderungen zu lösen.
Außerdem dienen diese als zukünftige Referenz.
Dadurch können Sie jederzeit zurückkommen und sehen genau das, was Sie benötigen.
## Den Code ausführen
Alle Codeblöcke können kopiert und direkt verwendet werden (da es sich um getestete Python-Dateien handelt).
Um eines der Beispiele auszuführen, kopieren Sie den Code in eine Datei `main.py`, und starten Sie `uvicorn` mit:
<div class="termy">
```console
$ uvicorn main:app --reload
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
<span style="color: green;">INFO</span>: Started reloader process [28720]
<span style="color: green;">INFO</span>: Started server process [28722]
<span style="color: green;">INFO</span>: Waiting for application startup.
<span style="color: green;">INFO</span>: Application startup complete.
```
</div>
Es wird **ausdrücklich empfohlen**, dass Sie den Code schreiben oder kopieren, ihn bearbeiten und lokal ausführen.
Die Verwendung in Ihrem eigenen Editor zeigt Ihnen die Vorteile von FastAPI am besten, wenn Sie sehen, wie wenig Code Sie schreiben müssen, all die Typprüfungen, die automatische Vervollständigung usw.
---
## FastAPI installieren
Der erste Schritt besteht aus der Installation von FastAPI.
Für dieses Tutorial empfiehlt es sich, FastAPI mit allen optionalen Abhängigkeiten und Funktionen zu installieren:
<div class="termy">
```console
$ pip install "fastapi[all]"
---> 100%
```
</div>
... das beinhaltet auch `uvicorn`, welchen Sie als Server verwenden können, der ihren Code ausführt.
!!! note "Hinweis"
Sie können die einzelnen Teile auch separat installieren.
Das folgende würden Sie wahrscheinlich tun, wenn Sie Ihre Anwendung in der Produktion einsetzen:
```
pip install fastapi
```
Installieren Sie auch `uvicorn` als Server:
```
pip install "uvicorn[standard]"
```
Das gleiche gilt für jede der optionalen Abhängigkeiten, die Sie verwenden möchten.
## Handbuch für fortgeschrittene Benutzer
Es gibt auch ein **Handbuch für fortgeschrittene Benutzer**, welches Sie später nach diesem **Tutorial Benutzerhandbuch** lesen können.
Das **Handbuch für fortgeschrittene Benutzer** baut auf diesem Tutorial auf, verwendet dieselben Konzepte und bringt Ihnen einige zusätzliche Funktionen bei.
Allerdings sollten Sie zuerst das **Tutorial Benutzerhandbuch** lesen (was Sie hier gerade tun).
Die Dokumentation ist so konzipiert, dass Sie mit dem **Tutorial Benutzerhandbuch** eine vollständige Anwendung erstellen können und diese dann je nach Bedarf mit einigen der zusätzlichen Ideen aus dem **Handbuch für fortgeschrittene Benutzer** vervollständigen können.

View File

@@ -0,0 +1,61 @@
# Middleware
Sie können Middleware zu **FastAPI**-Anwendungen hinzufügen.
Eine „Middleware“ ist eine Funktion, die mit jedem **Request** arbeitet, bevor er von einer bestimmten *Pfadoperation* verarbeitet wird. Und auch mit jeder **Response**, bevor sie zurückgegeben wird.
* Sie nimmt jeden **Request** entgegen, der an Ihre Anwendung gesendet wird.
* Sie kann dann etwas mit diesem **Request** tun oder beliebigen Code ausführen.
* Dann gibt sie den **Request** zur Verarbeitung durch den Rest der Anwendung weiter (durch eine bestimmte *Pfadoperation*).
* Sie nimmt dann die **Response** entgegen, die von der Anwendung generiert wurde (durch eine bestimmte *Pfadoperation*).
* Sie kann etwas mit dieser **Response** tun oder beliebigen Code ausführen.
* Dann gibt sie die **Response** zurück.
!!! note "Technische Details"
Wenn Sie Abhängigkeiten mit `yield` haben, wird der Exit-Code *nach* der Middleware ausgeführt.
Wenn es Hintergrundaufgaben gab (später dokumentiert), werden sie *nach* allen Middlewares ausgeführt.
## Erstellung einer Middleware
Um eine Middleware zu erstellen, verwenden Sie den Dekorator `@app.middleware("http")` über einer Funktion.
Die Middleware-Funktion erhält:
* Den `request`.
* Eine Funktion `call_next`, die den `request` als Parameter erhält.
* Diese Funktion gibt den `request` an die entsprechende *Pfadoperation* weiter.
* Dann gibt es die von der entsprechenden *Pfadoperation* generierte `response` zurück.
* Sie können die `response` dann weiter modifizieren, bevor Sie sie zurückgeben.
```Python hl_lines="8-9 11 14"
{!../../../docs_src/middleware/tutorial001.py!}
```
!!! tip "Tipp"
Beachten Sie, dass benutzerdefinierte proprietäre Header hinzugefügt werden können. <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">Verwenden Sie dafür das Präfix 'X-'</a>.
Wenn Sie jedoch benutzerdefinierte Header haben, die ein Client in einem Browser sehen soll, müssen Sie sie zu Ihrer CORS-Konfigurationen ([CORS (Cross-Origin Resource Sharing)](cors.md){.internal-link target=_blank}) hinzufügen, indem Sie den Parameter `expose_headers` verwenden, der in der <a href="https://www.starlette.io/middleware/#corsmiddleware" class="external-link" target="_blank">Starlette-CORS-Dokumentation</a> dokumentiert ist.
!!! note "Technische Details"
Sie könnten auch `from starlette.requests import Request` verwenden.
**FastAPI** bietet es als Komfort für Sie, den Entwickler, an. Aber es stammt direkt von Starlette.
### Vor und nach der `response`
Sie können Code hinzufügen, der mit dem `request` ausgeführt wird, bevor dieser von einer beliebigen *Pfadoperation* empfangen wird.
Und auch nachdem die `response` generiert wurde, bevor sie zurückgegeben wird.
Sie könnten beispielsweise einen benutzerdefinierten Header `X-Process-Time` hinzufügen, der die Zeit in Sekunden enthält, die benötigt wurde, um den Request zu verarbeiten und eine Response zu generieren:
```Python hl_lines="10 12-13"
{!../../../docs_src/middleware/tutorial001.py!}
```
## Andere Middlewares
Sie können später mehr über andere Middlewares in [Handbuch für fortgeschrittene Benutzer: Fortgeschrittene Middleware](../advanced/middleware.md){.internal-link target=_blank} lesen.
In der nächsten Sektion erfahren Sie, wie Sie <abbr title="Cross-Origin Resource Sharing">CORS</abbr> mit einer Middleware behandeln können.

View File

@@ -0,0 +1,226 @@
# Query-Parameter
Wenn Sie in ihrer Funktion Parameter deklarieren, die nicht Teil der Pfad-Parameter sind, dann werden diese automatisch als „Query“-Parameter interpretiert.
```Python hl_lines="9"
{!../../../docs_src/query_params/tutorial001.py!}
```
Query-Parameter (Deutsch: Abfrage-Parameter) sind die Schlüssel-Wert-Paare, die nach dem `?` in einer URL aufgelistet sind, getrennt durch `&`-Zeichen.
Zum Beispiel sind in der URL:
```
http://127.0.0.1:8000/items/?skip=0&limit=10
```
... die Query-Parameter:
* `skip`: mit dem Wert `0`
* `limit`: mit dem Wert `10`
Da sie Teil der URL sind, sind sie „naturgemäß“ Strings.
Aber wenn Sie sie mit Python-Typen deklarieren (im obigen Beispiel als `int`), werden sie zu diesem Typ konvertiert, und gegen diesen validiert.
Die gleichen Prozesse, die für Pfad-Parameter stattfinden, werden auch auf Query-Parameter angewendet:
* Editor Unterstützung (natürlich)
* <abbr title="Konvertieren des Strings, der von einer HTTP-Anfrage kommt, in Python-Daten">„Parsen“</abbr> der Daten
* Datenvalidierung
* Automatische Dokumentation
## Defaultwerte
Da Query-Parameter nicht ein festgelegter Teil des Pfades sind, können sie optional sein und Defaultwerte haben.
Im obigen Beispiel haben sie die Defaultwerte `skip=0` und `limit=10`.
Wenn Sie also zur URL:
```
http://127.0.0.1:8000/items/
```
gehen, so ist das das gleiche wie die URL:
```
http://127.0.0.1:8000/items/?skip=0&limit=10
```
Aber wenn Sie zum Beispiel zu:
```
http://127.0.0.1:8000/items/?skip=20
```
gehen, werden die Parameter-Werte Ihrer Funktion sein:
* `skip=20`: da Sie das in der URL gesetzt haben
* `limit=10`: weil das der Defaultwert ist
## Optionale Parameter
Auf die gleiche Weise können Sie optionale Query-Parameter deklarieren, indem Sie deren Defaultwert auf `None` setzen:
=== "Python 3.10+"
```Python hl_lines="7"
{!> ../../../docs_src/query_params/tutorial002_py310.py!}
```
=== "Python 3.8+"
```Python hl_lines="9"
{!> ../../../docs_src/query_params/tutorial002.py!}
```
In diesem Fall wird der Funktionsparameter `q` optional, und standardmäßig `None` sein.
!!! check
Beachten Sie auch, dass **FastAPI** intelligent genug ist, um zu erkennen, dass `item_id` ein Pfad-Parameter ist und `q` keiner, daher muss letzteres ein Query-Parameter sein.
## Query-Parameter Typkonvertierung
Sie können auch `bool`-Typen deklarieren und sie werden konvertiert:
=== "Python 3.10+"
```Python hl_lines="7"
{!> ../../../docs_src/query_params/tutorial003_py310.py!}
```
=== "Python 3.8+"
```Python hl_lines="9"
{!> ../../../docs_src/query_params/tutorial003.py!}
```
Wenn Sie nun zu:
```
http://127.0.0.1:8000/items/foo?short=1
```
oder
```
http://127.0.0.1:8000/items/foo?short=True
```
oder
```
http://127.0.0.1:8000/items/foo?short=true
```
oder
```
http://127.0.0.1:8000/items/foo?short=on
```
oder
```
http://127.0.0.1:8000/items/foo?short=yes
```
gehen, oder zu irgendeiner anderen Variante der Groß-/Kleinschreibung (Alles groß, Anfangsbuchstabe groß, usw.), dann wird Ihre Funktion den Parameter `short` mit dem `bool`-Wert `True` sehen, ansonsten mit dem Wert `False`.
## Mehrere Pfad- und Query-Parameter
Sie können mehrere Pfad-Parameter und Query-Parameter gleichzeitig deklarieren, **FastAPI** weiß, was welches ist.
Und Sie müssen sie auch nicht in einer spezifischen Reihenfolge deklarieren.
Parameter werden anhand ihres Namens erkannt:
=== "Python 3.10+"
```Python hl_lines="6 8"
{!> ../../../docs_src/query_params/tutorial004_py310.py!}
```
=== "Python 3.8+"
```Python hl_lines="8 10"
{!> ../../../docs_src/query_params/tutorial004.py!}
```
## Erforderliche Query-Parameter
Wenn Sie einen Defaultwert für Nicht-Pfad-Parameter deklarieren (Bis jetzt haben wir nur Query-Parameter gesehen), dann ist der Parameter nicht erforderlich.
Wenn Sie keinen spezifischen Wert haben wollen, sondern der Parameter einfach optional sein soll, dann setzen Sie den Defaultwert auf `None`.
Aber wenn Sie wollen, dass ein Query-Parameter erforderlich ist, vergeben Sie einfach keinen Defaultwert:
```Python hl_lines="6-7"
{!../../../docs_src/query_params/tutorial005.py!}
```
Hier ist `needy` ein erforderlicher Query-Parameter vom Typ `str`.
Wenn Sie in Ihrem Browser eine URL wie:
```
http://127.0.0.1:8000/items/foo-item
```
... öffnen, ohne den benötigten Parameter `needy`, dann erhalten Sie einen Fehler wie den folgenden:
```JSON
{
"detail": [
{
"type": "missing",
"loc": [
"query",
"needy"
],
"msg": "Field required",
"input": null,
"url": "https://errors.pydantic.dev/2.1/v/missing"
}
]
}
```
Da `needy` ein erforderlicher Parameter ist, müssen Sie ihn in der URL setzen:
```
http://127.0.0.1:8000/items/foo-item?needy=sooooneedy
```
... Das funktioniert:
```JSON
{
"item_id": "foo-item",
"needy": "sooooneedy"
}
```
Und natürlich können Sie einige Parameter als erforderlich, einige mit Defaultwert, und einige als vollständig optional definieren:
=== "Python 3.10+"
```Python hl_lines="8"
{!> ../../../docs_src/query_params/tutorial006_py310.py!}
```
=== "Python 3.8+"
```Python hl_lines="10"
{!> ../../../docs_src/query_params/tutorial006.py!}
```
In diesem Fall gibt es drei Query-Parameter:
* `needy`, ein erforderlicher `str`.
* `skip`, ein `int` mit einem Defaultwert `0`.
* `limit`, ein optionales `int`.
!!! tip "Tipp"
Sie können auch `Enum`s verwenden, auf die gleiche Weise wie mit [Pfad-Parametern](path-params.md#vordefinierte-parameterwerte){.internal-link target=_blank}.

1
docs/de/mkdocs.yml Normal file
View File

@@ -0,0 +1 @@
INHERIT: ../en/mkdocs.yml

View File

@@ -0,0 +1,240 @@
# 🌖 📨 🗄
!!! warning
👉 👍 🏧 ❔.
🚥 👆 ▶️ ⏮️ **FastAPI**, 👆 💪 🚫 💪 👉.
👆 💪 📣 🌖 📨, ⏮️ 🌖 👔 📟, 🔉 🆎, 📛, ♒️.
👈 🌖 📨 🔜 🔌 🗄 🔗, 👫 🔜 😑 🛠️ 🩺.
✋️ 👈 🌖 📨 👆 ✔️ ⚒ 💭 👆 📨 `Response` 💖 `JSONResponse` 🔗, ⏮️ 👆 👔 📟 &amp; 🎚.
## 🌖 📨 ⏮️ `model`
👆 💪 🚶‍♀️ 👆 *➡ 🛠️ 👨‍🎨* 🔢 `responses`.
⚫️ 📨 `dict`, 🔑 👔 📟 🔠 📨, 💖 `200`, &amp; 💲 🎏 `dict`Ⓜ ⏮️ 🔠 👫.
🔠 👈 📨 `dict`Ⓜ 💪 ✔️ 🔑 `model`, ⚗ Pydantic 🏷, 💖 `response_model`.
**FastAPI** 🔜 ✊ 👈 🏷, 🏗 🚮 🎻 🔗 &amp; 🔌 ⚫️ ☑ 🥉 🗄.
🖼, 📣 1⃣ 📨 ⏮️ 👔 📟 `404` &amp; Pydantic 🏷 `Message`, 👆 💪 ✍:
```Python hl_lines="18 22"
{!../../../docs_src/additional_responses/tutorial001.py!}
```
!!! note
✔️ 🤯 👈 👆 ✔️ 📨 `JSONResponse` 🔗.
!!! info
`model` 🔑 🚫 🍕 🗄.
**FastAPI** 🔜 ✊ Pydantic 🏷 ⚪️➡️ 📤, 🏗 `JSON Schema`, &amp; 🚮 ⚫️ ☑ 🥉.
☑ 🥉:
* 🔑 `content`, 👈 ✔️ 💲 1⃣ 🎻 🎚 (`dict`) 👈 🔌:
* 🔑 ⏮️ 📻 🆎, ✅ `application/json`, 👈 🔌 💲 1⃣ 🎻 🎚, 👈 🔌:
* 🔑 `schema`, 👈 ✔️ 💲 🎻 🔗 ⚪️➡️ 🏷, 📥 ☑ 🥉.
* **FastAPI** 🚮 🔗 📥 🌐 🎻 🔗 1⃣ 🥉 👆 🗄 ↩️ ✅ ⚫️ 🔗. 👉 🌌, 🎏 🈸 &amp; 👩‍💻 💪 ⚙️ 👈 🎻 🔗 🔗, 🚚 👻 📟 ⚡ 🧰, ♒️.
🏗 📨 🗄 👉 *➡ 🛠️* 🔜:
```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"
}
}
}
}
}
}
```
🔗 🔗 1⃣ 🥉 🔘 🗄 🔗:
```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`, 📣 👈 👆 *➡ 🛠️* 💪 📨 🎻 🎚 (⏮️ 📻 🆎 `application/json`) ⚖️ 🇩🇴 🖼:
```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`, &amp; `responses` 🔢.
👆 💪 📣 `response_model`, ⚙️ 🔢 👔 📟 `200` (⚖️ 🛃 1⃣ 🚥 👆 💪), &amp; ⤴️ 📣 🌖 👈 🎏 📨 `responses`, 🔗 🗄 🔗.
**FastAPI** 🔜 🚧 🌖 ⚪️➡️ `responses`, &amp; 🌀 ⚫️ ⏮️ 🎻 🔗 ⚪️➡️ 👆 🏷.
🖼, 👆 💪 📣 📨 ⏮️ 👔 📟 `404` 👈 ⚙️ Pydantic 🏷 &amp; ✔️ 🛃 `description`.
&amp; 📨 ⏮️ 👔 📟 `200` 👈 ⚙️ 👆 `response_model`, ✋️ 🔌 🛃 `example`:
```Python hl_lines="20-31"
{!../../../docs_src/additional_responses/tutorial003.py!}
```
⚫️ 🔜 🌐 🌀 &amp; 🔌 👆 🗄, &amp; 🎦 🛠️ 🩺:
<img src="/img/tutorial/additional-responses/image01.png">
## 🌀 🔢 📨 &amp; 🛃 🕐
👆 💪 💚 ✔️ 🔁 📨 👈 ✔ 📚 *➡ 🛠️*, ✋️ 👆 💚 🌀 👫 ⏮️ 🛃 📨 💚 🔠 *➡ 🛠️*.
📚 💼, 👆 💪 ⚙️ 🐍 ⚒ "🏗" `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",
}
```
👆 💪 ⚙️ 👈 ⚒ 🏤-⚙️ 🔢 📨 👆 *➡ 🛠️* &amp; 🌀 👫 ⏮️ 🌖 🛃 🕐.
🖼:
```Python hl_lines="13-17 26"
{!../../../docs_src/additional_responses/tutorial004.py!}
```
## 🌖 🔃 🗄 📨
👀 ⚫️❔ ⚫️❔ 👆 💪 🔌 📨, 👆 💪 ✅ 👉 📄 🗄 🔧:
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responsesObject" class="external-link" target="_blank">🗄 📨 🎚</a>, ⚫️ 🔌 `Response Object`.
* <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#responseObject" class="external-link" target="_blank">🗄 📨 🎚</a>, 👆 💪 🔌 🕳 ⚪️➡️ 👉 🔗 🔠 📨 🔘 👆 `responses` 🔢. ✅ `description`, `headers`, `content` (🔘 👉 👈 👆 📣 🎏 🔉 🆎 &amp; 🎻 🔗), &amp; `links`.

View File

@@ -0,0 +1,37 @@
# 🌖 👔 📟
🔢, **FastAPI** 🔜 📨 📨 ⚙️ `JSONResponse`, 🚮 🎚 👆 📨 ⚪️➡️ 👆 *➡ 🛠️* 🔘 👈 `JSONResponse`.
⚫️ 🔜 ⚙️ 🔢 👔 📟 ⚖️ 1⃣ 👆 ⚒ 👆 *➡ 🛠️*.
## 🌖 👔 📟
🚥 👆 💚 📨 🌖 👔 📟 ↖️ ⚪️➡️ 👑 1⃣, 👆 💪 👈 🛬 `Response` 🔗, 💖 `JSONResponse`, &amp; ⚒ 🌖 👔 📟 🔗.
🖼, ➡️ 💬 👈 👆 💚 ✔️ *➡ 🛠️* 👈 ✔ 🏬, &amp; 📨 🇺🇸🔍 👔 📟 2⃣0⃣0⃣ "👌" 🕐❔ 🏆.
✋️ 👆 💚 ⚫️ 🚫 🆕 🏬. &amp; 🕐❔ 🏬 🚫 🔀 ⏭, ⚫️ ✍ 👫, &amp; 📨 🇺🇸🔍 👔 📟 2⃣0⃣1⃣ "✍".
🏆 👈, 🗄 `JSONResponse`, &amp; 📨 👆 🎚 📤 🔗, ⚒ `status_code` 👈 👆 💚:
```Python hl_lines="4 25"
{!../../../docs_src/additional_status_codes/tutorial001.py!}
```
!!! warning
🕐❔ 👆 📨 `Response` 🔗, 💖 🖼 🔛, ⚫️ 🔜 📨 🔗.
⚫️ 🏆 🚫 🎻 ⏮️ 🏷, ♒️.
⚒ 💭 ⚫️ ✔️ 📊 👆 💚 ⚫️ ✔️, &amp; 👈 💲 ☑ 🎻 (🚥 👆 ⚙️ `JSONResponse`).
!!! note "📡 "
👆 💪 ⚙️ `from starlette.responses import JSONResponse`.
**FastAPI** 🚚 🎏 `starlette.responses` `fastapi.responses` 🏪 👆, 👩‍💻. ✋️ 🌅 💪 📨 👟 🔗 ⚪️➡️ 💃. 🎏 ⏮️ `status`.
## 🗄 &amp; 🛠️ 🩺
🚥 👆 📨 🌖 👔 📟 &amp; 📨 🔗, 👫 🏆 🚫 🔌 🗄 🔗 (🛠️ 🩺), ↩️ FastAPI 🚫 ✔️ 🌌 💭 ⏪ ⚫️❔ 👆 🚶 📨.
✋️ 👆 💪 📄 👈 👆 📟, ⚙️: [🌖 📨](additional-responses.md){.internal-link target=_blank}.

View File

@@ -0,0 +1,70 @@
# 🏧 🔗
## 🔗 🔗
🌐 🔗 👥 ✔️ 👀 🔧 🔢 ⚖️ 🎓.
✋️ 📤 💪 💼 🌐❔ 👆 💚 💪 ⚒ 🔢 🔛 🔗, 🍵 ✔️ 📣 📚 🎏 🔢 ⚖️ 🎓.
➡️ 🌈 👈 👥 💚 ✔️ 🔗 👈 ✅ 🚥 🔢 🔢 `q` 🔌 🔧 🎚.
✋️ 👥 💚 💪 🔗 👈 🔧 🎚.
## "🇧🇲" 👐
🐍 📤 🌌 ⚒ 👐 🎓 "🇧🇲".
🚫 🎓 ⚫️ (❔ ⏪ 🇧🇲), ✋️ 👐 👈 🎓.
👈, 👥 📣 👩‍🔬 `__call__`:
```Python hl_lines="10"
{!../../../docs_src/dependencies/tutorial011.py!}
```
👉 💼, 👉 `__call__` ⚫️❔ **FastAPI** 🔜 ⚙️ ✅ 🌖 🔢 &amp; 🎧-🔗, &amp; 👉 ⚫️❔ 🔜 🤙 🚶‍♀️ 💲 🔢 👆 *➡ 🛠️ 🔢* ⏪.
## 🔗 👐
&amp; 🔜, 👥 💪 ⚙️ `__init__` 📣 🔢 👐 👈 👥 💪 ⚙️ "🔗" 🔗:
```Python hl_lines="7"
{!../../../docs_src/dependencies/tutorial011.py!}
```
👉 💼, **FastAPI** 🏆 🚫 ⏱ 👆 ⚖️ 💅 🔃 `__init__`, 👥 🔜 ⚙️ ⚫️ 🔗 👆 📟.
## ✍ 👐
👥 💪 ✍ 👐 👉 🎓 ⏮️:
```Python hl_lines="16"
{!../../../docs_src/dependencies/tutorial011.py!}
```
&amp; 👈 🌌 👥 💪 "🔗" 👆 🔗, 👈 🔜 ✔️ `"bar"` 🔘 ⚫️, 🔢 `checker.fixed_content`.
## ⚙️ 👐 🔗
⤴️, 👥 💪 ⚙️ 👉 `checker` `Depends(checker)`, ↩️ `Depends(FixedContentQueryChecker)`, ↩️ 🔗 👐, `checker`, 🚫 🎓 ⚫️.
&amp; 🕐❔ ❎ 🔗, **FastAPI** 🔜 🤙 👉 `checker` 💖:
```Python
checker(q="somequery")
```
...&amp; 🚶‍♀️ ⚫️❔ 👈 📨 💲 🔗 👆 *➡ 🛠️ 🔢* 🔢 `fixed_content_included`:
```Python hl_lines="20"
{!../../../docs_src/dependencies/tutorial011.py!}
```
!!! tip
🌐 👉 💪 😑 🎭. &amp; ⚫️ 💪 🚫 📶 🆑 ❔ ⚫️ ⚠.
👫 🖼 😫 🙅, ✋️ 🎦 ❔ ⚫️ 🌐 👷.
📃 🔃 💂‍♂, 📤 🚙 🔢 👈 🛠️ 👉 🎏 🌌.
🚥 👆 🤔 🌐 👉, 👆 ⏪ 💭 ❔ 👈 🚙 🧰 💂‍♂ 👷 🔘.

View File

@@ -0,0 +1,162 @@
# 🔁 🗄 (🔗) 💽
👆 💪 ⚙️ <a href="https://github.com/encode/databases" class="external-link" target="_blank">`encode/databases`</a> ⏮️ **FastAPI** 🔗 💽 ⚙️ `async` &amp; `await`.
⚫️ 🔗 ⏮️:
*
*
* 🗄
👉 🖼, 👥 🔜 ⚙️ **🗄**, ↩️ ⚫️ ⚙️ 👁 📁 &amp; 🐍 ✔️ 🛠️ 🐕‍🦺. , 👆 💪 📁 👉 🖼 &amp; 🏃 ⚫️.
⏪, 👆 🏭 🈸, 👆 💪 💚 ⚙️ 💽 💽 💖 **✳**.
!!! tip
👆 💪 🛠️ 💭 ⚪️➡️ 📄 🔃 🇸🇲 🐜 ([🗄 (🔗) 💽](../tutorial/sql-databases.md){.internal-link target=_blank}), 💖 ⚙️ 🚙 🔢 🎭 🛠️ 💽, 🔬 👆 **FastAPI** 📟.
👉 📄 🚫 ✔ 📚 💭, 🌓 😑 <a href="https://www.starlette.io/database/" class="external-link" target="_blank">💃</a>.
## 🗄 &amp; ⚒ 🆙 `SQLAlchemy`
* 🗄 `SQLAlchemy`.
*`metadata` 🎚.
* ✍ 🏓 `notes` ⚙️ `metadata` 🎚.
```Python hl_lines="4 14 16-22"
{!../../../docs_src/async_sql_databases/tutorial001.py!}
```
!!! tip
👀 👈 🌐 👉 📟 😁 🇸🇲 🐚.
`databases` 🚫 🔨 🕳 📥.
## 🗄 &amp; ⚒ 🆙 `databases`
* 🗄 `databases`.
* ✍ `DATABASE_URL`.
* ✍ `database` 🎚.
```Python hl_lines="3 9 12"
{!../../../docs_src/async_sql_databases/tutorial001.py!}
```
!!! tip
🚥 👆 🔗 🎏 💽 (✅ ✳), 👆 🔜 💪 🔀 `DATABASE_URL`.
## ✍ 🏓
👉 💼, 👥 🏗 🏓 🎏 🐍 📁, ✋️ 🏭, 👆 🔜 🎲 💚 ✍ 👫 ⏮️ ⚗, 🛠️ ⏮️ 🛠️, ♒️.
📥, 👉 📄 🔜 🏃 🔗, ▶️️ ⏭ ▶️ 👆 **FastAPI** 🈸.
* ✍ `engine`.
* ✍ 🌐 🏓 ⚪️➡️ `metadata` 🎚.
```Python hl_lines="25-28"
{!../../../docs_src/async_sql_databases/tutorial001.py!}
```
## ✍ 🏷
✍ Pydantic 🏷:
* 🗒 ✍ (`NoteIn`).
* 🗒 📨 (`Note`).
```Python hl_lines="31-33 36-39"
{!../../../docs_src/async_sql_databases/tutorial001.py!}
```
🏗 👫 Pydantic 🏷, 🔢 💽 🔜 ✔, 🎻 (🗜), &amp; ✍ (📄).
, 👆 🔜 💪 👀 ⚫️ 🌐 🎓 🛠️ 🩺.
## 🔗 &amp; 🔌
* ✍ 👆 `FastAPI` 🈸.
* ✍ 🎉 🐕‍🦺 🔗 &amp; 🔌 ⚪️➡️ 💽.
```Python hl_lines="42 45-47 50-52"
{!../../../docs_src/async_sql_databases/tutorial001.py!}
```
## ✍ 🗒
✍ *➡ 🛠️ 🔢* ✍ 🗒:
```Python hl_lines="55-58"
{!../../../docs_src/async_sql_databases/tutorial001.py!}
```
!!! Note
👀 👈 👥 🔗 ⏮️ 💽 ⚙️ `await`, *➡ 🛠️ 🔢* 📣 ⏮️ `async`.
### 👀 `response_model=List[Note]`
⚫️ ⚙️ `typing.List`.
👈 📄 (&amp; ✔, 🎻, ⛽) 🔢 💽, `list` `Note`Ⓜ.
## ✍ 🗒
✍ *➡ 🛠️ 🔢* ✍ 🗒:
```Python hl_lines="61-65"
{!../../../docs_src/async_sql_databases/tutorial001.py!}
```
!!! Note
👀 👈 👥 🔗 ⏮️ 💽 ⚙️ `await`, *➡ 🛠️ 🔢* 📣 ⏮️ `async`.
### 🔃 `{**note.dict(), "id": last_record_id}`
`note` Pydantic `Note` 🎚.
`note.dict()` 📨 `dict` ⏮️ 🚮 💽, 🕳 💖:
```Python
{
"text": "Some note",
"completed": False,
}
```
✋️ ⚫️ 🚫 ✔️ `id` 🏑.
👥 ✍ 🆕 `dict`, 👈 🔌 🔑-💲 👫 ⚪️➡️ `note.dict()` ⏮️:
```Python
{**note.dict()}
```
`**note.dict()` "unpacks" the key value pairs directly, so, `{**note.dict()}` would be, more or less, a copy of `note.dict()`.
&amp; ⤴️, 👥 ↔ 👈 📁 `dict`, ❎ 1⃣ 🔑-💲 👫: `"id": last_record_id`:
```Python
{**note.dict(), "id": last_record_id}
```
, 🏁 🏁 📨 🔜 🕳 💖:
```Python
{
"id": 1,
"text": "Some note",
"completed": False,
}
```
## ✅ ⚫️
👆 💪 📁 👉 📟, &amp; 👀 🩺 <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
📤 👆 💪 👀 🌐 👆 🛠️ 📄 &amp; 🔗 ⏮️ ⚫️:
<img src="/img/tutorial/async-sql-databases/image01.png">
## 🌅
👆 💪 ✍ 🌅 🔃 <a href="https://github.com/encode/databases" class="external-link" target="_blank">`encode/databases` 🚮 📂 📃</a>.

View File

@@ -0,0 +1,92 @@
# 🔁 💯
👆 ✔️ ⏪ 👀 ❔ 💯 👆 **FastAPI** 🈸 ⚙️ 🚚 `TestClient`. 🆙 🔜, 👆 ✔️ 🕴 👀 ❔ ✍ 🔁 💯, 🍵 ⚙️ `async` 🔢.
💪 ⚙️ 🔁 🔢 👆 💯 💪 ⚠, 🖼, 🕐❔ 👆 🔬 👆 💽 🔁. 🌈 👆 💚 💯 📨 📨 👆 FastAPI 🈸 &amp; ⤴️ ✔ 👈 👆 👩‍💻 ⏪ ✍ ☑ 💽 💽, ⏪ ⚙️ 🔁 💽 🗃.
➡️ 👀 ❔ 👥 💪 ⚒ 👈 👷.
## pytest.mark.anyio
🚥 👥 💚 🤙 🔁 🔢 👆 💯, 👆 💯 🔢 ✔️ 🔁. AnyIO 🚚 👌 📁 👉, 👈 ✔ 👥 ✔ 👈 💯 🔢 🤙 🔁.
## 🇸🇲
🚥 👆 **FastAPI** 🈸 ⚙️ 😐 `def` 🔢 ↩️ `async def`, ⚫️ `async` 🈸 🔘.
`TestClient` 🔨 🎱 🔘 🤙 🔁 FastAPI 🈸 👆 😐 `def` 💯 🔢, ⚙️ 🐩 ✳. ✋️ 👈 🎱 🚫 👷 🚫🔜 🕐❔ 👥 ⚙️ ⚫️ 🔘 🔁 🔢. 🏃 👆 💯 🔁, 👥 💪 🙅‍♂ 📏 ⚙️ `TestClient` 🔘 👆 💯 🔢.
`TestClient` ⚓️ 🔛 <a href="https://www.python-httpx.org" class="external-link" target="_blank">🇸🇲</a>, &amp; ↩️, 👥 💪 ⚙️ ⚫️ 🔗 💯 🛠️.
## 🖼
🙅 🖼, ➡️ 🤔 📁 📊 🎏 1⃣ 🔬 [🦏 🈸](../tutorial/bigger-applications.md){.internal-link target=_blank} &amp; [🔬](../tutorial/testing.md){.internal-link target=_blank}:
```
.
├── app
│   ├── __init__.py
│   ├── main.py
│   └── test_main.py
```
📁 `main.py` 🔜 ✔️:
```Python
{!../../../docs_src/async_tests/main.py!}
```
📁 `test_main.py` 🔜 ✔️ 💯 `main.py`, ⚫️ 💪 👀 💖 👉 🔜:
```Python
{!../../../docs_src/async_tests/test_main.py!}
```
## 🏃 ⚫️
👆 💪 🏃 👆 💯 🐌 📨:
<div class="termy">
```console
$ pytest
---> 100%
```
</div>
##
📑 `@pytest.mark.anyio` 💬 ✳ 👈 👉 💯 🔢 🔜 🤙 🔁:
```Python hl_lines="7"
{!../../../docs_src/async_tests/test_main.py!}
```
!!! tip
🗒 👈 💯 🔢 🔜 `async def` ↩️ `def` ⏭ 🕐❔ ⚙️ `TestClient`.
⤴️ 👥 💪 ✍ `AsyncClient` ⏮️ 📱, &amp; 📨 🔁 📨 ⚫️, ⚙️ `await`.
```Python hl_lines="9-10"
{!../../../docs_src/async_tests/test_main.py!}
```
👉 🌓:
```Python
response = client.get('/')
```
...👈 👥 ⚙️ ⚒ 👆 📨 ⏮️ `TestClient`.
!!! tip
🗒 👈 👥 ⚙️ 🔁/⌛ ⏮️ 🆕 `AsyncClient` - 📨 🔁.
## 🎏 🔁 🔢 🤙
🔬 🔢 🔜 🔁, 👆 💪 🔜 🤙 (&amp; `await`) 🎏 `async` 🔢 ↖️ ⚪️➡️ 📨 📨 👆 FastAPI 🈸 👆 💯, ⚫️❔ 👆 🔜 🤙 👫 🙆 🙆 👆 📟.
!!! tip
🚥 👆 ⚔ `RuntimeError: Task attached to a different loop` 🕐❔ 🛠️ 🔁 🔢 🤙 👆 💯 (✅ 🕐❔ ⚙️ <a href="https://stackoverflow.com/questions/41584243/runtimeerror-task-attached-to-a-different-loop" class="external-link" target="_blank">✳ MotorClient</a>) 💭 🔗 🎚 👈 💪 🎉 ➰ 🕴 🏞 🔁 🔢, ✅ `'@app.on_event("startup")` ⏲.

View File

@@ -0,0 +1,346 @@
# ⛅ 🗳
⚠, 👆 5⃣📆 💪 ⚙️ **🗳** 💽 💖 Traefik ⚖️ 👌 ⏮️ 📳 👈 🚮 ➡ 🔡 👈 🚫 👀 👆 🈸.
👫 💼 👆 💪 ⚙️ `root_path` 🔗 👆 🈸.
`root_path` 🛠️ 🚚 🔫 🔧 (👈 FastAPI 🏗 🔛, 🔘 💃).
`root_path` ⚙️ 🍵 👫 🎯 💼.
&amp; ⚫️ ⚙️ 🔘 🕐❔ 🗜 🎧-🈸.
## 🗳 ⏮️ 🎞 ➡ 🔡
✔️ 🗳 ⏮️ 🎞 ➡ 🔡, 👉 💼, ⛓ 👈 👆 💪 📣 ➡ `/app` 👆 📟, ✋️ ⤴️, 👆 🚮 🧽 🔛 🔝 (🗳) 👈 🔜 🚮 👆 **FastAPI** 🈸 🔽 ➡ 💖 `/api/v1`.
👉 💼, ⏮️ ➡ `/app` 🔜 🤙 🍦 `/api/v1/app`.
✋️ 🌐 👆 📟 ✍ 🤔 📤 `/app`.
&amp; 🗳 🔜 **"❎"** **➡ 🔡** 🔛 ✈ ⏭ 📶 📨 Uvicorn, 🚧 👆 🈸 🤔 👈 ⚫️ 🍦 `/app`, 👈 👆 🚫 ✔️ 🌐 👆 📟 🔌 🔡 `/api/v1`.
🆙 📥, 🌐 🔜 👷 🛎.
✋️ ⤴️, 🕐❔ 👆 📂 🛠️ 🩺 🎚 (🕸), ⚫️ 🔜 ⌛ 🤚 🗄 🔗 `/openapi.json`, ↩️ `/api/v1/openapi.json`.
, 🕸 (👈 🏃 🖥) 🔜 🔄 🏆 `/openapi.json` &amp; 🚫🔜 💪 🤚 🗄 🔗.
↩️ 👥 ✔️ 🗳 ⏮️ ➡ 🔡 `/api/v1` 👆 📱, 🕸 💪 ☕ 🗄 🔗 `/api/v1/openapi.json`.
```mermaid
graph LR
browser("Browser")
proxy["Proxy on http://0.0.0.0:9999/api/v1/app"]
server["Server on http://127.0.0.1:8000/app"]
browser --> proxy
proxy --> server
```
!!! tip
📢 `0.0.0.0` 🛎 ⚙️ ⛓ 👈 📋 👂 🔛 🌐 📢 💪 👈 🎰/💽.
🩺 🎚 🔜 💪 🗄 🔗 📣 👈 👉 🛠️ `server` 🔎 `/api/v1` (⛅ 🗳). 🖼:
```JSON hl_lines="4-8"
{
"openapi": "3.0.2",
// More stuff here
"servers": [
{
"url": "/api/v1"
}
],
"paths": {
// More stuff here
}
}
```
👉 🖼, "🗳" 💪 🕳 💖 **Traefik**. &amp; 💽 🔜 🕳 💖 **Uvicorn**, 🏃‍♂ 👆 FastAPI 🈸.
### 🚚 `root_path`
🏆 👉, 👆 💪 ⚙️ 📋 ⏸ 🎛 `--root-path` 💖:
<div class="termy">
```console
$ uvicorn main:app --root-path /api/v1
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
🚥 👆 ⚙️ Hypercorn, ⚫️ ✔️ 🎛 `--root-path`.
!!! note "📡 "
🔫 🔧 🔬 `root_path` 👉 ⚙️ 💼.
&amp; `--root-path` 📋 ⏸ 🎛 🚚 👈 `root_path`.
### ✅ ⏮️ `root_path`
👆 💪 🤚 ⏮️ `root_path` ⚙️ 👆 🈸 🔠 📨, ⚫️ 🍕 `scope` 📖 (👈 🍕 🔫 🔌).
📥 👥 ✅ ⚫️ 📧 🎦 🎯.
```Python hl_lines="8"
{!../../../docs_src/behind_a_proxy/tutorial001.py!}
```
⤴️, 🚥 👆 ▶️ Uvicorn ⏮️:
<div class="termy">
```console
$ uvicorn main:app --root-path /api/v1
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
📨 🔜 🕳 💖:
```JSON
{
"message": "Hello World",
"root_path": "/api/v1"
}
```
### ⚒ `root_path` FastAPI 📱
👐, 🚥 👆 🚫 ✔️ 🌌 🚚 📋 ⏸ 🎛 💖 `--root-path` ⚖️ 🌓, 👆 💪 ⚒ `root_path` 🔢 🕐❔ 🏗 👆 FastAPI 📱:
```Python hl_lines="3"
{!../../../docs_src/behind_a_proxy/tutorial002.py!}
```
🚶‍♀️ `root_path` `FastAPI` 🔜 🌓 🚶‍♀️ `--root-path` 📋 ⏸ 🎛 Uvicorn ⚖️ Hypercorn.
### 🔃 `root_path`
✔️ 🤯 👈 💽 (Uvicorn) 🏆 🚫 ⚙️ 👈 `root_path` 🕳 🙆 🌘 🚶‍♀️ ⚫️ 📱.
✋️ 🚥 👆 🚶 ⏮️ 👆 🖥 <a href="http://127.0.0.1:8000" class="external-link" target="_blank">http://127.0.0.1:8000/app</a> 👆 🔜 👀 😐 📨:
```JSON
{
"message": "Hello World",
"root_path": "/api/v1"
}
```
, ⚫️ 🏆 🚫 ⌛ 🔐 `http://127.0.0.1:8000/api/v1/app`.
Uvicorn 🔜 ⌛ 🗳 🔐 Uvicorn `http://127.0.0.1:8000/app`, &amp; ⤴️ ⚫️ 🔜 🗳 🎯 🚮 `/api/v1` 🔡 🔛 🔝.
## 🔃 🗳 ⏮️ 🎞 ➡ 🔡
✔️ 🤯 👈 🗳 ⏮️ 🎞 ➡ 🔡 🕴 1⃣ 🌌 🔗 ⚫️.
🎲 📚 💼 🔢 🔜 👈 🗳 🚫 ✔️ 🏚 ➡ 🔡.
💼 💖 👈 (🍵 🎞 ➡ 🔡), 🗳 🔜 👂 🔛 🕳 💖 `https://myawesomeapp.com`, &amp; ⤴️ 🚥 🖥 🚶 `https://myawesomeapp.com/api/v1/app` &amp; 👆 💽 (✅ Uvicorn) 👂 🔛 `http://127.0.0.1:8000` 🗳 (🍵 🎞 ➡ 🔡) 🔜 🔐 Uvicorn 🎏 ➡: `http://127.0.0.1:8000/api/v1/app`.
## 🔬 🌐 ⏮️ Traefik
👆 💪 💪 🏃 🥼 🌐 ⏮️ 🎞 ➡ 🔡 ⚙️ <a href="https://docs.traefik.io/" class="external-link" target="_blank">Traefik</a>.
<a href="https://github.com/containous/traefik/releases" class="external-link" target="_blank">⏬ Traefik</a>, ⚫️ 👁 💱, 👆 💪 ⚗ 🗜 📁 &amp; 🏃 ⚫️ 🔗 ⚪️➡️ 📶.
⤴️ ✍ 📁 `traefik.toml` ⏮️:
```TOML hl_lines="3"
[entryPoints]
[entryPoints.http]
address = ":9999"
[providers]
[providers.file]
filename = "routes.toml"
```
👉 💬 Traefik 👂 🔛 ⛴ 9⃣9⃣9⃣9⃣ &amp; ⚙️ 1⃣ 📁 `routes.toml`.
!!! tip
👥 ⚙️ ⛴ 9⃣9⃣9⃣9⃣ ↩️ 🐩 🇺🇸🔍 ⛴ 8⃣0⃣ 👈 👆 🚫 ✔️ 🏃 ⚫️ ⏮️ 📡 (`sudo`) 😌.
🔜 ✍ 👈 🎏 📁 `routes.toml`:
```TOML hl_lines="5 12 20"
[http]
[http.middlewares]
[http.middlewares.api-stripprefix.stripPrefix]
prefixes = ["/api/v1"]
[http.routers]
[http.routers.app-http]
entryPoints = ["http"]
service = "app"
rule = "PathPrefix(`/api/v1`)"
middlewares = ["api-stripprefix"]
[http.services]
[http.services.app]
[http.services.app.loadBalancer]
[[http.services.app.loadBalancer.servers]]
url = "http://127.0.0.1:8000"
```
👉 📁 🔗 Traefik ⚙️ ➡ 🔡 `/api/v1`.
&amp; ⤴️ ⚫️ 🔜 ❎ 🚮 📨 👆 Uvicorn 🏃‍♂ 🔛 `http://127.0.0.1:8000`.
🔜 ▶️ Traefik:
<div class="termy">
```console
$ ./traefik --configFile=traefik.toml
INFO[0000] Configuration loaded from file: /home/user/awesomeapi/traefik.toml
```
</div>
&amp; 🔜 ▶️ 👆 📱 ⏮️ Uvicorn, ⚙️ `--root-path` 🎛:
<div class="termy">
```console
$ uvicorn main:app --root-path /api/v1
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
### ✅ 📨
🔜, 🚥 👆 🚶 📛 ⏮️ ⛴ Uvicorn: <a href="http://127.0.0.1:8000/app" class="external-link" target="_blank">http://127.0.0.1:8000/app</a>, 👆 🔜 👀 😐 📨:
```JSON
{
"message": "Hello World",
"root_path": "/api/v1"
}
```
!!! tip
👀 👈 ✋️ 👆 🔐 ⚫️ `http://127.0.0.1:8000/app` ⚫️ 🎦 `root_path` `/api/v1`, ✊ ⚪️➡️ 🎛 `--root-path`.
&amp; 🔜 📂 📛 ⏮️ ⛴ Traefik, ✅ ➡ 🔡: <a href="http://127.0.0.1:9999/api/v1/app" class="external-link" target="_blank">http://127.0.0.1:9999/api/v1/app</a>.
👥 🤚 🎏 📨:
```JSON
{
"message": "Hello World",
"root_path": "/api/v1"
}
```
✋️ 👉 🕰 📛 ⏮️ 🔡 ➡ 🚚 🗳: `/api/v1`.
↗️, 💭 📥 👈 👱 🔜 🔐 📱 🔘 🗳, ⏬ ⏮️ ➡ 🔡 `/app/v1` "☑" 1⃣.
&amp; ⏬ 🍵 ➡ 🔡 (`http://127.0.0.1:8000/app`), 🚚 Uvicorn 🔗, 🔜 🎯 _🗳_ (Traefik) 🔐 ⚫️.
👈 🎦 ❔ 🗳 (Traefik) ⚙️ ➡ 🔡 &amp; ❔ 💽 (Uvicorn) ⚙️ `root_path` ⚪️➡️ 🎛 `--root-path`.
### ✅ 🩺 🎚
✋️ 📥 🎊 🍕. 👶
"🛂" 🌌 🔐 📱 🔜 🔘 🗳 ⏮️ ➡ 🔡 👈 👥 🔬. , 👥 🔜 ⌛, 🚥 👆 🔄 🩺 🎚 🍦 Uvicorn 🔗, 🍵 ➡ 🔡 📛, ⚫️ 🏆 🚫 👷, ↩️ ⚫️ ⌛ 🔐 🔘 🗳.
👆 💪 ✅ ⚫️ <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>:
<img src="/img/tutorial/behind-a-proxy/image01.png">
✋️ 🚥 👥 🔐 🩺 🎚 "🛂" 📛 ⚙️ 🗳 ⏮️ ⛴ `9999`, `/api/v1/docs`, ⚫️ 👷 ☑ ❗ 👶
👆 💪 ✅ ⚫️ <a href="http://127.0.0.1:9999/api/v1/docs" class="external-link" target="_blank">http://127.0.0.1:9999/api/v1/docs</a>:
<img src="/img/tutorial/behind-a-proxy/image02.png">
▶️️ 👥 💚 ⚫️. 👶 👶
👉 ↩️ FastAPI ⚙️ 👉 `root_path` ✍ 🔢 `server` 🗄 ⏮️ 📛 🚚 `root_path`.
## 🌖 💽
!!! warning
👉 🌅 🏧 ⚙️ 💼. 💭 🆓 🚶 ⚫️.
🔢, **FastAPI** 🔜 ✍ `server` 🗄 🔗 ⏮️ 📛 `root_path`.
✋️ 👆 💪 🚚 🎏 🎛 `servers`, 🖼 🚥 👆 💚 *🎏* 🩺 🎚 🔗 ⏮️ 🏗 &amp; 🏭 🌐.
🚥 👆 🚶‍♀️ 🛃 📇 `servers` &amp; 📤 `root_path` (↩️ 👆 🛠️ 👨‍❤‍👨 ⛅ 🗳), **FastAPI** 🔜 📩 "💽" ⏮️ 👉 `root_path` ▶️ 📇.
🖼:
```Python hl_lines="4-7"
{!../../../docs_src/behind_a_proxy/tutorial003.py!}
```
🔜 🏗 🗄 🔗 💖:
```JSON hl_lines="5-7"
{
"openapi": "3.0.2",
// More stuff here
"servers": [
{
"url": "/api/v1"
},
{
"url": "https://stag.example.com",
"description": "Staging environment"
},
{
"url": "https://prod.example.com",
"description": "Production environment"
}
],
"paths": {
// More stuff here
}
}
```
!!! tip
👀 🚘-🏗 💽 ⏮️ `url` 💲 `/api/v1`, ✊ ⚪️➡️ `root_path`.
🩺 🎚 <a href="http://127.0.0.1:9999/api/v1/docs" class="external-link" target="_blank">http://127.0.0.1:9999/api/v1/docs</a> ⚫️ 🔜 👀 💖:
<img src="/img/tutorial/behind-a-proxy/image03.png">
!!! tip
🩺 🎚 🔜 🔗 ⏮️ 💽 👈 👆 🖊.
### ❎ 🏧 💽 ⚪️➡️ `root_path`
🚥 👆 🚫 💚 **FastAPI** 🔌 🏧 💽 ⚙️ `root_path`, 👆 💪 ⚙️ 🔢 `root_path_in_servers=False`:
```Python hl_lines="9"
{!../../../docs_src/behind_a_proxy/tutorial004.py!}
```
&amp; ⤴️ ⚫️ 🏆 🚫 🔌 ⚫️ 🗄 🔗.
## 🗜 🎧-🈸
🚥 👆 💪 🗻 🎧-🈸 (🔬 [🎧 🈸 - 🗻](./sub-applications.md){.internal-link target=_blank}) ⏪ ⚙️ 🗳 ⏮️ `root_path`, 👆 💪 ⚫️ 🛎, 👆 🔜 ⌛.
FastAPI 🔜 🔘 ⚙️ `root_path` 🎆, ⚫️ 🔜 👷. 👶

View File

@@ -0,0 +1,300 @@
# 🛃 📨 - 🕸, 🎏, 📁, 🎏
🔢, **FastAPI** 🔜 📨 📨 ⚙️ `JSONResponse`.
👆 💪 🔐 ⚫️ 🛬 `Response` 🔗 👀 [📨 📨 🔗](response-directly.md){.internal-link target=_blank}.
✋️ 🚥 👆 📨 `Response` 🔗, 📊 🏆 🚫 🔁 🗜, &amp; 🧾 🏆 🚫 🔁 🏗 (🖼, 🔌 🎯 "📻 🆎", 🇺🇸🔍 🎚 `Content-Type` 🍕 🏗 🗄).
✋️ 👆 💪 📣 `Response` 👈 👆 💚 ⚙️, *➡ 🛠️ 👨‍🎨*.
🎚 👈 👆 📨 ⚪️➡️ 👆 *➡ 🛠️ 🔢* 🔜 🚮 🔘 👈 `Response`.
&amp; 🚥 👈 `Response` ✔️ 🎻 📻 🆎 (`application/json`), 💖 💼 ⏮️ `JSONResponse` &amp; `UJSONResponse`, 💽 👆 📨 🔜 🔁 🗜 (&amp; ⛽) ⏮️ 🙆 Pydantic `response_model` 👈 👆 📣 *➡ 🛠️ 👨‍🎨*.
!!! note
🚥 👆 ⚙️ 📨 🎓 ⏮️ 🙅‍♂ 📻 🆎, FastAPI 🔜 ⌛ 👆 📨 ✔️ 🙅‍♂ 🎚, ⚫️ 🔜 🚫 📄 📨 📁 🚮 🏗 🗄 🩺.
## ⚙️ `ORJSONResponse`
🖼, 🚥 👆 ✊ 🎭, 👆 💪 ❎ &amp; ⚙️ <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a> &amp; ⚒ 📨 `ORJSONResponse`.
🗄 `Response` 🎓 (🎧-🎓) 👆 💚 ⚙️ &amp; 📣 ⚫️ *➡ 🛠️ 👨‍🎨*.
⭕ 📨, 📨 `Response` 🔗 🌅 ⏩ 🌘 🛬 📖.
👉 ↩️ 🔢, FastAPI 🔜 ✔ 🔠 🏬 🔘 &amp; ⚒ 💭 ⚫️ 🎻 ⏮️ 🎻, ⚙️ 🎏 [🎻 🔗 🔢](../tutorial/encoder.md){.internal-link target=_blank} 🔬 🔰. 👉 ⚫️❔ ✔ 👆 📨 **❌ 🎚**, 🖼 💽 🏷.
✋️ 🚥 👆 🎯 👈 🎚 👈 👆 🛬 **🎻 ⏮️ 🎻**, 👆 💪 🚶‍♀️ ⚫️ 🔗 📨 🎓 &amp; ❎ 🌥 👈 FastAPI 🔜 ✔️ 🚶‍♀️ 👆 📨 🎚 🔘 `jsonable_encoder` ⏭ 🚶‍♀️ ⚫️ 📨 🎓.
```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial001b.py!}
```
!!! info
🔢 `response_class` 🔜 ⚙️ 🔬 "📻 🆎" 📨.
👉 💼, 🇺🇸🔍 🎚 `Content-Type` 🔜 ⚒ `application/json`.
&amp; ⚫️ 🔜 📄 ✅ 🗄.
!!! tip
`ORJSONResponse` ⏳ 🕴 💪 FastAPI, 🚫 💃.
## 🕸 📨
📨 📨 ⏮️ 🕸 🔗 ⚪️➡️ **FastAPI**, ⚙️ `HTMLResponse`.
* 🗄 `HTMLResponse`.
* 🚶‍♀️ `HTMLResponse` 🔢 `response_class` 👆 *➡ 🛠️ 👨‍🎨*.
```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial002.py!}
```
!!! info
🔢 `response_class` 🔜 ⚙️ 🔬 "📻 🆎" 📨.
👉 💼, 🇺🇸🔍 🎚 `Content-Type` 🔜 ⚒ `text/html`.
&amp; ⚫️ 🔜 📄 ✅ 🗄.
### 📨 `Response`
👀 [📨 📨 🔗](response-directly.md){.internal-link target=_blank}, 👆 💪 🔐 📨 🔗 👆 *➡ 🛠️*, 🛬 ⚫️.
🎏 🖼 ⚪️➡️ 🔛, 🛬 `HTMLResponse`, 💪 👀 💖:
```Python hl_lines="2 7 19"
{!../../../docs_src/custom_response/tutorial003.py!}
```
!!! warning
`Response` 📨 🔗 👆 *➡ 🛠️ 🔢* 🏆 🚫 📄 🗄 (🖼, `Content-Type` 🏆 🚫 📄) &amp; 🏆 🚫 ⭐ 🏧 🎓 🩺.
!!! info
↗️, ☑ `Content-Type` 🎚, 👔 📟, ♒️, 🔜 👟 ⚪️➡️ `Response` 🎚 👆 📨.
### 📄 🗄 &amp; 🔐 `Response`
🚥 👆 💚 🔐 📨 ⚪️➡️ 🔘 🔢 ✋️ 🎏 🕰 📄 "📻 🆎" 🗄, 👆 💪 ⚙️ `response_class` 🔢 &amp; 📨 `Response` 🎚.
`response_class` 🔜 ⤴️ ⚙️ 🕴 📄 🗄 *➡ 🛠️*, ✋️ 👆 `Response` 🔜 ⚙️.
#### 📨 `HTMLResponse` 🔗
🖼, ⚫️ 💪 🕳 💖:
```Python hl_lines="7 21 23"
{!../../../docs_src/custom_response/tutorial004.py!}
```
👉 🖼, 🔢 `generate_html_response()` ⏪ 🏗 &amp; 📨 `Response` ↩️ 🛬 🕸 `str`.
🛬 🏁 🤙 `generate_html_response()`, 👆 ⏪ 🛬 `Response` 👈 🔜 🔐 🔢 **FastAPI** 🎭.
✋️ 👆 🚶‍♀️ `HTMLResponse` `response_class` 💁‍♂️, **FastAPI** 🔜 💭 ❔ 📄 ⚫️ 🗄 &amp; 🎓 🩺 🕸 ⏮️ `text/html`:
<img src="/img/tutorial/custom-response/image01.png">
## 💪 📨
📥 💪 📨.
✔️ 🤯 👈 👆 💪 ⚙️ `Response` 📨 🕳 🙆, ⚖️ ✍ 🛃 🎧-🎓.
!!! note "📡 "
👆 💪 ⚙️ `from starlette.responses import HTMLResponse`.
**FastAPI** 🚚 🎏 `starlette.responses` `fastapi.responses` 🏪 👆, 👩‍💻. ✋️ 🌅 💪 📨 👟 🔗 ⚪️➡️ 💃.
### `Response`
👑 `Response` 🎓, 🌐 🎏 📨 😖 ⚪️➡️ ⚫️.
👆 💪 📨 ⚫️ 🔗.
⚫️ 🚫 📄 🔢:
* `content` - `str` ⚖️ `bytes`.
* `status_code` - `int` 🇺🇸🔍 👔 📟.
* `headers` - `dict` 🎻.
* `media_type` - `str` 🤝 📻 🆎. 🤶 Ⓜ. `"text/html"`.
FastAPI (🤙 💃) 🔜 🔁 🔌 🎚-📐 🎚. ⚫️ 🔜 🔌 🎚-🆎 🎚, ⚓️ 🔛 = &amp; 🔁 = ✍ 🆎.
```Python hl_lines="1 18"
{!../../../docs_src/response_directly/tutorial002.py!}
```
### `HTMLResponse`
✊ ✍ ⚖️ 🔢 &amp; 📨 🕸 📨, 👆 ✍ 🔛.
### `PlainTextResponse`
✊ ✍ ⚖️ 🔢 &amp; 📨 ✅ ✍ 📨.
```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial005.py!}
```
### `JSONResponse`
✊ 💽 &amp; 📨 `application/json` 🗜 📨.
👉 🔢 📨 ⚙️ **FastAPI**, 👆 ✍ 🔛.
### `ORJSONResponse`
⏩ 🎛 🎻 📨 ⚙️ <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a>, 👆 ✍ 🔛.
### `UJSONResponse`
🎛 🎻 📨 ⚙️ <a href="https://github.com/ultrajson/ultrajson" class="external-link" target="_blank">`ujson`</a>.
!!! warning
`ujson` 🌘 💛 🌘 🐍 🏗-🛠️ ❔ ⚫️ 🍵 📐-💼.
```Python hl_lines="2 7"
{!../../../docs_src/custom_response/tutorial001.py!}
```
!!! tip
⚫️ 💪 👈 `ORJSONResponse` 💪 ⏩ 🎛.
### `RedirectResponse`
📨 🇺🇸🔍 ❎. ⚙️ 3⃣0⃣7⃣ 👔 📟 (🍕 ❎) 🔢.
👆 💪 📨 `RedirectResponse` 🔗:
```Python hl_lines="2 9"
{!../../../docs_src/custom_response/tutorial006.py!}
```
---
⚖️ 👆 💪 ⚙️ ⚫️ `response_class` 🔢:
```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial006b.py!}
```
🚥 👆 👈, ⤴️ 👆 💪 📨 📛 🔗 ⚪️➡️ 👆 *➡ 🛠️* 🔢.
👉 💼, `status_code` ⚙️ 🔜 🔢 1⃣ `RedirectResponse`, ❔ `307`.
---
👆 💪 ⚙️ `status_code` 🔢 🌀 ⏮️ `response_class` 🔢:
```Python hl_lines="2 7 9"
{!../../../docs_src/custom_response/tutorial006c.py!}
```
### `StreamingResponse`
✊ 🔁 🚂 ⚖️ 😐 🚂/🎻 &amp; 🎏 📨 💪.
```Python hl_lines="2 14"
{!../../../docs_src/custom_response/tutorial007.py!}
```
#### ⚙️ `StreamingResponse` ⏮️ 📁-💖 🎚
🚥 👆 ✔️ 📁-💖 🎚 (✅ 🎚 📨 `open()`), 👆 💪 ✍ 🚂 🔢 🔁 🤭 👈 📁-💖 🎚.
👈 🌌, 👆 🚫 ✔️ ✍ ⚫️ 🌐 🥇 💾, &amp; 👆 💪 🚶‍♀️ 👈 🚂 🔢 `StreamingResponse`, &amp; 📨 ⚫️.
👉 🔌 📚 🗃 🔗 ⏮️ ☁ 💾, 📹 🏭, &amp; 🎏.
```{ .python .annotate hl_lines="2 10-12 14" }
{!../../../docs_src/custom_response/tutorial008.py!}
```
1⃣. 👉 🚂 🔢. ⚫️ "🚂 🔢" ↩️ ⚫️ 🔌 `yield` 📄 🔘.
2⃣. ⚙️ `with` 🍫, 👥 ⚒ 💭 👈 📁-💖 🎚 📪 ⏮️ 🚂 🔢 🔨. , ⏮️ ⚫️ 🏁 📨 📨.
3⃣. 👉 `yield from` 💬 🔢 🔁 🤭 👈 👜 🌟 `file_like`. &amp; ⤴️, 🔠 🍕 🔁, 🌾 👈 🍕 👟 ⚪️➡️ 👉 🚂 🔢.
, ⚫️ 🚂 🔢 👈 📨 "🏭" 👷 🕳 🙆 🔘.
🔨 ⚫️ 👉 🌌, 👥 💪 🚮 ⚫️ `with` 🍫, &amp; 👈 🌌, 🚚 👈 ⚫️ 📪 ⏮️ 🏁.
!!! tip
👀 👈 📥 👥 ⚙️ 🐩 `open()` 👈 🚫 🐕‍🦺 `async` &amp; `await`, 👥 📣 ➡ 🛠️ ⏮️ 😐 `def`.
### `FileResponse`
🔁 🎏 📁 📨.
✊ 🎏 ⚒ ❌ 🔗 🌘 🎏 📨 🆎:
* `path` - 📁 📁 🎏.
* `headers` - 🙆 🛃 🎚 🔌, 📖.
* `media_type` - 🎻 🤝 📻 🆎. 🚥 🔢, 📁 ⚖️ ➡ 🔜 ⚙️ 🔑 📻 🆎.
* `filename` - 🚥 ⚒, 👉 🔜 🔌 📨 `Content-Disposition`.
📁 📨 🔜 🔌 ☑ `Content-Length`, `Last-Modified` &amp; `ETag` 🎚.
```Python hl_lines="2 10"
{!../../../docs_src/custom_response/tutorial009.py!}
```
👆 💪 ⚙️ `response_class` 🔢:
```Python hl_lines="2 8 10"
{!../../../docs_src/custom_response/tutorial009b.py!}
```
👉 💼, 👆 💪 📨 📁 ➡ 🔗 ⚪️➡️ 👆 *➡ 🛠️* 🔢.
## 🛃 📨 🎓
👆 💪 ✍ 👆 👍 🛃 📨 🎓, 😖 ⚪️➡️ `Response` &amp; ⚙️ ⚫️.
🖼, ➡️ 💬 👈 👆 💚 ⚙️ <a href="https://github.com/ijl/orjson" class="external-link" target="_blank">`orjson`</a>, ✋️ ⏮️ 🛃 ⚒ 🚫 ⚙️ 🔌 `ORJSONResponse` 🎓.
➡️ 💬 👆 💚 ⚫️ 📨 🔂 &amp; 📁 🎻, 👆 💚 ⚙️ Orjson 🎛 `orjson.OPT_INDENT_2`.
👆 💪 ✍ `CustomORJSONResponse`. 👑 👜 👆 ✔️ ✍ `Response.render(content)` 👩‍🔬 👈 📨 🎚 `bytes`:
```Python hl_lines="9-14 17"
{!../../../docs_src/custom_response/tutorial009c.py!}
```
🔜 ↩️ 🛬:
```json
{"message": "Hello World"}
```
...👉 📨 🔜 📨:
```json
{
"message": "Hello World"
}
```
↗️, 👆 🔜 🎲 🔎 🌅 👍 🌌 ✊ 📈 👉 🌘 ❕ 🎻. 👶
## 🔢 📨 🎓
🕐❔ 🏗 **FastAPI** 🎓 👐 ⚖️ `APIRouter` 👆 💪 ✔ ❔ 📨 🎓 ⚙️ 🔢.
🔢 👈 🔬 👉 `default_response_class`.
🖼 🔛, **FastAPI** 🔜 ⚙️ `ORJSONResponse` 🔢, 🌐 *➡ 🛠️*, ↩️ `JSONResponse`.
```Python hl_lines="2 4"
{!../../../docs_src/custom_response/tutorial010.py!}
```
!!! tip
👆 💪 🔐 `response_class` *➡ 🛠️* ⏭.
## 🌖 🧾
👆 💪 📣 📻 🆎 &amp; 📚 🎏 🗄 ⚙️ `responses`: [🌖 📨 🗄](additional-responses.md){.internal-link target=_blank}.

View File

@@ -0,0 +1,98 @@
# ⚙️ 🎻
FastAPI 🏗 🔛 🔝 **Pydantic**, &amp; 👤 ✔️ 🌏 👆 ❔ ⚙️ Pydantic 🏷 📣 📨 &amp; 📨.
✋️ FastAPI 🐕‍🦺 ⚙️ <a href="https://docs.python.org/3/library/dataclasses.html" class="external-link" target="_blank">`dataclasses`</a> 🎏 🌌:
```Python hl_lines="1 7-12 19-20"
{!../../../docs_src/dataclasses/tutorial001.py!}
```
👉 🐕‍🦺 👏 **Pydantic**, ⚫️ ✔️ <a href="https://pydantic-docs.helpmanual.io/usage/dataclasses/#use-of-stdlib-dataclasses-with-basemodel" class="external-link" target="_blank">🔗 🐕‍🦺 `dataclasses`</a>.
, ⏮️ 📟 🔛 👈 🚫 ⚙️ Pydantic 🎯, FastAPI ⚙️ Pydantic 🗜 📚 🐩 🎻 Pydantic 👍 🍛 🎻.
&amp; ↗️, ⚫️ 🐕‍🦺 🎏:
* 💽 🔬
* 💽 🛠️
* 💽 🧾, ♒️.
👉 👷 🎏 🌌 ⏮️ Pydantic 🏷. &amp; ⚫️ 🤙 🏆 🎏 🌌 🔘, ⚙️ Pydantic.
!!! info
✔️ 🤯 👈 🎻 💪 🚫 🌐 Pydantic 🏷 💪.
, 👆 5⃣📆 💪 ⚙️ Pydantic 🏷.
✋️ 🚥 👆 ✔️ 📚 🎻 🤥 🤭, 👉 👌 🎱 ⚙️ 👫 🏋️ 🕸 🛠️ ⚙️ FastAPI. 👶
## 🎻 `response_model`
👆 💪 ⚙️ `dataclasses` `response_model` 🔢:
```Python hl_lines="1 7-13 19"
{!../../../docs_src/dataclasses/tutorial002.py!}
```
🎻 🔜 🔁 🗜 Pydantic 🎻.
👉 🌌, 🚮 🔗 🔜 🎦 🆙 🛠️ 🩺 👩‍💻 🔢:
<img src="/img/tutorial/dataclasses/image01.png">
## 🎻 🔁 📊 📊
👆 💪 🌀 `dataclasses` ⏮️ 🎏 🆎 ✍ ⚒ 🐦 📊 📊.
💼, 👆 💪 ✔️ ⚙️ Pydantic ⏬ `dataclasses`. 🖼, 🚥 👆 ✔️ ❌ ⏮️ 🔁 🏗 🛠️ 🧾.
👈 💼, 👆 💪 🎯 💱 🐩 `dataclasses` ⏮️ `pydantic.dataclasses`, ❔ 💧-♻:
```{ .python .annotate hl_lines="1 5 8-11 14-17 23-25 28" }
{!../../../docs_src/dataclasses/tutorial003.py!}
```
1⃣. 👥 🗄 `field` ⚪️➡️ 🐩 `dataclasses`.
2⃣. `pydantic.dataclasses` 💧-♻ `dataclasses`.
3⃣. `Author` 🎻 🔌 📇 `Item` 🎻.
4⃣. `Author` 🎻 ⚙️ `response_model` 🔢.
5⃣. 👆 💪 ⚙️ 🎏 🐩 🆎 ✍ ⏮️ 🎻 📨 💪.
👉 💼, ⚫️ 📇 `Item` 🎻.
6⃣. 📥 👥 🛬 📖 👈 🔌 `items` ❔ 📇 🎻.
FastAPI 🎯 <abbr title="converting the data to a format that can be transmitted">✍</abbr> 💽 🎻.
7⃣. 📥 `response_model` ⚙️ 🆎 ✍ 📇 `Author` 🎻.
🔄, 👆 💪 🌀 `dataclasses` ⏮️ 🐩 🆎 ✍.
8⃣. 👀 👈 👉 *➡ 🛠️ 🔢* ⚙️ 🥔 `def` ↩️ `async def`.
🕧, FastAPI 👆 💪 🌀 `def` &amp; `async def` 💪.
🚥 👆 💪 ↗️ 🔃 🕐❔ ⚙️ ❔, ✅ 👅 📄 _"🏃 ❓" _ 🩺 🔃 <a href="https://fastapi.tiangolo.com/async/#in-a-hurry" target="_blank" class="internal-link">`async` &amp; `await`</a>.
9⃣. 👉 *➡ 🛠️ 🔢* 🚫 🛬 🎻 (👐 ⚫️ 💪), ✋️ 📇 📖 ⏮️ 🔗 💽.
FastAPI 🔜 ⚙️ `response_model` 🔢 (👈 🔌 🎻) 🗜 📨.
👆 💪 🌀 `dataclasses` ⏮️ 🎏 🆎 ✍ 📚 🎏 🌀 📨 🏗 📊 📊.
✅-📟 ✍ 💁‍♂ 🔛 👀 🌅 🎯 .
## 💡 🌅
👆 💪 🌀 `dataclasses` ⏮️ 🎏 Pydantic 🏷, 😖 ⚪️➡️ 👫, 🔌 👫 👆 👍 🏷, ♒️.
💡 🌅, ✅ <a href="https://pydantic-docs.helpmanual.io/usage/dataclasses/" class="external-link" target="_blank">Pydantic 🩺 🔃 🎻</a>.
## ⏬
👉 💪 ↩️ FastAPI ⏬ `0.67.0`. 👶

View File

@@ -0,0 +1,160 @@
# 🔆 🎉
👆 💪 🔬 ⚛ (📟) 👈 🔜 🛠️ ⏭ 🈸 **▶️ 🆙**. 👉 ⛓ 👈 👉 📟 🔜 🛠️ **🕐**, **⏭** 🈸 **▶️ 📨 📨**.
🎏 🌌, 👆 💪 🔬 ⚛ (📟) 👈 🔜 🛠️ 🕐❔ 🈸 **🤫 🔽**. 👉 💼, 👉 📟 🔜 🛠️ **🕐**, **⏮️** ✔️ 🍵 🎲 **📚 📨**.
↩️ 👉 📟 🛠️ ⏭ 🈸 **▶️** ✊ 📨, &amp; ▶️️ ⏮️ ⚫️ **🏁** 🚚 📨, ⚫️ 📔 🎂 🈸 **🔆** (🔤 "🔆" 🔜 ⚠ 🥈 👶).
👉 💪 📶 ⚠ ⚒ 🆙 **** 👈 👆 💪 ⚙️ 🎂 📱, &amp; 👈 **💰** 👪 📨, &amp;/⚖️ 👈 👆 💪 **🧹 🆙** ⏮️. 🖼, 💽 🔗 🎱, ⚖️ 🚚 🔗 🎰 🏫 🏷.
## ⚙️ 💼
➡️ ▶️ ⏮️ 🖼 **⚙️ 💼** &amp; ⤴️ 👀 ❔ ❎ ⚫️ ⏮️ 👉.
➡️ 🌈 👈 👆 ✔️ **🎰 🏫 🏷** 👈 👆 💚 ⚙️ 🍵 📨. 👶
🎏 🏷 🔗 👪 📨,, ⚫️ 🚫 1⃣ 🏷 📍 📨, ⚖️ 1⃣ 📍 👩‍💻 ⚖️ 🕳 🎏.
➡️ 🌈 👈 🚚 🏷 💪 **✊ 🕰**, ↩️ ⚫️ ✔️ ✍ 📚 **💽 ⚪️➡️ 💾**. 👆 🚫 💚 ⚫️ 🔠 📨.
👆 💪 📐 ⚫️ 🔝 🎚 🕹/📁, ✋️ 👈 🔜 ⛓ 👈 ⚫️ 🔜 **📐 🏷** 🚥 👆 🏃‍♂ 🙅 🏧 💯, ⤴️ 👈 💯 🔜 **🐌** ↩️ ⚫️ 🔜 ✔️ ⌛ 🏷 📐 ⏭ 💆‍♂ 💪 🏃 🔬 🍕 📟.
👈 ⚫️❔ 👥 🔜 ❎, ➡️ 📐 🏷 ⏭ 📨 🍵, ✋️ 🕴 ▶️️ ⏭ 🈸 ▶️ 📨 📨, 🚫 ⏪ 📟 📐.
## 🔆
👆 💪 🔬 👉 *🕴* &amp; *🤫* ⚛ ⚙️ `lifespan` 🔢 `FastAPI` 📱, &amp; "🔑 👨‍💼" (👤 🔜 🎦 👆 ⚫️❔ 👈 🥈).
➡️ ▶️ ⏮️ 🖼 &amp; ⤴️ 👀 ⚫️ .
👥 ✍ 🔁 🔢 `lifespan()` ⏮️ `yield` 💖 👉:
```Python hl_lines="16 19"
{!../../../docs_src/events/tutorial003.py!}
```
📥 👥 ⚖ 😥 *🕴* 🛠️ 🚚 🏷 🚮 (❌) 🏷 🔢 📖 ⏮️ 🎰 🏫 🏷 ⏭ `yield`. 👉 📟 🔜 🛠️ **⏭** 🈸 **▶️ ✊ 📨**, ⏮️ *🕴*.
&amp; ⤴️, ▶️️ ⏮️ `yield`, 👥 🚚 🏷. 👉 📟 🔜 🛠️ **⏮️** 🈸 **🏁 🚚 📨**, ▶️️ ⏭ *🤫*. 👉 💪, 🖼, 🚀 💖 💾 ⚖️ 💻.
!!! tip
`shutdown` 🔜 🔨 🕐❔ 👆 **⛔️** 🈸.
🎲 👆 💪 ▶️ 🆕 ⏬, ⚖️ 👆 🤚 🎡 🏃 ⚫️. 🤷
### 🔆 🔢
🥇 👜 👀, 👈 👥 ⚖ 🔁 🔢 ⏮️ `yield`. 👉 📶 🎏 🔗 ⏮️ `yield`.
```Python hl_lines="14-19"
{!../../../docs_src/events/tutorial003.py!}
```
🥇 🍕 🔢, ⏭ `yield`, 🔜 🛠️ **⏭** 🈸 ▶️.
&amp; 🍕 ⏮️ `yield` 🔜 🛠️ **⏮️** 🈸 ✔️ 🏁.
### 🔁 🔑 👨‍💼
🚥 👆 ✅, 🔢 🎀 ⏮️ `@asynccontextmanager`.
👈 🗜 🔢 🔘 🕳 🤙 "**🔁 🔑 👨‍💼**".
```Python hl_lines="1 13"
{!../../../docs_src/events/tutorial003.py!}
```
**🔑 👨‍💼** 🐍 🕳 👈 👆 💪 ⚙️ `with` 📄, 🖼, `open()` 💪 ⚙️ 🔑 👨‍💼:
```Python
with open("file.txt") as file:
file.read()
```
⏮️ ⏬ 🐍, 📤 **🔁 🔑 👨‍💼**. 👆 🔜 ⚙️ ⚫️ ⏮️ `async with`:
```Python
async with lifespan(app):
await do_stuff()
```
🕐❔ 👆 ✍ 🔑 👨‍💼 ⚖️ 🔁 🔑 👨‍💼 💖 🔛, ⚫️❔ ⚫️ 🔨 👈, ⏭ 🛬 `with` 🍫, ⚫️ 🔜 🛠️ 📟 ⏭ `yield`, &amp; ⏮️ ❎ `with` 🍫, ⚫️ 🔜 🛠️ 📟 ⏮️ `yield`.
👆 📟 🖼 🔛, 👥 🚫 ⚙️ ⚫️ 🔗, ✋️ 👥 🚶‍♀️ ⚫️ FastAPI ⚫️ ⚙️ ⚫️.
`lifespan` 🔢 `FastAPI` 📱 ✊ **🔁 🔑 👨‍💼**, 👥 💪 🚶‍♀️ 👆 🆕 `lifespan` 🔁 🔑 👨‍💼 ⚫️.
```Python hl_lines="22"
{!../../../docs_src/events/tutorial003.py!}
```
## 🎛 🎉 (😢)
!!! warning
👍 🌌 🍵 *🕴* &amp; *🤫* ⚙️ `lifespan` 🔢 `FastAPI` 📱 🔬 🔛.
👆 💪 🎲 🚶 👉 🍕.
📤 🎛 🌌 🔬 👉 ⚛ 🛠️ ⏮️ *🕴* &amp; ⏮️ *🤫*.
👆 💪 🔬 🎉 🐕‍🦺 (🔢) 👈 💪 🛠️ ⏭ 🈸 ▶️ 🆙, ⚖️ 🕐❔ 🈸 🤫 🔽.
👫 🔢 💪 📣 ⏮️ `async def` ⚖️ 😐 `def`.
### `startup` 🎉
🚮 🔢 👈 🔜 🏃 ⏭ 🈸 ▶️, 📣 ⚫️ ⏮️ 🎉 `"startup"`:
```Python hl_lines="8"
{!../../../docs_src/events/tutorial001.py!}
```
👉 💼, `startup` 🎉 🐕‍🦺 🔢 🔜 🔢 🏬 "💽" ( `dict`) ⏮️ 💲.
👆 💪 🚮 🌅 🌘 1⃣ 🎉 🐕‍🦺 🔢.
&amp; 👆 🈸 🏆 🚫 ▶️ 📨 📨 ⏭ 🌐 `startup` 🎉 🐕‍🦺 ✔️ 🏁.
### `shutdown` 🎉
🚮 🔢 👈 🔜 🏃 🕐❔ 🈸 🤫 🔽, 📣 ⚫️ ⏮️ 🎉 `"shutdown"`:
```Python hl_lines="6"
{!../../../docs_src/events/tutorial002.py!}
```
📥, `shutdown` 🎉 🐕‍🦺 🔢 🔜 ✍ ✍ ⏸ `"Application shutdown"` 📁 `log.txt`.
!!! info
`open()` 🔢, `mode="a"` ⛓ "🎻",, ⏸ 🔜 🚮 ⏮️ ⚫️❔ 🔛 👈 📁, 🍵 📁 ⏮️ 🎚.
!!! tip
👀 👈 👉 💼 👥 ⚙️ 🐩 🐍 `open()` 🔢 👈 🔗 ⏮️ 📁.
, ⚫️ 🔌 👤/🅾 (🔢/🔢), 👈 🚚 "⌛" 👜 ✍ 💾.
✋️ `open()` 🚫 ⚙️ `async` &amp; `await`.
, 👥 📣 🎉 🐕‍🦺 🔢 ⏮️ 🐩 `def` ↩️ `async def`.
!!! info
👆 💪 ✍ 🌅 🔃 👫 🎉 🐕‍🦺 <a href="https://www.starlette.io/events/" class="external-link" target="_blank">💃 🎉' 🩺</a>.
### `startup` &amp; `shutdown` 👯‍♂️
📤 ↕ 🤞 👈 ⚛ 👆 *🕴* &amp; *🤫* 🔗, 👆 💪 💚 ▶️ 🕳 &amp; ⤴️ 🏁 ⚫️, 📎 &amp; ⤴️ 🚀 ⚫️, ♒️.
🔨 👈 👽 🔢 👈 🚫 💰 ⚛ ⚖️ 🔢 👯‍♂️ 🌅 ⚠ 👆 🔜 💪 🏪 💲 🌐 🔢 ⚖️ 🎏 🎱.
↩️ 👈, ⚫️ 🔜 👍 ↩️ ⚙️ `lifespan` 🔬 🔛.
## 📡
📡 😟 🤓. 👶
🔘, 🔫 📡 🔧, 👉 🍕 <a href="https://asgi.readthedocs.io/en/latest/specs/lifespan.html" class="external-link" target="_blank">🔆 🛠️</a>, &amp; ⚫️ 🔬 🎉 🤙 `startup` &amp; `shutdown`.
## 🎧 🈸
👶 ✔️ 🤯 👈 👫 🔆 🎉 (🕴 &amp; 🤫) 🔜 🕴 🛠️ 👑 🈸, 🚫 [🎧 🈸 - 🗻](./sub-applications.md){.internal-link target=_blank}.

View File

@@ -0,0 +1,267 @@
# 🏗 👩‍💻
**FastAPI** ⚓️ 🔛 🗄 🔧, 👆 🤚 🏧 🔗 ⏮️ 📚 🧰, 🔌 🏧 🛠️ 🩺 (🚚 🦁 🎚).
1⃣ 🎯 📈 👈 🚫 🎯 ⭐ 👈 👆 💪 **🏗 👩‍💻** (🕣 🤙 <abbr title="Software Development Kits">**📱**</abbr> ) 👆 🛠️, 📚 🎏 **🛠️ 🇪🇸**.
## 🗄 👩‍💻 🚂
📤 📚 🧰 🏗 👩‍💻 ⚪️➡️ **🗄**.
⚠ 🧰 <a href="https://openapi-generator.tech/" class="external-link" target="_blank">🗄 🚂</a>.
🚥 👆 🏗 **🕸**, 📶 😌 🎛 <a href="https://github.com/ferdikoomen/openapi-typescript-codegen" class="external-link" target="_blank">🗄-📕-🇦🇪</a>.
## 🏗 📕 🕸 👩‍💻
➡️ ▶️ ⏮️ 🙅 FastAPI 🈸:
=== "🐍 3⃣.6️⃣ &amp; 🔛"
```Python hl_lines="9-11 14-15 18 19 23"
{!> ../../../docs_src/generate_clients/tutorial001.py!}
```
=== "🐍 3⃣.9️⃣ &amp; 🔛"
```Python hl_lines="7-9 12-13 16-17 21"
{!> ../../../docs_src/generate_clients/tutorial001_py39.py!}
```
👀 👈 *➡ 🛠️* 🔬 🏷 👫 ⚙️ 📨 🚀 &amp; 📨 🚀, ⚙️ 🏷 `Item` &amp; `ResponseMessage`.
### 🛠️ 🩺
🚥 👆 🚶 🛠️ 🩺, 👆 🔜 👀 👈 ⚫️ ✔️ **🔗** 📊 📨 📨 &amp; 📨 📨:
<img src="/img/tutorial/generate-clients/image01.png">
👆 💪 👀 👈 🔗 ↩️ 👫 📣 ⏮️ 🏷 📱.
👈 💪 📱 **🗄 🔗**, &amp; ⤴️ 🎦 🛠️ 🩺 (🦁 🎚).
&amp; 👈 🎏 ⚪️➡️ 🏷 👈 🔌 🗄 ⚫️❔ 💪 ⚙️ **🏗 👩‍💻 📟**.
### 🏗 📕 👩‍💻
🔜 👈 👥 ✔️ 📱 ⏮️ 🏷, 👥 💪 🏗 👩‍💻 📟 🕸.
#### ❎ `openapi-typescript-codegen`
👆 💪 ❎ `openapi-typescript-codegen` 👆 🕸 📟 ⏮️:
<div class="termy">
```console
$ npm install openapi-typescript-codegen --save-dev
---> 100%
```
</div>
#### 🏗 👩‍💻 📟
🏗 👩‍💻 📟 👆 💪 ⚙️ 📋 ⏸ 🈸 `openapi` 👈 🔜 🔜 ❎.
↩️ ⚫️ ❎ 🇧🇿 🏗, 👆 🎲 🚫🔜 💪 🤙 👈 📋 🔗, ✋️ 👆 🔜 🚮 ⚫️ 🔛 👆 `package.json` 📁.
⚫️ 💪 👀 💖 👉:
```JSON hl_lines="7"
{
"name": "frontend-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"generate-client": "openapi --input http://localhost:8000/openapi.json --output ./src/client --client axios"
},
"author": "",
"license": "",
"devDependencies": {
"openapi-typescript-codegen": "^0.20.1",
"typescript": "^4.6.2"
}
}
```
⏮️ ✔️ 👈 ☕ `generate-client` ✍ 📤, 👆 💪 🏃 ⚫️ ⏮️:
<div class="termy">
```console
$ npm run generate-client
frontend-app@1.0.0 generate-client /home/user/code/frontend-app
> openapi --input http://localhost:8000/openapi.json --output ./src/client --client axios
```
</div>
👈 📋 🔜 🏗 📟 `./src/client` &amp; 🔜 ⚙️ `axios` (🕸 🇺🇸🔍 🗃) 🔘.
### 🔄 👅 👩‍💻 📟
🔜 👆 💪 🗄 &amp; ⚙️ 👩‍💻 📟, ⚫️ 💪 👀 💖 👉, 👀 👈 👆 🤚 ✍ 👩‍🔬:
<img src="/img/tutorial/generate-clients/image02.png">
👆 🔜 🤚 ✍ 🚀 📨:
<img src="/img/tutorial/generate-clients/image03.png">
!!! tip
👀 ✍ `name` &amp; `price`, 👈 🔬 FastAPI 🈸, `Item` 🏷.
👆 🔜 ✔️ ⏸ ❌ 📊 👈 👆 📨:
<img src="/img/tutorial/generate-clients/image04.png">
📨 🎚 🔜 ✔️ ✍:
<img src="/img/tutorial/generate-clients/image05.png">
## FastAPI 📱 ⏮️ 🔖
📚 💼 👆 FastAPI 📱 🔜 🦏, &amp; 👆 🔜 🎲 ⚙️ 🔖 🎏 🎏 👪 *➡ 🛠️*.
🖼, 👆 💪 ✔️ 📄 **🏬** &amp; 1⃣ 📄 **👩‍💻**, &amp; 👫 💪 👽 🔖:
=== "🐍 3⃣.6️⃣ &amp; 🔛"
```Python hl_lines="23 28 36"
{!> ../../../docs_src/generate_clients/tutorial002.py!}
```
=== "🐍 3⃣.9️⃣ &amp; 🔛"
```Python hl_lines="21 26 34"
{!> ../../../docs_src/generate_clients/tutorial002_py39.py!}
```
### 🏗 📕 👩‍💻 ⏮️ 🔖
🚥 👆 🏗 👩‍💻 FastAPI 📱 ⚙️ 🔖, ⚫️ 🔜 🛎 🎏 👩‍💻 📟 ⚓️ 🔛 🔖.
👉 🌌 👆 🔜 💪 ✔️ 👜 ✔ &amp; 👪 ☑ 👩‍💻 📟:
<img src="/img/tutorial/generate-clients/image06.png">
👉 💼 👆 ✔️:
* `ItemsService`
* `UsersService`
### 👩‍💻 👩‍🔬 📛
▶️️ 🔜 🏗 👩‍🔬 📛 💖 `createItemItemsPost` 🚫 👀 📶 🧹:
```TypeScript
ItemsService.createItemItemsPost({name: "Plumbus", price: 5})
```
...👈 ↩️ 👩‍💻 🚂 ⚙️ 🗄 🔗 **🛠️ 🆔** 🔠 *➡ 🛠️*.
🗄 🚚 👈 🔠 🛠️ 🆔 😍 🤭 🌐 *➡ 🛠️*, FastAPI ⚙️ **🔢 📛**, **➡**, &amp; **🇺🇸🔍 👩‍🔬/🛠️** 🏗 👈 🛠️ 🆔, ↩️ 👈 🌌 ⚫️ 💪 ⚒ 💭 👈 🛠️ 🆔 😍.
✋️ 👤 🔜 🎦 👆 ❔ 📉 👈 ⏭. 👶
## 🛃 🛠️ 🆔 &amp; 👍 👩‍🔬 📛
👆 💪 **🔀** 🌌 👫 🛠️ 🆔 **🏗** ⚒ 👫 🙅 &amp; ✔️ **🙅 👩‍🔬 📛** 👩‍💻.
👉 💼 👆 🔜 ✔️ 🚚 👈 🔠 🛠️ 🆔 **😍** 🎏 🌌.
🖼, 👆 💪 ⚒ 💭 👈 🔠 *➡ 🛠️* ✔️ 🔖, &amp; ⤴️ 🏗 🛠️ 🆔 ⚓️ 🔛 **🔖** &amp; *➡ 🛠️* **📛** (🔢 📛).
### 🛃 🏗 😍 🆔 🔢
FastAPI ⚙️ **😍 🆔** 🔠 *➡ 🛠️*, ⚫️ ⚙️ **🛠️ 🆔** &amp; 📛 🙆 💪 🛃 🏷, 📨 ⚖️ 📨.
👆 💪 🛃 👈 🔢. ⚫️ ✊ `APIRoute` &amp; 🔢 🎻.
🖼, 📥 ⚫️ ⚙️ 🥇 🔖 (👆 🔜 🎲 ✔️ 🕴 1⃣ 🔖) &amp; *➡ 🛠️* 📛 (🔢 📛).
👆 💪 ⤴️ 🚶‍♀️ 👈 🛃 🔢 **FastAPI** `generate_unique_id_function` 🔢:
=== "🐍 3⃣.6️⃣ &amp; 🔛"
```Python hl_lines="8-9 12"
{!> ../../../docs_src/generate_clients/tutorial003.py!}
```
=== "🐍 3⃣.9️⃣ &amp; 🔛"
```Python hl_lines="6-7 10"
{!> ../../../docs_src/generate_clients/tutorial003_py39.py!}
```
### 🏗 📕 👩‍💻 ⏮️ 🛃 🛠️ 🆔
🔜 🚥 👆 🏗 👩‍💻 🔄, 👆 🔜 👀 👈 ⚫️ ✔️ 📉 👩‍🔬 📛:
<img src="/img/tutorial/generate-clients/image07.png">
👆 👀, 👩‍🔬 📛 🔜 ✔️ 🔖 &amp; ⤴️ 🔢 📛, 🔜 👫 🚫 🔌 ⚪️➡️ 📛 ➡ &amp; 🇺🇸🔍 🛠️.
### 🗜 🗄 🔧 👩‍💻 🚂
🏗 📟 ✔️ **❎ **.
👥 ⏪ 💭 👈 👉 👩‍🔬 🔗 **🏬** ↩️ 👈 🔤 `ItemsService` (✊ ⚪️➡️ 🔖), ✋️ 👥 ✔️ 📛 🔡 👩‍🔬 📛 💁‍♂️. 👶
👥 🔜 🎲 💚 🚧 ⚫️ 🗄 🏢, 👈 🔜 🚚 👈 🛠️ 🆔 **😍**.
✋️ 🏗 👩‍💻 👥 💪 **🔀** 🗄 🛠️ 🆔 ▶️️ ⏭ 🏭 👩‍💻, ⚒ 👈 👩‍🔬 📛 👌 &amp; **🧹**.
👥 💪 ⏬ 🗄 🎻 📁 `openapi.json` &amp; ⤴️ 👥 💪 **❎ 👈 🔡 🔖** ⏮️ ✍ 💖 👉:
```Python
{!../../../docs_src/generate_clients/tutorial004.py!}
```
⏮️ 👈, 🛠️ 🆔 🔜 📁 ⚪️➡️ 👜 💖 `items-get_items` `get_items`, 👈 🌌 👩‍💻 🚂 💪 🏗 🙅 👩‍🔬 📛.
### 🏗 📕 👩‍💻 ⏮️ 🗜 🗄
🔜 🔚 🏁 📁 `openapi.json`, 👆 🔜 🔀 `package.json` ⚙️ 👈 🇧🇿 📁, 🖼:
```JSON hl_lines="7"
{
"name": "frontend-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"generate-client": "openapi --input ./openapi.json --output ./src/client --client axios"
},
"author": "",
"license": "",
"devDependencies": {
"openapi-typescript-codegen": "^0.20.1",
"typescript": "^4.6.2"
}
}
```
⏮️ 🏭 🆕 👩‍💻, 👆 🔜 🔜 ✔️ **🧹 👩‍🔬 📛**, ⏮️ 🌐 **✍**, **⏸ ❌**, ♒️:
<img src="/img/tutorial/generate-clients/image08.png">
## 💰
🕐❔ ⚙️ 🔁 🏗 👩‍💻 👆 🔜 **✍** :
* 👩‍🔬.
* 📨 🚀 💪, 🔢 🔢, ♒️.
* 📨 🚀.
👆 🔜 ✔️ **⏸ ❌** 🌐.
&amp; 🕐❔ 👆 👩‍💻 📟, &amp; **♻** 🕸, ⚫️ 🔜 ✔️ 🙆 🆕 *➡ 🛠️* 💪 👩‍🔬, 🗝 🕐 ❎, &amp; 🙆 🎏 🔀 🔜 🎨 🔛 🏗 📟. 👶
👉 ⛓ 👈 🚥 🕳 🔀 ⚫️ 🔜 **🎨** 🔛 👩‍💻 📟 🔁. &amp; 🚥 👆 **🏗** 👩‍💻 ⚫️ 🔜 ❌ 👅 🚥 👆 ✔️ 🙆 **🔖** 📊 ⚙️.
, 👆 🔜 **🔍 📚 ❌** 📶 ⏪ 🛠️ 🛵 ↩️ ✔️ ⌛ ❌ 🎦 🆙 👆 🏁 👩‍💻 🏭 &amp; ⤴️ 🔄 🌐❔ ⚠. 👶

View File

@@ -0,0 +1,24 @@
# 🏧 👩‍💻 🦮
## 🌖 ⚒
👑 [🔰 - 👩‍💻 🦮](../tutorial/){.internal-link target=_blank} 🔜 🥃 🤝 👆 🎫 🔘 🌐 👑 ⚒ **FastAPI**.
⏭ 📄 👆 🔜 👀 🎏 🎛, 📳, &amp; 🌖 ⚒.
!!! tip
⏭ 📄 **🚫 🎯 "🏧"**.
&amp; ⚫️ 💪 👈 👆 ⚙️ 💼, ⚗ 1⃣ 👫.
## ✍ 🔰 🥇
👆 💪 ⚙️ 🏆 ⚒ **FastAPI** ⏮️ 💡 ⚪️➡️ 👑 [🔰 - 👩‍💻 🦮](../tutorial/){.internal-link target=_blank}.
&amp; ⏭ 📄 🤔 👆 ⏪ ✍ ⚫️, &amp; 🤔 👈 👆 💭 👈 👑 💭.
## 🏎.🅾 ↗️
🚥 👆 🔜 💖 ✊ 🏧-🔰 ↗️ 🔗 👉 📄 🩺, 👆 💪 💚 ✅: <a href="https://testdriven.io/courses/tdd-fastapi/" class="external-link" target="_blank">💯-💾 🛠️ ⏮️ FastAPI &amp; ☁</a> **🏎.🅾**.
👫 ⏳ 🩸 1⃣0⃣ 💯 🌐 💰 🛠️ **FastAPI**. 👶 👶

View File

@@ -0,0 +1,99 @@
# 🏧 🛠️
👑 🔰 👆 ✍ ❔ 🚮 [🛃 🛠️](../tutorial/middleware.md){.internal-link target=_blank} 👆 🈸.
&amp; ⤴️ 👆 ✍ ❔ 🍵 [⚜ ⏮️ `CORSMiddleware`](../tutorial/cors.md){.internal-link target=_blank}.
👉 📄 👥 🔜 👀 ❔ ⚙️ 🎏 🛠️.
## ❎ 🔫 🛠️
**FastAPI** ⚓️ 🔛 💃 &amp; 🛠️ <abbr title="Asynchronous Server Gateway Interface">🔫</abbr> 🔧, 👆 💪 ⚙️ 🙆 🔫 🛠️.
🛠️ 🚫 ✔️ ⚒ FastAPI ⚖️ 💃 👷, 📏 ⚫️ ⏩ 🔫 🔌.
🏢, 🔫 🛠️ 🎓 👈 ⌛ 📨 🔫 📱 🥇 ❌.
, 🧾 🥉-🥳 🔫 🛠️ 👫 🔜 🎲 💬 👆 🕳 💖:
```Python
from unicorn import UnicornMiddleware
app = SomeASGIApp()
new_app = UnicornMiddleware(app, some_config="rainbow")
```
✋️ FastAPI (🤙 💃) 🚚 🙅 🌌 ⚫️ 👈 ⚒ 💭 👈 🔗 🛠️ 🍵 💽 ❌ &amp; 🛃 ⚠ 🐕‍🦺 👷 ☑.
👈, 👆 ⚙️ `app.add_middleware()` (🖼 ⚜).
```Python
from fastapi import FastAPI
from unicorn import UnicornMiddleware
app = FastAPI()
app.add_middleware(UnicornMiddleware, some_config="rainbow")
```
`app.add_middleware()` 📨 🛠️ 🎓 🥇 ❌ &amp; 🙆 🌖 ❌ 🚶‍♀️ 🛠️.
## 🛠️ 🛠️
**FastAPI** 🔌 📚 🛠️ ⚠ ⚙️ 💼, 👥 🔜 👀 ⏭ ❔ ⚙️ 👫.
!!! note "📡 "
⏭ 🖼, 👆 💪 ⚙️ `from starlette.middleware.something import SomethingMiddleware`.
**FastAPI** 🚚 📚 🛠️ `fastapi.middleware` 🏪 👆, 👩‍💻. ✋️ 🌅 💪 🛠️ 👟 🔗 ⚪️➡️ 💃.
## `HTTPSRedirectMiddleware`
🛠️ 👈 🌐 📨 📨 🔜 👯‍♂️ `https` ⚖️ `wss`.
🙆 📨 📨 `http` ⚖️ `ws` 🔜 ❎ 🔐 ⚖ ↩️.
```Python hl_lines="2 6"
{!../../../docs_src/advanced_middleware/tutorial001.py!}
```
## `TrustedHostMiddleware`
🛠️ 👈 🌐 📨 📨 ✔️ ☑ ⚒ `Host` 🎚, ✔ 💂‍♂ 🛡 🇺🇸🔍 🦠 🎚 👊.
```Python hl_lines="2 6-8"
{!../../../docs_src/advanced_middleware/tutorial002.py!}
```
📄 ❌ 🐕‍🦺:
* `allowed_hosts` - 📇 🆔 📛 👈 🔜 ✔ 📛. 🃏 🆔 ✅ `*.example.com` 🐕‍🦺 🎀 📁. ✔ 🙆 📛 👯‍♂️ ⚙️ `allowed_hosts=["*"]` ⚖️ 🚫 🛠️.
🚥 📨 📨 🔨 🚫 ✔ ☑ ⤴️ `400` 📨 🔜 📨.
## `GZipMiddleware`
🍵 🗜 📨 🙆 📨 👈 🔌 `"gzip"` `Accept-Encoding` 🎚.
🛠️ 🔜 🍵 👯‍♂️ 🐩 &amp; 🎥 📨.
```Python hl_lines="2 6"
{!../../../docs_src/advanced_middleware/tutorial003.py!}
```
📄 ❌ 🐕‍🦺:
* `minimum_size` - 🚫 🗜 📨 👈 🤪 🌘 👉 💯 📐 🔢. 🔢 `500`.
## 🎏 🛠️
📤 📚 🎏 🔫 🛠️.
🖼:
* <a href="https://docs.sentry.io/platforms/python/asgi/" class="external-link" target="_blank">🔫</a>
* <a href="https://github.com/encode/uvicorn/blob/master/uvicorn/middleware/proxy_headers.py" class="external-link" target="_blank">Uvicorn `ProxyHeadersMiddleware`</a>
* <a href="https://github.com/florimondmanca/msgpack-asgi" class="external-link" target="_blank">🇸🇲</a>
👀 🎏 💪 🛠️ ✅ <a href="https://www.starlette.io/middleware/" class="external-link" target="_blank">💃 🛠️ 🩺</a> &amp; <a href="https://github.com/florimondmanca/awesome-asgi" class="external-link" target="_blank">🔫 👌 📇</a>.

View File

@@ -0,0 +1,156 @@
# ☁ (📎 / 🦏 💽) 💽
**FastAPI** 💪 🛠️ ⏮️ 🙆 <abbr title="Distributed database (Big Data), also 'Not Only SQL'">☁</abbr>.
📥 👥 🔜 👀 🖼 ⚙️ **<a href="https://www.couchbase.com/" class="external-link" target="_blank">🗄</a>**, <abbr title="Document here refers to a JSON object (a dict), with keys and values, and those values can also be other JSON objects, arrays (lists), numbers, strings, booleans, etc.">📄</abbr> 🧢 ☁ 💽.
👆 💪 🛠️ ⚫️ 🙆 🎏 ☁ 💽 💖:
* **✳**
* **👸**
* **✳**
* **🇸🇲**
* **✳**, ♒️.
!!! tip
📤 🛂 🏗 🚂 ⏮️ **FastAPI** &amp; **🗄**, 🌐 ⚓️ 🔛 **☁**, 🔌 🕸 &amp; 🌖 🧰: <a href="https://github.com/tiangolo/full-stack-fastapi-couchbase" class="external-link" target="_blank">https://github.com/tiangolo/full-stack-fastapi-couchbase</a>
## 🗄 🗄 🦲
🔜, 🚫 💸 🙋 🎂, 🕴 🗄:
```Python hl_lines="3-5"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
## 🔬 📉 ⚙️ "📄 🆎"
👥 🔜 ⚙️ ⚫️ ⏪ 🔧 🏑 `type` 👆 📄.
👉 🚫 ✔ 🗄, ✋️ 👍 💡 👈 🔜 👆 ⏮️.
```Python hl_lines="9"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
## 🚮 🔢 🤚 `Bucket`
**🗄**, 🥡 ⚒ 📄, 👈 💪 🎏 🆎.
👫 🛎 🌐 🔗 🎏 🈸.
🔑 🔗 💽 🌏 🔜 "💽" (🎯 💽, 🚫 💽 💽).
🔑 **✳** 🔜 "🗃".
📟, `Bucket` 🎨 👑 🇨🇻 📻 ⏮️ 💽.
👉 🚙 🔢 🔜:
* 🔗 **🗄** 🌑 (👈 💪 👁 🎰).
* ⚒ 🔢 ⏲.
* 🔓 🌑.
* 🤚 `Bucket` 👐.
* ⚒ 🔢 ⏲.
* 📨 ⚫️.
```Python hl_lines="12-21"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
## ✍ Pydantic 🏷
**🗄** "📄" 🤙 "🎻 🎚", 👥 💪 🏷 👫 ⏮️ Pydantic.
### `User` 🏷
🥇, ➡️ ✍ `User` 🏷:
```Python hl_lines="24-28"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
👥 🔜 ⚙️ 👉 🏷 👆 *➡ 🛠️ 🔢*,, 👥 🚫 🔌 ⚫️ `hashed_password`.
### `UserInDB` 🏷
🔜, ➡️ ✍ `UserInDB` 🏷.
👉 🔜 ✔️ 💽 👈 🤙 🏪 💽.
👥 🚫 ✍ ⚫️ 🏿 Pydantic `BaseModel` ✋️ 🏿 👆 👍 `User`, ↩️ ⚫️ 🔜 ✔️ 🌐 🔢 `User` 👩‍❤‍👨 🌅:
```Python hl_lines="31-33"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
!!! note
👀 👈 👥 ✔️ `hashed_password` &amp; `type` 🏑 👈 🔜 🏪 💽.
✋️ ⚫️ 🚫 🍕 🏢 `User` 🏷 (1⃣ 👥 🔜 📨 *➡ 🛠️*).
## 🤚 👩‍💻
🔜 ✍ 🔢 👈 🔜:
* ✊ 🆔.
* 🏗 📄 🆔 ⚪️➡️ ⚫️.
* 🤚 📄 ⏮️ 👈 🆔.
* 🚮 🎚 📄 `UserInDB` 🏷.
🏗 🔢 👈 🕴 💡 🤚 👆 👩‍💻 ⚪️➡️ `username` (⚖️ 🙆 🎏 🔢) 🔬 👆 *➡ 🛠️ 🔢*, 👆 💪 🌖 💪 🏤-⚙️ ⚫️ 💗 🍕 &amp; 🚮 <abbr title="Automated test, written in code, that checks if another piece of code is working correctly.">⚒ 💯</abbr> ⚫️:
```Python hl_lines="36-42"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
### Ⓜ-🎻
🚥 👆 🚫 😰 ⏮️ `f"userprofile::{username}"`, ⚫️ 🐍 "<a href="https://docs.python.org/3/glossary.html#term-f-string" class="external-link" target="_blank">Ⓜ-🎻</a>".
🙆 🔢 👈 🚮 🔘 `{}` Ⓜ-🎻 🔜 ↔ / 💉 🎻.
### `dict` 🏗
🚥 👆 🚫 😰 ⏮️ `UserInDB(**result.value)`, <a href="https://docs.python.org/3/glossary.html#term-argument" class="external-link" target="_blank">⚫️ ⚙️ `dict` "🏗"</a>.
⚫️ 🔜 ✊ `dict` `result.value`, &amp; ✊ 🔠 🚮 🔑 &amp; 💲 &amp; 🚶‍♀️ 👫 🔑-💲 `UserInDB` 🇨🇻 ❌.
, 🚥 `dict` 🔌:
```Python
{
"username": "johndoe",
"hashed_password": "some_hash",
}
```
⚫️ 🔜 🚶‍♀️ `UserInDB` :
```Python
UserInDB(username="johndoe", hashed_password="some_hash")
```
## ✍ 👆 **FastAPI** 📟
### ✍ `FastAPI` 📱
```Python hl_lines="46"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
### ✍ *➡ 🛠️ 🔢*
👆 📟 🤙 🗄 &amp; 👥 🚫 ⚙️ <a href="https://docs.couchbase.com/python-sdk/2.5/async-programming.html#asyncio-python-3-5" class="external-link" target="_blank">🥼 🐍 <code>await</code> 🐕‍🦺</a>, 👥 🔜 📣 👆 🔢 ⏮️ 😐 `def` ↩️ `async def`.
, 🗄 👍 🚫 ⚙️ 👁 `Bucket` 🎚 💗 "<abbr title="A sequence of code being executed by the program, while at the same time, or at intervals, there can be others being executed too.">🧵</abbr>Ⓜ",, 👥 💪 🤚 🥡 🔗 &amp; 🚶‍♀️ ⚫️ 👆 🚙 🔢:
```Python hl_lines="49-53"
{!../../../docs_src/nosql_databases/tutorial001.py!}
```
## 🌃
👆 💪 🛠️ 🙆 🥉 🥳 ☁ 💽, ⚙️ 👫 🐩 📦.
🎏 ✔ 🙆 🎏 🔢 🧰, ⚙️ ⚖️ 🛠️.

View File

@@ -0,0 +1,179 @@
# 🗄 ⏲
👆 💪 ✍ 🛠️ ⏮️ *➡ 🛠️* 👈 💪 ⏲ 📨 *🔢 🛠️* ✍ 👱 🙆 (🎲 🎏 👩‍💻 👈 🔜 *⚙️* 👆 🛠️).
🛠️ 👈 🔨 🕐❔ 👆 🛠️ 📱 🤙 *🔢 🛠️* 📛 "⏲". ↩️ 🖥 👈 🔢 👩‍💻 ✍ 📨 📨 👆 🛠️ &amp; ⤴️ 👆 🛠️ *🤙 🔙*, 📨 📨 *🔢 🛠️* (👈 🎲 ✍ 🎏 👩‍💻).
👉 💼, 👆 💪 💚 📄 ❔ 👈 🔢 🛠️ *🔜* 👀 💖. ⚫️❔ *➡ 🛠️* ⚫️ 🔜 ✔️, ⚫️❔ 💪 ⚫️ 🔜 ⌛, ⚫️❔ 📨 ⚫️ 🔜 📨, ♒️.
## 📱 ⏮️ ⏲
➡️ 👀 🌐 👉 ⏮️ 🖼.
🌈 👆 🛠️ 📱 👈 ✔ 🏗 🧾.
👉 🧾 🔜 ✔️ `id`, `title` (📦), `customer`, &amp; `total`.
👩‍💻 👆 🛠️ (🔢 👩‍💻) 🔜 ✍ 🧾 👆 🛠️ ⏮️ 🏤 📨.
⤴️ 👆 🛠️ 🔜 (➡️ 🌈):
* 📨 🧾 🕴 🔢 👩‍💻.
* 📈 💸.
* 📨 📨 🔙 🛠️ 👩‍💻 (🔢 👩‍💻).
* 👉 🔜 🔨 📨 🏤 📨 (⚪️➡️ *👆 🛠️*) *🔢 🛠️* 🚚 👈 🔢 👩‍💻 (👉 "⏲").
## 😐 **FastAPI** 📱
➡️ 🥇 👀 ❔ 😐 🛠️ 📱 🔜 👀 💖 ⏭ ❎ ⏲.
⚫️ 🔜 ✔️ *➡ 🛠️* 👈 🔜 📨 `Invoice` 💪, &amp; 🔢 🔢 `callback_url` 👈 🔜 🔌 📛 ⏲.
👉 🍕 📶 😐, 🌅 📟 🎲 ⏪ 😰 👆:
```Python hl_lines="9-13 36-53"
{!../../../docs_src/openapi_callbacks/tutorial001.py!}
```
!!! tip
`callback_url` 🔢 🔢 ⚙️ Pydantic <a href="https://pydantic-docs.helpmanual.io/usage/types/#urls" class="external-link" target="_blank">📛</a> 🆎.
🕴 🆕 👜 `callbacks=messages_callback_router.routes` ❌ *➡ 🛠️ 👨‍🎨*. 👥 🔜 👀 ⚫️❔ 👈 ⏭.
## 🔬 ⏲
☑ ⏲ 📟 🔜 🪀 🙇 🔛 👆 👍 🛠️ 📱.
&amp; ⚫️ 🔜 🎲 🪀 📚 ⚪️➡️ 1⃣ 📱 ⏭.
⚫️ 💪 1⃣ ⚖️ 2⃣ ⏸ 📟, 💖:
```Python
callback_url = "https://example.com/api/v1/invoices/events/"
httpx.post(callback_url, json={"description": "Invoice paid", "paid": True})
```
✋️ 🎲 🏆 ⚠ 🍕 ⏲ ⚒ 💭 👈 👆 🛠️ 👩‍💻 (🔢 👩‍💻) 🛠️ *🔢 🛠️* ☑, 🛄 💽 👈 *👆 🛠️* 🔜 📨 📨 💪 ⏲, ♒️.
, ⚫️❔ 👥 🔜 ⏭ 🚮 📟 📄 ❔ 👈 *🔢 🛠️* 🔜 👀 💖 📨 ⏲ ⚪️➡️ *👆 🛠️*.
👈 🧾 🔜 🎦 🆙 🦁 🎚 `/docs` 👆 🛠️, &amp; ⚫️ 🔜 ➡️ 🔢 👩‍💻 💭 ❔ 🏗 *🔢 🛠️*.
👉 🖼 🚫 🛠️ ⏲ ⚫️ (👈 💪 ⏸ 📟), 🕴 🧾 🍕.
!!! tip
☑ ⏲ 🇺🇸🔍 📨.
🕐❔ 🛠️ ⏲ 👆, 👆 💪 ⚙️ 🕳 💖 <a href="https://www.python-httpx.org" class="external-link" target="_blank">🇸🇲</a> ⚖️ <a href="https://requests.readthedocs.io/" class="external-link" target="_blank">📨</a>.
## ✍ ⏲ 🧾 📟
👉 📟 🏆 🚫 🛠️ 👆 📱, 👥 🕴 💪 ⚫️ *📄* ❔ 👈 *🔢 🛠️* 🔜 👀 💖.
✋️, 👆 ⏪ 💭 ❔ 💪 ✍ 🏧 🧾 🛠️ ⏮️ **FastAPI**.
👥 🔜 ⚙️ 👈 🎏 💡 📄 ❔ *🔢 🛠️* 🔜 👀 💖... 🏗 *➡ 🛠️(Ⓜ)* 👈 🔢 🛠️ 🔜 🛠️ (🕐 👆 🛠️ 🔜 🤙).
!!! tip
🕐❔ ✍ 📟 📄 ⏲, ⚫️ 💪 ⚠ 🌈 👈 👆 👈 *🔢 👩‍💻*. &amp; 👈 👆 ⏳ 🛠️ *🔢 🛠️*, 🚫 *👆 🛠️*.
🍕 🛠️ 👉 ☝ 🎑 ( *🔢 👩‍💻*) 💪 👆 💭 💖 ⚫️ 🌅 ⭐ 🌐❔ 🚮 🔢, Pydantic 🏷 💪, 📨, ♒️. 👈 *🔢 🛠️*.
### ✍ ⏲ `APIRouter`
🥇 ✍ 🆕 `APIRouter` 👈 🔜 🔌 1⃣ ⚖️ 🌅 ⏲.
```Python hl_lines="3 25"
{!../../../docs_src/openapi_callbacks/tutorial001.py!}
```
### ✍ ⏲ *➡ 🛠️*
✍ ⏲ *➡ 🛠️* ⚙️ 🎏 `APIRouter` 👆 ✍ 🔛.
⚫️ 🔜 👀 💖 😐 FastAPI *➡ 🛠️*:
* ⚫️ 🔜 🎲 ✔️ 📄 💪 ⚫️ 🔜 📨, ✅ `body: InvoiceEvent`.
* &amp; ⚫️ 💪 ✔️ 📄 📨 ⚫️ 🔜 📨, ✅ `response_model=InvoiceEventReceived`.
```Python hl_lines="16-18 21-22 28-32"
{!../../../docs_src/openapi_callbacks/tutorial001.py!}
```
📤 2⃣ 👑 🔺 ⚪️➡️ 😐 *➡ 🛠️*:
* ⚫️ 🚫 💪 ✔️ 🙆 ☑ 📟, ↩️ 👆 📱 🔜 🙅 🤙 👉 📟. ⚫️ 🕴 ⚙️ 📄 *🔢 🛠️*. , 🔢 💪 ✔️ `pass`.
* *➡* 💪 🔌 <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#key-expression" class="external-link" target="_blank">🗄 3⃣ 🧬</a> (👀 🌖 🔛) 🌐❔ ⚫️ 💪 ⚙️ 🔢 ⏮️ 🔢 &amp; 🍕 ⏮️ 📨 📨 *👆 🛠️*.
### ⏲ ➡ 🧬
⏲ *➡* 💪 ✔️ <a href="https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#key-expression" class="external-link" target="_blank">🗄 3⃣ 🧬</a> 👈 💪 🔌 🍕 ⏮️ 📨 📨 *👆 🛠️*.
👉 💼, ⚫️ `str`:
```Python
"{$callback_url}/invoices/{$request.body.id}"
```
, 🚥 👆 🛠️ 👩‍💻 (🔢 👩‍💻) 📨 📨 *👆 🛠️* :
```
https://yourapi.com/invoices/?callback_url=https://www.external.org/events
```
⏮️ 🎻 💪:
```JSON
{
"id": "2expen51ve",
"customer": "Mr. Richie Rich",
"total": "9999"
}
```
⤴️ *👆 🛠️* 🔜 🛠️ 🧾, &amp; ☝ ⏪, 📨 ⏲ 📨 `callback_url` ( *🔢 🛠️*):
```
https://www.external.org/events/invoices/2expen51ve
```
⏮️ 🎻 💪 ⚗ 🕳 💖:
```JSON
{
"description": "Payment celebration",
"paid": true
}
```
&amp; ⚫️ 🔜 ⌛ 📨 ⚪️➡️ 👈 *🔢 🛠️* ⏮️ 🎻 💪 💖:
```JSON
{
"ok": true
}
```
!!! tip
👀 ❔ ⏲ 📛 ⚙️ 🔌 📛 📨 🔢 🔢 `callback_url` (`https://www.external.org/events`) &amp; 🧾 `id` ⚪️➡️ 🔘 🎻 💪 (`2expen51ve`).
### 🚮 ⏲ 📻
👉 ☝ 👆 ✔️ *⏲ ➡ 🛠️(Ⓜ)* 💪 (1⃣(Ⓜ) 👈 *🔢 👩‍💻* 🔜 🛠️ *🔢 🛠️*) ⏲ 📻 👆 ✍ 🔛.
🔜 ⚙️ 🔢 `callbacks` *👆 🛠️ ➡ 🛠️ 👨‍🎨* 🚶‍♀️ 🔢 `.routes` (👈 🤙 `list` 🛣/*➡ 🛠️*) ⚪️➡️ 👈 ⏲ 📻:
```Python hl_lines="35"
{!../../../docs_src/openapi_callbacks/tutorial001.py!}
```
!!! tip
👀 👈 👆 🚫 🚶‍♀️ 📻 ⚫️ (`invoices_callback_router`) `callback=`, ✋️ 🔢 `.routes`, `invoices_callback_router.routes`.
### ✅ 🩺
🔜 👆 💪 ▶️ 👆 📱 ⏮️ Uvicorn &amp; 🚶 <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
👆 🔜 👀 👆 🩺 ✅ "⏲" 📄 👆 *➡ 🛠️* 👈 🎦 ❔ *🔢 🛠️* 🔜 👀 💖:
<img src="/img/tutorial/openapi-callbacks/image01.png">

View File

@@ -0,0 +1,170 @@
# ➡ 🛠️ 🏧 📳
## 🗄 {
!!! warning
🚥 👆 🚫 "🕴" 🗄, 👆 🎲 🚫 💪 👉.
👆 💪 ⚒ 🗄 `operationId` ⚙️ 👆 *➡ 🛠️* ⏮️ 🔢 `operation_id`.
👆 🔜 ✔️ ⚒ 💭 👈 ⚫️ 😍 🔠 🛠️.
```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial001.py!}
```
### ⚙️ *➡ 🛠️ 🔢* 📛 {
🚥 👆 💚 ⚙️ 👆 🔗' 🔢 📛 `operationId`Ⓜ, 👆 💪 🔁 🤭 🌐 👫 &amp; 🔐 🔠 *➡ 🛠️* `operation_id` ⚙️ 👫 `APIRoute.name`.
👆 🔜 ⚫️ ⏮️ ❎ 🌐 👆 *➡ 🛠️*.
```Python hl_lines="2 12-21 24"
{!../../../docs_src/path_operation_advanced_configuration/tutorial002.py!}
```
!!! tip
🚥 👆 ❎ 🤙 `app.openapi()`, 👆 🔜 `operationId`Ⓜ ⏭ 👈.
!!! warning
🚥 👆 👉, 👆 ✔️ ⚒ 💭 🔠 1⃣ 👆 *➡ 🛠️ 🔢* ✔️ 😍 📛.
🚥 👫 🎏 🕹 (🐍 📁).
## 🚫 ⚪️➡️ 🗄
🚫 *➡ 🛠️* ⚪️➡️ 🏗 🗄 🔗 (&amp; ➡️, ⚪️➡️ 🏧 🧾 ⚙️), ⚙️ 🔢 `include_in_schema` &amp; ⚒ ⚫️ `False`:
```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial003.py!}
```
## 🏧 📛 ⚪️➡️ #️⃣
👆 💪 📉 ⏸ ⚙️ ⚪️➡️ #️⃣ *➡ 🛠️ 🔢* 🗄.
❎ `\f` (😖 "📨 🍼" 🦹) 🤕 **FastAPI** 🔁 🔢 ⚙️ 🗄 👉 ☝.
⚫️ 🏆 🚫 🎦 🆙 🧾, ✋️ 🎏 🧰 (✅ 🐉) 🔜 💪 ⚙️ 🎂.
```Python hl_lines="19-29"
{!../../../docs_src/path_operation_advanced_configuration/tutorial004.py!}
```
## 🌖 📨
👆 🎲 ✔️ 👀 ❔ 📣 `response_model` &amp; `status_code` *➡ 🛠️*.
👈 🔬 🗃 🔃 👑 📨 *➡ 🛠️*.
👆 💪 📣 🌖 📨 ⏮️ 👫 🏷, 👔 📟, ♒️.
📤 🎂 📃 📥 🧾 🔃 ⚫️, 👆 💪 ✍ ⚫️ [🌖 📨 🗄](./additional-responses.md){.internal-link target=_blank}.
## 🗄
🕐❔ 👆 📣 *➡ 🛠️* 👆 🈸, **FastAPI** 🔁 🏗 🔗 🗃 🔃 👈 *➡ 🛠️* 🔌 🗄 🔗.
!!! note "📡 "
🗄 🔧 ⚫️ 🤙 <a href="https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operation-object" class="external-link" target="_blank">🛠️ 🎚</a>.
⚫️ ✔️ 🌐 🔃 *➡ 🛠️* &amp; ⚙️ 🏗 🏧 🧾.
⚫️ 🔌 `tags`, `parameters`, `requestBody`, `responses`, ♒️.
👉 *➡ 🛠️*-🎯 🗄 🔗 🛎 🏗 🔁 **FastAPI**, ✋️ 👆 💪 ↔ ⚫️.
!!! tip
👉 🔅 🎚 ↔ ☝.
🚥 👆 🕴 💪 📣 🌖 📨, 🌅 🏪 🌌 ⚫️ ⏮️ [🌖 📨 🗄](./additional-responses.md){.internal-link target=_blank}.
👆 💪 ↔ 🗄 🔗 *➡ 🛠️* ⚙️ 🔢 `openapi_extra`.
### 🗄 ↔
👉 `openapi_extra` 💪 👍, 🖼, 📣 [🗄 ↔](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#specificationExtensions):
```Python hl_lines="6"
{!../../../docs_src/path_operation_advanced_configuration/tutorial005.py!}
```
🚥 👆 📂 🏧 🛠️ 🩺, 👆 ↔ 🔜 🎦 🆙 🔝 🎯 *➡ 🛠️*.
<img src="/img/tutorial/path-operation-advanced-configuration/image01.png">
&amp; 🚥 👆 👀 📉 🗄 ( `/openapi.json` 👆 🛠️), 👆 🔜 👀 👆 ↔ 🍕 🎯 *➡ 🛠️* 💁‍♂️:
```JSON hl_lines="22"
{
"openapi": "3.0.2",
"info": {
"title": "FastAPI",
"version": "0.1.0"
},
"paths": {
"/items/": {
"get": {
"summary": "Read Items",
"operationId": "read_items_items__get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {}
}
}
}
},
"x-aperture-labs-portal": "blue"
}
}
}
}
```
### 🛃 🗄 *➡ 🛠️* 🔗
📖 `openapi_extra` 🔜 🙇 🔗 ⏮️ 🔁 🏗 🗄 🔗 *➡ 🛠️*.
, 👆 💪 🚮 🌖 💽 🔁 🏗 🔗.
🖼, 👆 💪 💭 ✍ &amp; ✔ 📨 ⏮️ 👆 👍 📟, 🍵 ⚙️ 🏧 ⚒ FastAPI ⏮️ Pydantic, ✋️ 👆 💪 💚 🔬 📨 🗄 🔗.
👆 💪 👈 ⏮️ `openapi_extra`:
```Python hl_lines="20-37 39-40"
{!../../../docs_src/path_operation_advanced_configuration/tutorial006.py!}
```
👉 🖼, 👥 🚫 📣 🙆 Pydantic 🏷. 👐, 📨 💪 🚫 <abbr title="converted from some plain format, like bytes, into Python objects">🎻</abbr> 🎻, ⚫️ ✍ 🔗 `bytes`, &amp; 🔢 `magic_data_reader()` 🔜 🈚 🎻 ⚫️ 🌌.
👐, 👥 💪 📣 📈 🔗 📨 💪.
### 🛃 🗄 🎚 🆎
⚙️ 👉 🎏 🎱, 👆 💪 ⚙️ Pydantic 🏷 🔬 🎻 🔗 👈 ⤴️ 🔌 🛃 🗄 🔗 📄 *➡ 🛠️*.
&amp; 👆 💪 👉 🚥 💽 🆎 📨 🚫 🎻.
🖼, 👉 🈸 👥 🚫 ⚙️ FastAPI 🛠️ 🛠️ ⚗ 🎻 🔗 ⚪️➡️ Pydantic 🏷 🚫 🏧 🔬 🎻. 👐, 👥 📣 📨 🎚 🆎 📁, 🚫 🎻:
```Python hl_lines="17-22 24"
{!../../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
```
👐, 👐 👥 🚫 ⚙️ 🔢 🛠️ 🛠️, 👥 ⚙️ Pydantic 🏷 ❎ 🏗 🎻 🔗 💽 👈 👥 💚 📨 📁.
⤴️ 👥 ⚙️ 📨 🔗, &amp; ⚗ 💪 `bytes`. 👉 ⛓ 👈 FastAPI 🏆 🚫 🔄 🎻 📨 🚀 🎻.
&amp; ⤴️ 👆 📟, 👥 🎻 👈 📁 🎚 🔗, &amp; ⤴️ 👥 🔄 ⚙️ 🎏 Pydantic 🏷 ✔ 📁 🎚:
```Python hl_lines="26-33"
{!../../../docs_src/path_operation_advanced_configuration/tutorial007.py!}
```
!!! tip
📥 👥 🏤-⚙️ 🎏 Pydantic 🏷.
✋️ 🎏 🌌, 👥 💪 ✔️ ✔ ⚫️ 🎏 🌌.

View File

@@ -0,0 +1,33 @@
# 📨 - 🔀 👔 📟
👆 🎲 ✍ ⏭ 👈 👆 💪 ⚒ 🔢 [📨 👔 📟](../tutorial/response-status-code.md){.internal-link target=_blank}.
✋️ 💼 👆 💪 📨 🎏 👔 📟 🌘 🔢.
## ⚙️ 💼
🖼, 🌈 👈 👆 💚 📨 🇺🇸🔍 👔 📟 "👌" `200` 🔢.
✋️ 🚥 💽 🚫 🔀, 👆 💚 ✍ ⚫️, &amp; 📨 🇺🇸🔍 👔 📟 "✍" `201`.
✋️ 👆 💚 💪 ⛽ &amp; 🗜 💽 👆 📨 ⏮️ `response_model`.
📚 💼, 👆 💪 ⚙️ `Response` 🔢.
## ⚙️ `Response` 🔢
👆 💪 📣 🔢 🆎 `Response` 👆 *➡ 🛠️ 🔢* (👆 💪 🍪 &amp; 🎚).
&amp; ⤴️ 👆 💪 ⚒ `status_code` 👈 *🔀* 📨 🎚.
```Python hl_lines="1 9 12"
{!../../../docs_src/response_change_status_code/tutorial001.py!}
```
&amp; ⤴️ 👆 💪 📨 🙆 🎚 👆 💪, 👆 🛎 🔜 ( `dict`, 💽 🏷, ♒️).
&amp; 🚥 👆 📣 `response_model`, ⚫️ 🔜 ⚙️ ⛽ &amp; 🗜 🎚 👆 📨.
**FastAPI** 🔜 ⚙️ 👈 *🔀* 📨 ⚗ 👔 📟 (🍪 &amp; 🎚), &amp; 🔜 🚮 👫 🏁 📨 👈 🔌 💲 👆 📨, ⛽ 🙆 `response_model`.
👆 💪 📣 `Response` 🔢 🔗, &amp; ⚒ 👔 📟 👫. ✋️ ✔️ 🤯 👈 🏁 1⃣ ⚒ 🔜 🏆.

View File

@@ -0,0 +1,49 @@
# 📨 🍪
## ⚙️ `Response` 🔢
👆 💪 📣 🔢 🆎 `Response` 👆 *➡ 🛠️ 🔢*.
&amp; ⤴️ 👆 💪 ⚒ 🍪 👈 *🔀* 📨 🎚.
```Python hl_lines="1 8-9"
{!../../../docs_src/response_cookies/tutorial002.py!}
```
&amp; ⤴️ 👆 💪 📨 🙆 🎚 👆 💪, 👆 🛎 🔜 ( `dict`, 💽 🏷, ♒️).
&amp; 🚥 👆 📣 `response_model`, ⚫️ 🔜 ⚙️ ⛽ &amp; 🗜 🎚 👆 📨.
**FastAPI** 🔜 ⚙️ 👈 *🔀* 📨 ⚗ 🍪 (🎚 &amp; 👔 📟), &amp; 🔜 🚮 👫 🏁 📨 👈 🔌 💲 👆 📨, ⛽ 🙆 `response_model`.
👆 💪 📣 `Response` 🔢 🔗, &amp; ⚒ 🍪 (&amp; 🎚) 👫.
## 📨 `Response` 🔗
👆 💪 ✍ 🍪 🕐❔ 🛬 `Response` 🔗 👆 📟.
👈, 👆 💪 ✍ 📨 🔬 [📨 📨 🔗](response-directly.md){.internal-link target=_blank}.
⤴️ ⚒ 🍪 ⚫️, &amp; ⤴️ 📨 ⚫️:
```Python hl_lines="10-12"
{!../../../docs_src/response_cookies/tutorial001.py!}
```
!!! tip
✔️ 🤯 👈 🚥 👆 📨 📨 🔗 ↩️ ⚙️ `Response` 🔢, FastAPI 🔜 📨 ⚫️ 🔗.
, 👆 🔜 ✔️ ⚒ 💭 👆 💽 ☑ 🆎. 🤶 Ⓜ. ⚫️ 🔗 ⏮️ 🎻, 🚥 👆 🛬 `JSONResponse`.
&amp; 👈 👆 🚫 📨 🙆 📊 👈 🔜 ✔️ ⛽ `response_model`.
### 🌅
!!! note "📡 "
👆 💪 ⚙️ `from starlette.responses import Response` ⚖️ `from starlette.responses import JSONResponse`.
**FastAPI** 🚚 🎏 `starlette.responses` `fastapi.responses` 🏪 👆, 👩‍💻. ✋️ 🌅 💪 📨 👟 🔗 ⚪️➡️ 💃.
&amp; `Response` 💪 ⚙️ 🛎 ⚒ 🎚 &amp; 🍪, **FastAPI** 🚚 ⚫️ `fastapi.Response`.
👀 🌐 💪 🔢 &amp; 🎛, ✅ <a href="https://www.starlette.io/responses/#set-cookie" class="external-link" target="_blank">🧾 💃</a>.

View File

@@ -0,0 +1,63 @@
# 📨 📨 🔗
🕐❔ 👆 ✍ **FastAPI** *➡ 🛠️* 👆 💪 🛎 📨 🙆 📊 ⚪️➡️ ⚫️: `dict`, `list`, Pydantic 🏷, 💽 🏷, ♒️.
🔢, **FastAPI** 🔜 🔁 🗜 👈 📨 💲 🎻 ⚙️ `jsonable_encoder` 🔬 [🎻 🔗 🔢](../tutorial/encoder.md){.internal-link target=_blank}.
⤴️, ⛅ 🎑, ⚫️ 🔜 🚮 👈 🎻-🔗 💽 (✅ `dict`) 🔘 `JSONResponse` 👈 🔜 ⚙️ 📨 📨 👩‍💻.
✋️ 👆 💪 📨 `JSONResponse` 🔗 ⚪️➡️ 👆 *➡ 🛠️*.
⚫️ 💪 ⚠, 🖼, 📨 🛃 🎚 ⚖️ 🍪.
## 📨 `Response`
👐, 👆 💪 📨 🙆 `Response` ⚖️ 🙆 🎧-🎓 ⚫️.
!!! tip
`JSONResponse` ⚫️ 🎧-🎓 `Response`.
&amp; 🕐❔ 👆 📨 `Response`, **FastAPI** 🔜 🚶‍♀️ ⚫️ 🔗.
⚫️ 🏆 🚫 🙆 💽 🛠️ ⏮️ Pydantic 🏷, ⚫️ 🏆 🚫 🗜 🎚 🙆 🆎, ♒️.
👉 🤝 👆 📚 💪. 👆 💪 📨 🙆 📊 🆎, 🔐 🙆 💽 📄 ⚖️ 🔬, ♒️.
## ⚙️ `jsonable_encoder` `Response`
↩️ **FastAPI** 🚫 🙆 🔀 `Response` 👆 📨, 👆 ✔️ ⚒ 💭 ⚫️ 🎚 🔜 ⚫️.
🖼, 👆 🚫🔜 🚮 Pydantic 🏷 `JSONResponse` 🍵 🥇 🏭 ⚫️ `dict` ⏮️ 🌐 📊 🆎 (💖 `datetime`, `UUID`, ♒️) 🗜 🎻-🔗 🆎.
📚 💼, 👆 💪 ⚙️ `jsonable_encoder` 🗜 👆 📊 ⏭ 🚶‍♀️ ⚫️ 📨:
```Python hl_lines="6-7 21-22"
{!../../../docs_src/response_directly/tutorial001.py!}
```
!!! note "📡 "
👆 💪 ⚙️ `from starlette.responses import JSONResponse`.
**FastAPI** 🚚 🎏 `starlette.responses` `fastapi.responses` 🏪 👆, 👩‍💻. ✋️ 🌅 💪 📨 👟 🔗 ⚪️➡️ 💃.
## 🛬 🛃 `Response`
🖼 🔛 🎦 🌐 🍕 👆 💪, ✋️ ⚫️ 🚫 📶 ⚠, 👆 💪 ✔️ 📨 `item` 🔗, &amp; **FastAPI** 🔜 🚮 ⚫️ `JSONResponse` 👆, 🏭 ⚫️ `dict`, ♒️. 🌐 👈 🔢.
🔜, ➡️ 👀 ❔ 👆 💪 ⚙️ 👈 📨 🛃 📨.
➡️ 💬 👈 👆 💚 📨 <a href="https://en.wikipedia.org/wiki/XML" class="external-link" target="_blank">📂</a> 📨.
👆 💪 🚮 👆 📂 🎚 🎻, 🚮 ⚫️ `Response`, &amp; 📨 ⚫️:
```Python hl_lines="1 18"
{!../../../docs_src/response_directly/tutorial002.py!}
```
## 🗒
🕐❔ 👆 📨 `Response` 🔗 🚮 📊 🚫 ✔, 🗜 (🎻), 🚫 📄 🔁.
✋️ 👆 💪 📄 ⚫️ 🔬 [🌖 📨 🗄](additional-responses.md){.internal-link target=_blank}.
👆 💪 👀 ⏪ 📄 ❔ ⚙️/📣 👉 🛃 `Response`Ⓜ ⏪ ✔️ 🏧 💽 🛠️, 🧾, ♒️.

View File

@@ -0,0 +1,42 @@
# 📨 🎚
## ⚙️ `Response` 🔢
👆 💪 📣 🔢 🆎 `Response` 👆 *➡ 🛠️ 🔢* (👆 💪 🍪).
&amp; ⤴️ 👆 💪 ⚒ 🎚 👈 *🔀* 📨 🎚.
```Python hl_lines="1 7-8"
{!../../../docs_src/response_headers/tutorial002.py!}
```
&amp; ⤴️ 👆 💪 📨 🙆 🎚 👆 💪, 👆 🛎 🔜 ( `dict`, 💽 🏷, ♒️).
&amp; 🚥 👆 📣 `response_model`, ⚫️ 🔜 ⚙️ ⛽ &amp; 🗜 🎚 👆 📨.
**FastAPI** 🔜 ⚙️ 👈 *🔀* 📨 ⚗ 🎚 (🍪 &amp; 👔 📟), &amp; 🔜 🚮 👫 🏁 📨 👈 🔌 💲 👆 📨, ⛽ 🙆 `response_model`.
👆 💪 📣 `Response` 🔢 🔗, &amp; ⚒ 🎚 (&amp; 🍪) 👫.
## 📨 `Response` 🔗
👆 💪 🚮 🎚 🕐❔ 👆 📨 `Response` 🔗.
✍ 📨 🔬 [📨 📨 🔗](response-directly.md){.internal-link target=_blank} &amp; 🚶‍♀️ 🎚 🌖 🔢:
```Python hl_lines="10-12"
{!../../../docs_src/response_headers/tutorial001.py!}
```
!!! note "📡 "
👆 💪 ⚙️ `from starlette.responses import Response` ⚖️ `from starlette.responses import JSONResponse`.
**FastAPI** 🚚 🎏 `starlette.responses` `fastapi.responses` 🏪 👆, 👩‍💻. ✋️ 🌅 💪 📨 👟 🔗 ⚪️➡️ 💃.
&amp; `Response` 💪 ⚙️ 🛎 ⚒ 🎚 &amp; 🍪, **FastAPI** 🚚 ⚫️ `fastapi.Response`.
## 🛃 🎚
✔️ 🤯 👈 🛃 © 🎚 💪 🚮 <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">⚙️ '✖-' 🔡</a>.
✋️ 🚥 👆 ✔️ 🛃 🎚 👈 👆 💚 👩‍💻 🖥 💪 👀, 👆 💪 🚮 👫 👆 ⚜ 📳 (✍ 🌅 [⚜ (✖️-🇨🇳 🤝)](../tutorial/cors.md){.internal-link target=_blank}), ⚙️ 🔢 `expose_headers` 📄 <a href="https://www.starlette.io/middleware/#corsmiddleware" class="external-link" target="_blank">💃 ⚜ 🩺</a>.

View File

@@ -0,0 +1,113 @@
# 🇺🇸🔍 🔰 🔐
🙅 💼, 👆 💪 ⚙️ 🇺🇸🔍 🔰 🔐.
🇺🇸🔍 🔰 🔐, 🈸 ⌛ 🎚 👈 🔌 🆔 &amp; 🔐.
🚥 ⚫️ 🚫 📨 ⚫️, ⚫️ 📨 🇺🇸🔍 4⃣0⃣1⃣ "⛔" ❌.
&amp; 📨 🎚 `WWW-Authenticate` ⏮️ 💲 `Basic`, &amp; 📦 `realm` 🔢.
👈 💬 🖥 🎦 🛠️ 📋 🆔 &amp; 🔐.
⤴️, 🕐❔ 👆 🆎 👈 🆔 &amp; 🔐, 🖥 📨 👫 🎚 🔁.
## 🙅 🇺🇸🔍 🔰 🔐
* 🗄 `HTTPBasic` &amp; `HTTPBasicCredentials`.
* ✍ "`security` ⚖" ⚙️ `HTTPBasic`.
* ⚙️ 👈 `security` ⏮️ 🔗 👆 *➡ 🛠️*.
* ⚫️ 📨 🎚 🆎 `HTTPBasicCredentials`:
* ⚫️ 🔌 `username` &amp; `password` 📨.
```Python hl_lines="2 6 10"
{!../../../docs_src/security/tutorial006.py!}
```
🕐❔ 👆 🔄 📂 📛 🥇 🕰 (⚖️ 🖊 "🛠️" 🔼 🩺) 🖥 🔜 💭 👆 👆 🆔 &amp; 🔐:
<img src="/img/tutorial/security/image12.png">
## ✅ 🆔
📥 🌅 🏁 🖼.
⚙️ 🔗 ✅ 🚥 🆔 &amp; 🔐 ☑.
👉, ⚙️ 🐍 🐩 🕹 <a href="https://docs.python.org/3/library/secrets.html" class="external-link" target="_blank">`secrets`</a> ✅ 🆔 &amp; 🔐.
`secrets.compare_digest()` 💪 ✊ `bytes` ⚖️ `str` 👈 🕴 🔌 🔠 🦹 (🕐 🇪🇸), 👉 ⛓ ⚫️ 🚫🔜 👷 ⏮️ 🦹 💖 `á`, `Sebastián`.
🍵 👈, 👥 🥇 🗜 `username` &amp; `password` `bytes` 🔢 👫 ⏮️ 🔠-8⃣.
⤴️ 👥 💪 ⚙️ `secrets.compare_digest()` 🚚 👈 `credentials.username` `"stanleyjobson"`, &amp; 👈 `credentials.password` `"swordfish"`.
```Python hl_lines="1 11-21"
{!../../../docs_src/security/tutorial007.py!}
```
👉 🔜 🎏:
```Python
if not (credentials.username == "stanleyjobson") or not (credentials.password == "swordfish"):
# Return some error
...
```
✋️ ⚙️ `secrets.compare_digest()` ⚫️ 🔜 🔐 🛡 🆎 👊 🤙 "🕰 👊".
### ⏲ 👊
✋️ ⚫️❔ "⏲ 👊"❓
➡️ 🌈 👊 🔄 💭 🆔 &amp; 🔐.
&amp; 👫 📨 📨 ⏮️ 🆔 `johndoe` &amp; 🔐 `love123`.
⤴️ 🐍 📟 👆 🈸 🔜 🌓 🕳 💖:
```Python
if "johndoe" == "stanleyjobson" and "love123" == "swordfish":
...
```
✋️ ▶️️ 🙍 🐍 🔬 🥇 `j` `johndoe` 🥇 `s` `stanleyjobson`, ⚫️ 🔜 📨 `False`, ↩️ ⚫️ ⏪ 💭 👈 📚 2⃣ 🎻 🚫 🎏, 💭 👈 "📤 🙅‍♂ 💪 🗑 🌅 📊 ⚖ 🎂 🔤". &amp; 👆 🈸 🔜 💬 "❌ 👩‍💻 ⚖️ 🔐".
✋️ ⤴️ 👊 🔄 ⏮️ 🆔 `stanleyjobsox` &amp; 🔐 `love123`.
&amp; 👆 🈸 📟 🔨 🕳 💖:
```Python
if "stanleyjobsox" == "stanleyjobson" and "love123" == "swordfish":
...
```
🐍 🔜 ✔️ 🔬 🎂 `stanleyjobso` 👯‍♂️ `stanleyjobsox` &amp; `stanleyjobson` ⏭ 🤔 👈 👯‍♂️ 🎻 🚫 🎏. ⚫️ 🔜 ✊ ⏲ 📨 🔙 "❌ 👩‍💻 ⚖️ 🔐".
#### 🕰 ❔ 👊
👈 ☝, 👀 👈 💽 ✊ ⏲ 📏 📨 "❌ 👩‍💻 ⚖️ 🔐" 📨, 👊 🔜 💭 👈 👫 🤚 _🕳_ ▶️️, ▶️ 🔤 ▶️️.
&amp; ⤴️ 👫 💪 🔄 🔄 🤔 👈 ⚫️ 🎲 🕳 🌖 🎏 `stanleyjobsox` 🌘 `johndoe`.
#### "🕴" 👊
↗️, 👊 🔜 🚫 🔄 🌐 👉 ✋, 👫 🔜 ✍ 📋 ⚫️, 🎲 ⏮️ 💯 ⚖️ 💯 💯 📍 🥈. &amp; 🔜 🤚 1 ☑ 🔤 🕰.
✋️ 🔨 👈, ⏲ ⚖️ 📆 👊 🔜 ✔️ 💭 ☑ 🆔 &amp; 🔐, ⏮️ "" 👆 🈸, ⚙️ 🕰 ✊ ❔.
#### 🔧 ⚫️ ⏮️ `secrets.compare_digest()`
✋️ 👆 📟 👥 🤙 ⚙️ `secrets.compare_digest()`.
📏, ⚫️ 🔜 ✊ 🎏 🕰 🔬 `stanleyjobsox` `stanleyjobson` 🌘 ⚫️ ✊ 🔬 `johndoe` `stanleyjobson`. &amp; 🎏 🔐.
👈 🌌, ⚙️ `secrets.compare_digest()` 👆 🈸 📟, ⚫️ 🔜 🔒 🛡 👉 🎂 ↔ 💂‍♂ 👊.
### 📨 ❌
⏮️ 🔍 👈 🎓 ❌, 📨 `HTTPException` ⏮️ 👔 📟 4⃣0⃣1⃣ (🎏 📨 🕐❔ 🙅‍♂ 🎓 🚚) &amp; 🚮 🎚 `WWW-Authenticate` ⚒ 🖥 🎦 💳 📋 🔄:
```Python hl_lines="23-27"
{!../../../docs_src/security/tutorial007.py!}
```

View File

@@ -0,0 +1,16 @@
# 🏧 💂‍♂
## 🌖 ⚒
📤 ⚒ 🍵 💂‍♂ ↖️ ⚪️➡️ 🕐 📔 [🔰 - 👩‍💻 🦮: 💂‍♂](../../tutorial/security/){.internal-link target=_blank}.
!!! tip
⏭ 📄 **🚫 🎯 "🏧"**.
&amp; ⚫️ 💪 👈 👆 ⚙️ 💼, ⚗ 1⃣ 👫.
## ✍ 🔰 🥇
⏭ 📄 🤔 👆 ⏪ ✍ 👑 [🔰 - 👩‍💻 🦮: 💂‍♂](../../tutorial/security/){.internal-link target=_blank}.
👫 🌐 ⚓️ 🔛 🎏 🔧, ✋️ ✔ 🛠️.

View File

@@ -0,0 +1,269 @@
# Oauth2⃣ ↔
👆 💪 ⚙️ Oauth2⃣ ↔ 🔗 ⏮️ **FastAPI**, 👫 🛠️ 👷 💎.
👉 🔜 ✔ 👆 ✔️ 🌖 👌-🧽 ✔ ⚙️, 📄 Oauth2⃣ 🐩, 🛠️ 🔘 👆 🗄 🈸 (&amp; 🛠️ 🩺).
Oauth2⃣ ⏮️ ↔ 🛠️ ⚙️ 📚 🦏 🤝 🐕‍🦺, 💖 👱📔, 🇺🇸🔍, 📂, 🤸‍♂, 👱📔, ♒️. 👫 ⚙️ ⚫️ 🚚 🎯 ✔ 👩‍💻 &amp; 🈸.
🔠 🕰 👆 "🕹 ⏮️" 👱📔, 🇺🇸🔍, 📂, 🤸‍♂, 👱📔, 👈 🈸 ⚙️ Oauth2⃣ ⏮️ ↔.
👉 📄 👆 🔜 👀 ❔ 🛠️ 🤝 &amp; ✔ ⏮️ 🎏 Oauth2⃣ ⏮️ ↔ 👆 **FastAPI** 🈸.
!!! warning
👉 🌅 ⚖️ 🌘 🏧 📄. 🚥 👆 ▶️, 👆 💪 🚶 ⚫️.
👆 🚫 🎯 💪 Oauth2⃣ ↔, &amp; 👆 💪 🍵 🤝 &amp; ✔ 👐 👆 💚.
✋️ Oauth2⃣ ⏮️ ↔ 💪 🎆 🛠️ 🔘 👆 🛠️ (⏮️ 🗄) &amp; 👆 🛠️ 🩺.
👐, 👆 🛠️ 📚 ↔, ⚖️ 🙆 🎏 💂‍♂/✔ 📄, 👐 👆 💪, 👆 📟.
📚 💼, Oauth2⃣ ⏮️ ↔ 💪 👹.
✋️ 🚥 👆 💭 👆 💪 ⚫️, ⚖️ 👆 😟, 🚧 👂.
## Oauth2⃣ ↔ &amp; 🗄
Oauth2⃣ 🔧 🔬 "↔" 📇 🎻 🎏 🚀.
🎚 🔠 👉 🎻 💪 ✔️ 🙆 📁, ✋️ 🔜 🚫 🔌 🚀.
👫 ↔ 🎨 "✔".
🗄 (✅ 🛠️ 🩺), 👆 💪 🔬 "💂‍♂ ⚖".
🕐❔ 1⃣ 👫 💂‍♂ ⚖ ⚙️ Oauth2⃣, 👆 💪 📣 &amp; ⚙️ ↔.
🔠 "↔" 🎻 (🍵 🚀).
👫 🛎 ⚙️ 📣 🎯 💂‍♂ ✔, 🖼:
* `users:read` ⚖️ `users:write` ⚠ 🖼.
* `instagram_basic` ⚙️ 👱📔 / 👱📔.
* `https://www.googleapis.com/auth/drive` ⚙️ 🇺🇸🔍.
!!! info
Oauth2⃣ "↔" 🎻 👈 📣 🎯 ✔ ✔.
⚫️ 🚫 🤔 🚥 ⚫️ ✔️ 🎏 🦹 💖 `:` ⚖️ 🚥 ⚫️ 📛.
👈 🛠️ 🎯.
Oauth2⃣ 👫 🎻.
## 🌐 🎑
🥇, ➡️ 🔜 👀 🍕 👈 🔀 ⚪️➡️ 🖼 👑 **🔰 - 👩‍💻 🦮** [Oauth2⃣ ⏮️ 🔐 (&amp; 🔁), 📨 ⏮️ 🥙 🤝](../../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 155"
{!../../../docs_src/security/tutorial005.py!}
```
🔜 ➡️ 📄 👈 🔀 🔁 🔁.
## Oauth2⃣ 💂‍♂ ⚖
🥇 🔀 👈 🔜 👥 📣 Oauth2⃣ 💂‍♂ ⚖ ⏮️ 2⃣ 💪 ↔, `me` &amp; `items`.
`scopes` 🔢 📨 `dict` ⏮️ 🔠 ↔ 🔑 &amp; 📛 💲:
```Python hl_lines="62-65"
{!../../../docs_src/security/tutorial005.py!}
```
↩️ 👥 🔜 📣 📚 ↔, 👫 🔜 🎦 🆙 🛠️ 🩺 🕐❔ 👆 🕹-/✔.
&amp; 👆 🔜 💪 🖊 ❔ ↔ 👆 💚 🤝 🔐: `me` &amp; `items`.
👉 🎏 🛠️ ⚙️ 🕐❔ 👆 🤝 ✔ ⏪ 🚨 ⏮️ 👱📔, 🇺🇸🔍, 📂, ♒️:
<img src="/img/tutorial/security/image11.png">
## 🥙 🤝 ⏮️ ↔
🔜, 🔀 🤝 *➡ 🛠️* 📨 ↔ 📨.
👥 ⚙️ 🎏 `OAuth2PasswordRequestForm`. ⚫️ 🔌 🏠 `scopes` ⏮️ `list` `str`, ⏮️ 🔠 ↔ ⚫️ 📨 📨.
&amp; 👥 📨 ↔ 🍕 🥙 🤝.
!!! danger
🦁, 📥 👥 ❎ ↔ 📨 🔗 🤝.
✋️ 👆 🈸, 💂‍♂, 👆 🔜 ⚒ 💭 👆 🕴 🚮 ↔ 👈 👩‍💻 🤙 💪 ✔️, ⚖️ 🕐 👆 ✔️ 🔁.
```Python hl_lines="155"
{!../../../docs_src/security/tutorial005.py!}
```
## 📣 ↔ *➡ 🛠️* &amp; 🔗
🔜 👥 📣 👈 *➡ 🛠️* `/users/me/items/` 🚚 ↔ `items`.
👉, 👥 🗄 &amp; ⚙️ `Security` ⚪️➡️ `fastapi`.
👆 💪 ⚙️ `Security` 📣 🔗 (💖 `Depends`), ✋️ `Security` 📨 🔢 `scopes` ⏮️ 📇 ↔ (🎻).
👉 💼, 👥 🚶‍♀️ 🔗 🔢 `get_current_active_user` `Security` (🎏 🌌 👥 🔜 ⏮️ `Depends`).
✋️ 👥 🚶‍♀️ `list` ↔, 👉 💼 ⏮️ 1⃣ ↔: `items` (⚫️ 💪 ✔️ 🌅).
&amp; 🔗 🔢 `get_current_active_user` 💪 📣 🎧-🔗, 🚫 🕴 ⏮️ `Depends` ✋️ ⏮️ `Security`. 📣 🚮 👍 🎧-🔗 🔢 (`get_current_user`), &amp; 🌖 ↔ 📄.
👉 💼, ⚫️ 🚚 ↔ `me` (⚫️ 💪 🚚 🌅 🌘 1⃣ ↔).
!!! note
👆 🚫 🎯 💪 🚮 🎏 ↔ 🎏 🥉.
👥 🔨 ⚫️ 📥 🎦 ❔ **FastAPI** 🍵 ↔ 📣 🎏 🎚.
```Python hl_lines="4 139 168"
{!../../../docs_src/security/tutorial005.py!}
```
!!! info "📡 "
`Security` 🤙 🏿 `Depends`, &amp; ⚫️ ✔️ 1 🔢 👈 👥 🔜 👀 ⏪.
✋️ ⚙️ `Security` ↩️ `Depends`, **FastAPI** 🔜 💭 👈 ⚫️ 💪 📣 💂‍♂ ↔, ⚙️ 👫 🔘, &amp; 📄 🛠️ ⏮️ 🗄.
✋️ 🕐❔ 👆 🗄 `Query`, `Path`, `Depends`, `Security` &amp; 🎏 ⚪️➡️ `fastapi`, 👈 🤙 🔢 👈 📨 🎁 🎓.
## ⚙️ `SecurityScopes`
🔜 🔗 `get_current_user`.
👉 1⃣ ⚙️ 🔗 🔛.
📥 👥 ⚙️ 🎏 Oauth2⃣ ⚖ 👥 ✍ ⏭, 📣 ⚫️ 🔗: `oauth2_scheme`.
↩️ 👉 🔗 🔢 🚫 ✔️ 🙆 ↔ 📄 ⚫️, 👥 💪 ⚙️ `Depends` ⏮️ `oauth2_scheme`, 👥 🚫 ✔️ ⚙️ `Security` 🕐❔ 👥 🚫 💪 ✔ 💂‍♂ ↔.
👥 📣 🎁 🔢 🆎 `SecurityScopes`, 🗄 ⚪️➡️ `fastapi.security`.
👉 `SecurityScopes` 🎓 🎏 `Request` (`Request` ⚙️ 🤚 📨 🎚 🔗).
```Python hl_lines="8 105"
{!../../../docs_src/security/tutorial005.py!}
```
## ⚙️ `scopes`
🔢 `security_scopes` 🔜 🆎 `SecurityScopes`.
⚫️ 🔜 ✔️ 🏠 `scopes` ⏮️ 📇 ⚗ 🌐 ↔ ✔ ⚫️ &amp; 🌐 🔗 👈 ⚙️ 👉 🎧-🔗. 👈 ⛓, 🌐 "⚓️"... 👉 💪 🔊 😨, ⚫️ 🔬 🔄 ⏪ 🔛.
`security_scopes` 🎚 (🎓 `SecurityScopes`) 🚚 `scope_str` 🔢 ⏮️ 👁 🎻, 🔌 👈 ↔ 👽 🚀 (👥 🔜 ⚙️ ⚫️).
👥 ✍ `HTTPException` 👈 👥 💪 🏤-⚙️ (`raise`) ⏪ 📚 ☝.
👉 ⚠, 👥 🔌 ↔ 🚚 (🚥 🙆) 🎻 👽 🚀 (⚙️ `scope_str`). 👥 🚮 👈 🎻 ⚗ ↔ `WWW-Authenticate` 🎚 (👉 🍕 🔌).
```Python hl_lines="105 107-115"
{!../../../docs_src/security/tutorial005.py!}
```
## ✔ `username` &amp; 💽 💠
👥 ✔ 👈 👥 🤚 `username`, &amp; ⚗ ↔.
&amp; ⤴️ 👥 ✔ 👈 📊 ⏮️ Pydantic 🏷 (✊ `ValidationError` ⚠), &amp; 🚥 👥 🤚 ❌ 👂 🥙 🤝 ⚖️ ⚖ 📊 ⏮️ Pydantic, 👥 🤚 `HTTPException` 👥 ✍ ⏭.
👈, 👥 Pydantic 🏷 `TokenData` ⏮️ 🆕 🏠 `scopes`.
⚖ 📊 ⏮️ Pydantic 👥 💪 ⚒ 💭 👈 👥 ✔️, 🖼, ⚫️❔ `list` `str` ⏮️ ↔ &amp; `str` ⏮️ `username`.
↩️, 🖼, `dict`, ⚖️ 🕳 🙆, ⚫️ 💪 💔 🈸 ☝ ⏪, ⚒ ⚫️ 💂‍♂ ⚠.
👥 ✔ 👈 👥 ✔️ 👩‍💻 ⏮️ 👈 🆔, &amp; 🚥 🚫, 👥 🤚 👈 🎏 ⚠ 👥 ✍ ⏭.
```Python hl_lines="46 116-127"
{!../../../docs_src/security/tutorial005.py!}
```
## ✔ `scopes`
👥 🔜 ✔ 👈 🌐 ↔ ✔, 👉 🔗 &amp; 🌐 ⚓️ (🔌 *➡ 🛠️*), 🔌 ↔ 🚚 🤝 📨, ⏪ 🤚 `HTTPException`.
👉, 👥 ⚙️ `security_scopes.scopes`, 👈 🔌 `list` ⏮️ 🌐 👫 ↔ `str`.
```Python hl_lines="128-134"
{!../../../docs_src/security/tutorial005.py!}
```
## 🔗 🌲 &amp; ↔
➡️ 📄 🔄 👉 🔗 🌲 &amp; ↔.
`get_current_active_user` 🔗 ✔️ 🎧-🔗 🔛 `get_current_user`, ↔ `"me"` 📣 `get_current_active_user` 🔜 🔌 📇 ✔ ↔ `security_scopes.scopes` 🚶‍♀️ `get_current_user`.
*➡ 🛠️* ⚫️ 📣 ↔, `"items"`, 👉 🔜 📇 `security_scopes.scopes` 🚶‍♀️ `get_current_user`.
📥 ❔ 🔗 🔗 &amp; ↔ 👀 💖:
* *➡ 🛠️* `read_own_items` ✔️:
* ✔ ↔ `["items"]` ⏮️ 🔗:
* `get_current_active_user`:
* 🔗 🔢 `get_current_active_user` ✔️:
* ✔ ↔ `["me"]` ⏮️ 🔗:
* `get_current_user`:
* 🔗 🔢 `get_current_user` ✔️:
* 🙅‍♂ ↔ ✔ ⚫️.
* 🔗 ⚙️ `oauth2_scheme`.
* `security_scopes` 🔢 🆎 `SecurityScopes`:
* 👉 `security_scopes` 🔢 ✔️ 🏠 `scopes` ⏮️ `list` ⚗ 🌐 👫 ↔ 📣 🔛,:
* `security_scopes.scopes` 🔜 🔌 `["me", "items"]` *➡ 🛠️* `read_own_items`.
* `security_scopes.scopes` 🔜 🔌 `["me"]` *➡ 🛠️* `read_users_me`, ↩️ ⚫️ 📣 🔗 `get_current_active_user`.
* `security_scopes.scopes` 🔜 🔌 `[]` (🕳) *➡ 🛠️* `read_system_status`, ↩️ ⚫️ 🚫 📣 🙆 `Security` ⏮️ `scopes`, &amp; 🚮 🔗, `get_current_user`, 🚫 📣 🙆 `scope` 👯‍♂️.
!!! tip
⚠ &amp; "🎱" 👜 📥 👈 `get_current_user` 🔜 ✔️ 🎏 📇 `scopes` ✅ 🔠 *➡ 🛠️*.
🌐 ⚓️ 🔛 `scopes` 📣 🔠 *➡ 🛠️* &amp; 🔠 🔗 🔗 🌲 👈 🎯 *➡ 🛠️*.
## 🌖 🔃 `SecurityScopes`
👆 💪 ⚙️ `SecurityScopes` 🙆 ☝, &amp; 💗 🥉, ⚫️ 🚫 ✔️ "🌱" 🔗.
⚫️ 🔜 🕧 ✔️ 💂‍♂ ↔ 📣 ⏮️ `Security` 🔗 &amp; 🌐 ⚓️ **👈 🎯** *➡ 🛠️* &amp; **👈 🎯** 🔗 🌲.
↩️ `SecurityScopes` 🔜 ✔️ 🌐 ↔ 📣 ⚓️, 👆 💪 ⚙️ ⚫️ ✔ 👈 🤝 ✔️ 🚚 ↔ 🇨🇫 🔗 🔢, &amp; ⤴️ 📣 🎏 ↔ 📄 🎏 *➡ 🛠️*.
👫 🔜 ✅ ➡ 🔠 *➡ 🛠️*.
## ✅ ⚫️
🚥 👆 📂 🛠️ 🩺, 👆 💪 🔓 &amp; ✔ ❔ ↔ 👆 💚 ✔.
<img src="/img/tutorial/security/image11.png">
🚥 👆 🚫 🖊 🙆 ↔, 👆 🔜 "🔓", ✋️ 🕐❔ 👆 🔄 🔐 `/users/me/` ⚖️ `/users/me/items/` 👆 🔜 🤚 ❌ 💬 👈 👆 🚫 ✔️ 🥃 ✔. 👆 🔜 💪 🔐 `/status/`.
&amp; 🚥 👆 🖊 ↔ `me` ✋️ 🚫 ↔ `items`, 👆 🔜 💪 🔐 `/users/me/` ✋️ 🚫 `/users/me/items/`.
👈 ⚫️❔ 🔜 🔨 🥉 🥳 🈸 👈 🔄 🔐 1⃣ 👫 *➡ 🛠️* ⏮️ 🤝 🚚 👩‍💻, ⚓️ 🔛 ❔ 📚 ✔ 👩‍💻 🤝 🈸.
## 🔃 🥉 🥳 🛠️
👉 🖼 👥 ⚙️ Oauth2⃣ "🔐" 💧.
👉 ☑ 🕐❔ 👥 🚨 👆 👍 🈸, 🎲 ⏮️ 👆 👍 🕸.
↩️ 👥 💪 💙 ⚫️ 📨 `username` &amp; `password`, 👥 🎛 ⚫️.
✋️ 🚥 👆 🏗 Oauth2⃣ 🈸 👈 🎏 🔜 🔗 (➡, 🚥 👆 🏗 🤝 🐕‍🦺 🌓 👱📔, 🇺🇸🔍, 📂, ♒️.) 👆 🔜 ⚙️ 1⃣ 🎏 💧.
🌅 ⚠ 🔑 💧.
🏆 🔐 📟 💧, ✋️ 🌖 🏗 🛠️ ⚫️ 🚚 🌅 📶. ⚫️ 🌅 🏗, 📚 🐕‍🦺 🔚 🆙 ✔ 🔑 💧.
!!! note
⚫️ ⚠ 👈 🔠 🤝 🐕‍🦺 📛 👫 💧 🎏 🌌, ⚒ ⚫️ 🍕 👫 🏷.
✋️ 🔚, 👫 🛠️ 🎏 Oauth2⃣ 🐩.
**FastAPI** 🔌 🚙 🌐 👫 Oauth2⃣ 🤝 💧 `fastapi.security.oauth2`.
## `Security` 👨‍🎨 `dependencies`
🎏 🌌 👆 💪 🔬 `list` `Depends` 👨‍🎨 `dependencies` 🔢 (🔬 [🔗 ➡ 🛠️ 👨‍🎨](../../tutorial/dependencies/dependencies-in-path-operation-decorators.md){.internal-link target=_blank}), 👆 💪 ⚙️ `Security` ⏮️ `scopes` 📤.

View File

@@ -0,0 +1,382 @@
# ⚒ &amp; 🌐 🔢
📚 💼 👆 🈸 💪 💪 🔢 ⚒ ⚖️ 📳, 🖼 ㊙ 🔑, 💽 🎓, 🎓 📧 🐕‍🦺, ♒️.
🏆 👫 ⚒ 🔢 (💪 🔀), 💖 💽 📛. &amp; 📚 💪 🚿, 💖 ㊙.
👉 🤔 ⚫️ ⚠ 🚚 👫 🌐 🔢 👈 ✍ 🈸.
## 🌐 🔢
!!! tip
🚥 👆 ⏪ 💭 ⚫️❔ "🌐 🔢" &amp; ❔ ⚙️ 👫, 💭 🆓 🚶 ⏭ 📄 🔛.
<a href="https://en.wikipedia.org/wiki/Environment_variable" class="external-link" target="_blank">🌐 🔢</a> (💭 "🇨🇻 {") 🔢 👈 🖖 🏞 🐍 📟, 🏃‍♂ ⚙️, &amp; 💪 ✍ 👆 🐍 📟 (⚖️ 🎏 📋 👍).
👆 💪 ✍ &amp; ⚙️ 🌐 🔢 🐚, 🍵 💆‍♂ 🐍:
=== "💾, 🇸🇻, 🚪 🎉"
<div class="termy">
```console
// You could create an env var MY_NAME with
$ export MY_NAME="Wade Wilson"
// Then you could use it with other programs, like
$ echo "Hello $MY_NAME"
Hello Wade Wilson
```
</div>
=== "🚪 📋"
<div class="termy">
```console
// Create an env var MY_NAME
$ $Env:MY_NAME = "Wade Wilson"
// Use it with other programs, like
$ echo "Hello $Env:MY_NAME"
Hello Wade Wilson
```
</div>
### ✍ 🇨🇻 {🐍
👆 💪 ✍ 🌐 🔢 🏞 🐍, 📶 (⚖️ ⏮️ 🙆 🎏 👩‍🔬), &amp; ⤴️ ✍ 👫 🐍.
🖼 👆 💪 ✔️ 📁 `main.py` ⏮️:
```Python hl_lines="3"
import os
name = os.getenv("MY_NAME", "World")
print(f"Hello {name} from Python")
```
!!! tip
🥈 ❌ <a href="https://docs.python.org/3.8/library/os.html#os.getenv" class="external-link" target="_blank">`os.getenv()`</a> 🔢 💲 📨.
🚥 🚫 🚚, ⚫️ `None` 🔢, 📥 👥 🚚 `"World"` 🔢 💲 ⚙️.
⤴️ 👆 💪 🤙 👈 🐍 📋:
<div class="termy">
```console
// Here we don't set the env var yet
$ python main.py
// As we didn't set the env var, we get the default value
Hello World from Python
// But if we create an environment variable first
$ export MY_NAME="Wade Wilson"
// And then call the program again
$ python main.py
// Now it can read the environment variable
Hello Wade Wilson from Python
```
</div>
🌐 🔢 💪 ⚒ 🏞 📟, ✋️ 💪 ✍ 📟, &amp; 🚫 ✔️ 🏪 (💕 `git`) ⏮️ 🎂 📁, ⚫️ ⚠ ⚙️ 👫 📳 ⚖️ ⚒.
👆 💪 ✍ 🌐 🔢 🕴 🎯 📋 👼, 👈 🕴 💪 👈 📋, &amp; 🕴 🚮 📐.
👈, ✍ ⚫️ ▶️️ ⏭ 📋 ⚫️, 🔛 🎏 ⏸:
<div class="termy">
```console
// Create an env var MY_NAME in line for this program call
$ MY_NAME="Wade Wilson" python main.py
// Now it can read the environment variable
Hello Wade Wilson from Python
// The env var no longer exists afterwards
$ python main.py
Hello World from Python
```
</div>
!!! tip
👆 💪 ✍ 🌅 🔃 ⚫️ <a href="https://12factor.net/config" class="external-link" target="_blank">1⃣2⃣-⚖ 📱: 📁</a>.
### 🆎 &amp; 🔬
👫 🌐 🔢 💪 🕴 🍵 ✍ 🎻, 👫 🔢 🐍 &amp; ✔️ 🔗 ⏮️ 🎏 📋 &amp; 🎂 ⚙️ (&amp; ⏮️ 🎏 🏃‍♂ ⚙️, 💾, 🚪, 🇸🇻).
👈 ⛓ 👈 🙆 💲 ✍ 🐍 ⚪️➡️ 🌐 🔢 🔜 `str`, &amp; 🙆 🛠️ 🎏 🆎 ⚖️ 🔬 ✔️ 🔨 📟.
## Pydantic `Settings`
👐, Pydantic 🚚 👑 🚙 🍵 👫 ⚒ 👟 ⚪️➡️ 🌐 🔢 ⏮️ <a href="https://pydantic-docs.helpmanual.io/usage/settings/" class="external-link" target="_blank">Pydantic: ⚒ 🧾</a>.
### ✍ `Settings` 🎚
🗄 `BaseSettings` ⚪️➡️ Pydantic &amp; ✍ 🎧-🎓, 📶 🌅 💖 ⏮️ Pydantic 🏷.
🎏 🌌 ⏮️ Pydantic 🏷, 👆 📣 🎓 🔢 ⏮️ 🆎 ✍, &amp; 🎲 🔢 💲.
👆 💪 ⚙️ 🌐 🎏 🔬 ⚒ &amp; 🧰 👆 ⚙️ Pydantic 🏷, 💖 🎏 📊 🆎 &amp; 🌖 🔬 ⏮️ `Field()`.
```Python hl_lines="2 5-8 11"
{!../../../docs_src/settings/tutorial001.py!}
```
!!! tip
🚥 👆 💚 🕳 ⏩ 📁 &amp; 📋, 🚫 ⚙️ 👉 🖼, ⚙️ 🏁 1⃣ 🔛.
⤴️, 🕐❔ 👆 ✍ 👐 👈 `Settings` 🎓 (👉 💼, `settings` 🎚), Pydantic 🔜 ✍ 🌐 🔢 💼-😛 🌌,, ↖-💼 🔢 `APP_NAME` 🔜 ✍ 🔢 `app_name`.
⏭ ⚫️ 🔜 🗜 &amp; ✔ 💽. , 🕐❔ 👆 ⚙️ 👈 `settings` 🎚, 👆 🔜 ✔️ 📊 🆎 👆 📣 (✅ `items_per_user` 🔜 `int`).
### ⚙️ `settings`
⤴️ 👆 💪 ⚙️ 🆕 `settings` 🎚 👆 🈸:
```Python hl_lines="18-20"
{!../../../docs_src/settings/tutorial001.py!}
```
### 🏃 💽
⏭, 👆 🔜 🏃 💽 🚶‍♀️ 📳 🌐 🔢, 🖼 👆 💪 ⚒ `ADMIN_EMAIL` &amp; `APP_NAME` ⏮️:
<div class="termy">
```console
$ ADMIN_EMAIL="deadpool@example.com" APP_NAME="ChimichangApp" uvicorn main:app
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
!!! tip
⚒ 💗 🇨🇻 {👁 📋 🎏 👫 ⏮️ 🚀, &amp; 🚮 👫 🌐 ⏭ 📋.
&amp; ⤴️ `admin_email` ⚒ 🔜 ⚒ `"deadpool@example.com"`.
`app_name` 🔜 `"ChimichangApp"`.
&amp; `items_per_user` 🔜 🚧 🚮 🔢 💲 `50`.
## ⚒ 1⃣ 🕹
👆 💪 🚮 👈 ⚒ 1⃣ 🕹 📁 👆 👀 [🦏 🈸 - 💗 📁](../tutorial/bigger-applications.md){.internal-link target=_blank}.
🖼, 👆 💪 ✔️ 📁 `config.py` ⏮️:
```Python
{!../../../docs_src/settings/app01/config.py!}
```
&amp; ⤴️ ⚙️ ⚫️ 📁 `main.py`:
```Python hl_lines="3 11-13"
{!../../../docs_src/settings/app01/main.py!}
```
!!! tip
👆 🔜 💪 📁 `__init__.py` 👆 👀 🔛 [🦏 🈸 - 💗 📁](../tutorial/bigger-applications.md){.internal-link target=_blank}.
## ⚒ 🔗
🍾 ⚫️ 5⃣📆 ⚠ 🚚 ⚒ ⚪️➡️ 🔗, ↩️ ✔️ 🌐 🎚 ⏮️ `settings` 👈 ⚙️ 🌐.
👉 💪 ✴️ ⚠ ⏮️ 🔬, ⚫️ 📶 ⏩ 🔐 🔗 ⏮️ 👆 👍 🛃 ⚒.
### 📁 📁
👟 ⚪️➡️ ⏮️ 🖼, 👆 `config.py` 📁 💪 👀 💖:
```Python hl_lines="10"
{!../../../docs_src/settings/app02/config.py!}
```
👀 👈 🔜 👥 🚫 ✍ 🔢 👐 `settings = Settings()`.
### 👑 📱 📁
🔜 👥 ✍ 🔗 👈 📨 🆕 `config.Settings()`.
```Python hl_lines="5 11-12"
{!../../../docs_src/settings/app02/main.py!}
```
!!! tip
👥 🔜 🔬 `@lru_cache` 🍖.
🔜 👆 💪 🤔 `get_settings()` 😐 🔢.
&amp; ⤴️ 👥 💪 🚚 ⚫️ ⚪️➡️ *➡ 🛠️ 🔢* 🔗 &amp; ⚙️ ⚫️ 🙆 👥 💪 ⚫️.
```Python hl_lines="16 18-20"
{!../../../docs_src/settings/app02/main.py!}
```
### ⚒ &amp; 🔬
⤴️ ⚫️ 🔜 📶 ⏩ 🚚 🎏 ⚒ 🎚 ⏮️ 🔬 🏗 🔗 🔐 `get_settings`:
```Python hl_lines="9-10 13 21"
{!../../../docs_src/settings/app02/test_main.py!}
```
🔗 🔐 👥 ⚒ 🆕 💲 `admin_email` 🕐❔ 🏗 🆕 `Settings` 🎚, &amp; ⤴️ 👥 📨 👈 🆕 🎚.
⤴️ 👥 💪 💯 👈 ⚫️ ⚙️.
## 👂 `.env` 📁
🚥 👆 ✔️ 📚 ⚒ 👈 🎲 🔀 📚, 🎲 🎏 🌐, ⚫️ 5⃣📆 ⚠ 🚮 👫 🔛 📁 &amp; ⤴️ ✍ 👫 ⚪️➡️ ⚫️ 🚥 👫 🌐 🔢.
👉 💡 ⚠ 🥃 👈 ⚫️ ✔️ 📛, 👫 🌐 🔢 🛎 🥉 📁 `.env`, &amp; 📁 🤙 "🇨🇻".
!!! tip
📁 ▶️ ⏮️ ❣ (`.`) 🕵‍♂ 📁 🖥-💖 ⚙️, 💖 💾 &amp; 🇸🇻.
✋️ 🇨🇻 📁 🚫 🤙 ✔️ ✔️ 👈 ☑ 📁.
Pydantic ✔️ 🐕‍🦺 👂 ⚪️➡️ 👉 🆎 📁 ⚙️ 🔢 🗃. 👆 💪 ✍ 🌖 <a href="https://docs.pydantic.dev/latest/concepts/pydantic_settings/#dotenv-env-support" class="external-link" target="_blank">Pydantic ⚒: 🇨🇻 (.🇨🇻) 🐕‍🦺</a>.
!!! tip
👉 👷, 👆 💪 `pip install python-dotenv`.
### `.env` 📁
👆 💪 ✔️ `.env` 📁 ⏮️:
```bash
ADMIN_EMAIL="deadpool@example.com"
APP_NAME="ChimichangApp"
```
### ✍ ⚒ ⚪️➡️ `.env`
&amp; ⤴️ 👆 `config.py` ⏮️:
```Python hl_lines="9-10"
{!../../../docs_src/settings/app03/config.py!}
```
📥 👥 ✍ 🎓 `Config` 🔘 👆 Pydantic `Settings` 🎓, &amp; ⚒ `env_file` 📁 ⏮️ 🇨🇻 📁 👥 💚 ⚙️.
!!! tip
`Config` 🎓 ⚙️ Pydantic 📳. 👆 💪 ✍ 🌖 <a href="https://pydantic-docs.helpmanual.io/usage/model_config/" class="external-link" target="_blank">Pydantic 🏷 📁</a>
### 🏗 `Settings` 🕴 🕐 ⏮️ `lru_cache`
👂 📁 ⚪️➡️ 💾 🛎 ⚠ (🐌) 🛠️, 👆 🎲 💚 ⚫️ 🕴 🕐 &amp; ⤴️ 🏤-⚙️ 🎏 ⚒ 🎚, ↩️ 👂 ⚫️ 🔠 📨.
✋️ 🔠 🕰 👥:
```Python
Settings()
```
🆕 `Settings` 🎚 🔜 ✍, &amp; 🏗 ⚫️ 🔜 ✍ `.env` 📁 🔄.
🚥 🔗 🔢 💖:
```Python
def get_settings():
return Settings()
```
👥 🔜 ✍ 👈 🎚 🔠 📨, &amp; 👥 🔜 👂 `.env` 📁 🔠 📨. 👶 👶
✋️ 👥 ⚙️ `@lru_cache` 👨‍🎨 🔛 🔝, `Settings` 🎚 🔜 ✍ 🕴 🕐, 🥇 🕰 ⚫️ 🤙. 👶 👶
```Python hl_lines="1 10"
{!../../../docs_src/settings/app03/main.py!}
```
⤴️ 🙆 🏁 🤙 `get_settings()` 🔗 ⏭ 📨, ↩️ 🛠️ 🔗 📟 `get_settings()` &amp; 🏗 🆕 `Settings` 🎚, ⚫️ 🔜 📨 🎏 🎚 👈 📨 🔛 🥇 🤙, 🔄 &amp; 🔄.
#### `lru_cache` 📡
`@lru_cache` 🔀 🔢 ⚫️ 🎀 📨 🎏 💲 👈 📨 🥇 🕰, ↩️ 💻 ⚫️ 🔄, 🛠️ 📟 🔢 🔠 🕰.
, 🔢 🔛 ⚫️ 🔜 🛠️ 🕐 🔠 🌀 ❌. &amp; ⤴️ 💲 📨 🔠 👈 🌀 ❌ 🔜 ⚙️ 🔄 &amp; 🔄 🕐❔ 🔢 🤙 ⏮️ ⚫️❔ 🎏 🌀 ❌.
🖼, 🚥 👆 ✔️ 🔢:
```Python
@lru_cache
def say_hi(name: str, salutation: str = "Ms."):
return f"Hello {salutation} {name}"
```
👆 📋 💪 🛠️ 💖 👉:
```mermaid
sequenceDiagram
participant code as Code
participant function as say_hi()
participant execute as Execute function
rect rgba(0, 255, 0, .1)
code ->> function: say_hi(name="Camila")
function ->> execute: execute function code
execute ->> code: return the result
end
rect rgba(0, 255, 255, .1)
code ->> function: say_hi(name="Camila")
function ->> code: return stored result
end
rect rgba(0, 255, 0, .1)
code ->> function: say_hi(name="Rick")
function ->> execute: execute function code
execute ->> code: return the result
end
rect rgba(0, 255, 0, .1)
code ->> function: say_hi(name="Rick", salutation="Mr.")
function ->> execute: execute function code
execute ->> code: return the result
end
rect rgba(0, 255, 255, .1)
code ->> function: say_hi(name="Rick")
function ->> code: return stored result
end
rect rgba(0, 255, 255, .1)
code ->> function: say_hi(name="Camila")
function ->> code: return stored result
end
```
💼 👆 🔗 `get_settings()`, 🔢 🚫 ✊ 🙆 ❌, ⚫️ 🕧 📨 🎏 💲.
👈 🌌, ⚫️ 🎭 🌖 🚥 ⚫️ 🌐 🔢. ✋️ ⚫️ ⚙️ 🔗 🔢, ⤴️ 👥 💪 🔐 ⚫️ 💪 🔬.
`@lru_cache` 🍕 `functools` ❔ 🍕 🐍 🐩 🗃, 👆 💪 ✍ 🌅 🔃 ⚫️ <a href="https://docs.python.org/3/library/functools.html#functools.lru_cache" class="external-link" target="_blank">🐍 🩺 `@lru_cache`</a>.
## 🌃
👆 💪 ⚙️ Pydantic ⚒ 🍵 ⚒ ⚖️ 📳 👆 🈸, ⏮️ 🌐 🏋️ Pydantic 🏷.
* ⚙️ 🔗 👆 💪 📉 🔬.
* 👆 💪 ⚙️ `.env` 📁 ⏮️ ⚫️.
* ⚙️ `@lru_cache` ➡️ 👆 ❎ 👂 🇨🇻 📁 🔄 &amp; 🔄 🔠 📨, ⏪ 🤝 👆 🔐 ⚫️ ⏮️ 🔬.

View File

@@ -0,0 +1,73 @@
# 🎧 🈸 - 🗻
🚥 👆 💪 ✔️ 2⃣ 🔬 FastAPI 🈸, ⏮️ 👫 👍 🔬 🗄 &amp; 👫 👍 🩺 ⚜, 👆 💪 ✔️ 👑 📱 &amp; "🗻" 1⃣ (⚖️ 🌅) 🎧-🈸(Ⓜ).
## 🗜 **FastAPI** 🈸
"🗜" ⛓ ❎ 🍕 "🔬" 🈸 🎯 ➡, 👈 ⤴️ ✊ 💅 🚚 🌐 🔽 👈 ➡, ⏮️ _➡ 🛠️_ 📣 👈 🎧-🈸.
### 🔝-🎚 🈸
🥇, ✍ 👑, 🔝-🎚, **FastAPI** 🈸, &amp; 🚮 *➡ 🛠️*:
```Python hl_lines="3 6-8"
{!../../../docs_src/sub_applications/tutorial001.py!}
```
### 🎧-🈸
⤴️, ✍ 👆 🎧-🈸, &amp; 🚮 *➡ 🛠️*.
👉 🎧-🈸 1⃣ 🐩 FastAPI 🈸, ✋️ 👉 1⃣ 👈 🔜 "🗻":
```Python hl_lines="11 14-16"
{!../../../docs_src/sub_applications/tutorial001.py!}
```
### 🗻 🎧-🈸
👆 🔝-🎚 🈸, `app`, 🗻 🎧-🈸, `subapi`.
👉 💼, ⚫️ 🔜 📌 ➡ `/subapi`:
```Python hl_lines="11 19"
{!../../../docs_src/sub_applications/tutorial001.py!}
```
### ✅ 🏧 🛠️ 🩺
🔜, 🏃 `uvicorn` ⏮️ 👑 📱, 🚥 👆 📁 `main.py`, ⚫️ 🔜:
<div class="termy">
```console
$ uvicorn main:app --reload
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
&amp; 📂 🩺 <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
👆 🔜 👀 🏧 🛠️ 🩺 👑 📱, 🔌 🕴 🚮 👍 _➡ 🛠_:
<img src="/img/tutorial/sub-applications/image01.png">
&amp; ⤴️, 📂 🩺 🎧-🈸, <a href="http://127.0.0.1:8000/subapi/docs" class="external-link" target="_blank">http://127.0.0.1:8000/subapi/docs</a>.
👆 🔜 👀 🏧 🛠️ 🩺 🎧-🈸, ✅ 🕴 🚮 👍 _➡ 🛠_, 🌐 🔽 ☑ 🎧-➡ 🔡 `/subapi`:
<img src="/img/tutorial/sub-applications/image02.png">
🚥 👆 🔄 🔗 ⏮️ 🙆 2⃣ 👩‍💻 🔢, 👫 🔜 👷 ☑, ↩️ 🖥 🔜 💪 💬 🔠 🎯 📱 ⚖️ 🎧-📱.
### 📡 : `root_path`
🕐❔ 👆 🗻 🎧-🈸 🔬 🔛, FastAPI 🔜 ✊ 💅 🔗 🗻 ➡ 🎧-🈸 ⚙️ 🛠️ ⚪️➡️ 🔫 🔧 🤙 `root_path`.
👈 🌌, 🎧-🈸 🔜 💭 ⚙️ 👈 ➡ 🔡 🩺 🎚.
&amp; 🎧-🈸 💪 ✔️ 🚮 👍 📌 🎧-🈸 &amp; 🌐 🔜 👷 ☑, ↩️ FastAPI 🍵 🌐 👉 `root_path`Ⓜ 🔁.
👆 🔜 💡 🌅 🔃 `root_path` &amp; ❔ ⚙️ ⚫️ 🎯 📄 🔃 [⛅ 🗳](./behind-a-proxy.md){.internal-link target=_blank}.

View File

@@ -0,0 +1,77 @@
# 📄
👆 💪 ⚙️ 🙆 📄 🚒 👆 💚 ⏮️ **FastAPI**.
⚠ ⚒ Jinja2⃣, 🎏 1⃣ ⚙️ 🏺 &amp; 🎏 🧰.
📤 🚙 🔗 ⚫️ 💪 👈 👆 💪 ⚙️ 🔗 👆 **FastAPI** 🈸 (🚚 💃).
## ❎ 🔗
`jinja2`:
<div class="termy">
```console
$ pip install jinja2
---> 100%
```
</div>
## ⚙️ `Jinja2Templates`
* 🗄 `Jinja2Templates`.
*`templates` 🎚 👈 👆 💪 🏤-⚙️ ⏪.
* 📣 `Request` 🔢 *➡ 🛠️* 👈 🔜 📨 📄.
* ⚙️ `templates` 👆 ✍ ✍ &amp; 📨 `TemplateResponse`, 🚶‍♀️ `request` 1⃣ 🔑-💲 👫 Jinja2⃣ "🔑".
```Python hl_lines="4 11 15-18"
{!../../../docs_src/templates/tutorial001.py!}
```
!!! note
👀 👈 👆 ✔️ 🚶‍♀️ `request` 🍕 🔑-💲 👫 🔑 Jinja2⃣. , 👆 ✔️ 📣 ⚫️ 👆 *➡ 🛠️*.
!!! tip
📣 `response_class=HTMLResponse` 🩺 🎚 🔜 💪 💭 👈 📨 🔜 🕸.
!!! note "📡 "
👆 💪 ⚙️ `from starlette.templating import Jinja2Templates`.
**FastAPI** 🚚 🎏 `starlette.templating` `fastapi.templating` 🏪 👆, 👩‍💻. ✋️ 🌅 💪 📨 👟 🔗 ⚪️➡️ 💃. 🎏 ⏮️ `Request` &amp; `StaticFiles`.
## ✍ 📄
⤴️ 👆 💪 ✍ 📄 `templates/item.html` ⏮️:
```jinja hl_lines="7"
{!../../../docs_src/templates/templates/item.html!}
```
⚫️ 🔜 🎦 `id` ✊ ⚪️➡️ "🔑" `dict` 👆 🚶‍♀️:
```Python
{"request": request, "id": id}
```
## 📄 &amp; 🎻 📁
&amp; 👆 💪 ⚙️ `url_for()` 🔘 📄, &amp; ⚙️ ⚫️, 🖼, ⏮️ `StaticFiles` 👆 📌.
```jinja hl_lines="4"
{!../../../docs_src/templates/templates/item.html!}
```
👉 🖼, ⚫️ 🔜 🔗 🎚 📁 `static/styles.css` ⏮️:
```CSS hl_lines="4"
{!../../../docs_src/templates/static/styles.css!}
```
&amp; ↩️ 👆 ⚙️ `StaticFiles`, 👈 🎚 📁 🔜 🍦 🔁 👆 **FastAPI** 🈸 📛 `/static/styles.css`.
## 🌅
🌅 , 🔌 ❔ 💯 📄, ✅ <a href="https://www.starlette.io/templates/" class="external-link" target="_blank">💃 🩺 🔛 📄</a>.

View File

@@ -0,0 +1,95 @@
# 🔬 💽
👆 💪 ⚙️ 🎏 🔗 🔐 ⚪️➡️ [🔬 🔗 ⏮️ 🔐](testing-dependencies.md){.internal-link target=_blank} 📉 💽 🔬.
👆 💪 💚 ⚒ 🆙 🎏 💽 🔬, 💾 💽 ⏮️ 💯, 🏤-🥧 ⚫️ ⏮️ 🔬 💽, ♒️.
👑 💭 ⚫️❔ 🎏 👆 👀 👈 ⏮️ 📃.
## 🚮 💯 🗄 📱
➡️ 🖼 ⚪️➡️ [🗄 (🔗) 💽](../tutorial/sql-databases.md){.internal-link target=_blank} ⚙️ 🔬 💽.
🌐 📱 📟 🎏, 👆 💪 🚶 🔙 👈 📃 ✅ ❔ ⚫️.
🕴 🔀 📥 🆕 🔬 📁.
👆 😐 🔗 `get_db()` 🔜 📨 💽 🎉.
💯, 👆 💪 ⚙️ 🔗 🔐 📨 👆 *🛃* 💽 🎉 ↩️ 1⃣ 👈 🔜 ⚙️ 🛎.
👉 🖼 👥 🔜 ✍ 🍕 💽 🕴 💯.
## 📁 📊
👥 ✍ 🆕 📁 `sql_app/tests/test_sql_app.py`.
🆕 📁 📊 👀 💖:
``` hl_lines="9-11"
.
└── sql_app
├── __init__.py
├── crud.py
├── database.py
├── main.py
├── models.py
├── schemas.py
└── tests
├── __init__.py
└── test_sql_app.py
```
## ✍ 🆕 💽 🎉
🥇, 👥 ✍ 🆕 💽 🎉 ⏮️ 🆕 💽.
💯 👥 🔜 ⚙️ 📁 `test.db` ↩️ `sql_app.db`.
✋️ 🎂 🎉 📟 🌅 ⚖️ 🌘 🎏, 👥 📁 ⚫️.
```Python hl_lines="8-13"
{!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
```
!!! tip
👆 💪 📉 ❎ 👈 📟 🚮 ⚫️ 🔢 &amp; ⚙️ ⚫️ ⚪️➡️ 👯‍♂️ `database.py` &amp; `tests/test_sql_app.py`.
🦁 &amp; 🎯 🔛 🎯 🔬 📟, 👥 🖨 ⚫️.
## ✍ 💽
↩️ 🔜 👥 🔜 ⚙️ 🆕 💽 🆕 📁, 👥 💪 ⚒ 💭 👥 ✍ 💽 ⏮️:
```Python
Base.metadata.create_all(bind=engine)
```
👈 🛎 🤙 `main.py`, ✋️ ⏸ `main.py` ⚙️ 💽 📁 `sql_app.db`, &amp; 👥 💪 ⚒ 💭 👥 ✍ `test.db` 💯.
👥 🚮 👈 ⏸ 📥, ⏮️ 🆕 📁.
```Python hl_lines="16"
{!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
```
## 🔗 🔐
🔜 👥 ✍ 🔗 🔐 &amp; 🚮 ⚫️ 🔐 👆 📱.
```Python hl_lines="19-24 27"
{!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
```
!!! tip
📟 `override_get_db()` 🌖 ⚫️❔ 🎏 `get_db()`, ✋️ `override_get_db()` 👥 ⚙️ `TestingSessionLocal` 🔬 💽 ↩️.
## 💯 📱
⤴️ 👥 💪 💯 📱 🛎.
```Python hl_lines="32-47"
{!../../../docs_src/sql_databases/sql_app/tests/test_sql_app.py!}
```
&amp; 🌐 🛠️ 👥 ⚒ 💽 ⏮️ 💯 🔜 `test.db` 💽 ↩️ 👑 `sql_app.db`.

View File

@@ -0,0 +1,49 @@
# 🔬 🔗 ⏮️ 🔐
## 🔑 🔗 ⏮️ 🔬
📤 😐 🌐❔ 👆 💪 💚 🔐 🔗 ⏮️ 🔬.
👆 🚫 💚 ⏮️ 🔗 🏃 (🚫 🙆 🎧-🔗 ⚫️ 💪 ✔️).
↩️, 👆 💚 🚚 🎏 🔗 👈 🔜 ⚙️ 🕴 ⏮️ 💯 (🎲 🕴 🎯 💯), &amp; 🔜 🚚 💲 👈 💪 ⚙️ 🌐❔ 💲 ⏮️ 🔗 ⚙️.
### ⚙️ 💼: 🔢 🐕‍🦺
🖼 💪 👈 👆 ✔️ 🔢 🤝 🐕‍🦺 👈 👆 💪 🤙.
👆 📨 ⚫️ 🤝 &amp; ⚫️ 📨 🔓 👩‍💻.
👉 🐕‍🦺 5⃣📆 🔌 👆 📍 📨, &amp; 🤙 ⚫️ 💪 ✊ 🕰 🌘 🚥 👆 ✔️ 🔧 🎁 👩‍💻 💯.
👆 🎲 💚 💯 🔢 🐕‍🦺 🕐, ✋️ 🚫 🎯 🤙 ⚫️ 🔠 💯 👈 🏃.
👉 💼, 👆 💪 🔐 🔗 👈 🤙 👈 🐕‍🦺, &amp; ⚙️ 🛃 🔗 👈 📨 🎁 👩‍💻, 🕴 👆 💯.
### ⚙️ `app.dependency_overrides` 🔢
👫 💼, 👆 **FastAPI** 🈸 ✔️ 🔢 `app.dependency_overrides`, ⚫️ 🙅 `dict`.
🔐 🔗 🔬, 👆 🚮 🔑 ⏮️ 🔗 (🔢), &amp; 💲, 👆 🔗 🔐 (1⃣ 🔢).
&amp; ⤴️ **FastAPI** 🔜 🤙 👈 🔐 ↩️ ⏮️ 🔗.
```Python hl_lines="28-29 32"
{!../../../docs_src/dependency_testing/tutorial001.py!}
```
!!! tip
👆 💪 ⚒ 🔗 🔐 🔗 ⚙️ 🙆 👆 **FastAPI** 🈸.
⏮️ 🔗 💪 ⚙️ *➡ 🛠️ 🔢*, *➡ 🛠️ 👨‍🎨* (🕐❔ 👆 🚫 ⚙️ 📨 💲), `.include_router()` 🤙, ♒️.
FastAPI 🔜 💪 🔐 ⚫️.
⤴️ 👆 💪 ⏲ 👆 🔐 (❎ 👫) ⚒ `app.dependency_overrides` 🛁 `dict`:
```Python
app.dependency_overrides = {}
```
!!! tip
🚥 👆 💚 🔐 🔗 🕴 ⏮️ 💯, 👆 💪 ⚒ 🔐 ▶️ 💯 (🔘 💯 🔢) &amp; ⏲ ⚫️ 🔚 (🔚 💯 🔢).

View File

@@ -0,0 +1,7 @@
# 🔬 🎉: 🕴 - 🤫
🕐❔ 👆 💪 👆 🎉 🐕‍🦺 (`startup` &amp; `shutdown`) 🏃 👆 💯, 👆 💪 ⚙️ `TestClient` ⏮️ `with` 📄:
```Python hl_lines="9-12 20-24"
{!../../../docs_src/app_testing/tutorial003.py!}
```

View File

@@ -0,0 +1,12 @@
# 🔬 *️⃣
👆 💪 ⚙️ 🎏 `TestClient` 💯*️⃣.
👉, 👆 ⚙️ `TestClient` `with` 📄, 🔗*️⃣:
```Python hl_lines="27-31"
{!../../../docs_src/app_testing/tutorial002.py!}
```
!!! note
🌅 , ✅ 💃 🧾 <a href="https://www.starlette.io/testclient/#testing-websocket-sessions" class="external-link" target="_blank">🔬 *️⃣ </a>.

View File

@@ -0,0 +1,52 @@
# ⚙️ 📨 🔗
🆙 🔜, 👆 ✔️ 📣 🍕 📨 👈 👆 💪 ⏮️ 👫 🆎.
✊ 📊 ⚪️➡️:
* ➡ 🔢.
* 🎚.
* 🍪.
* ♒️.
&amp; 🔨, **FastAPI** ⚖ 👈 💽, 🏭 ⚫️ &amp; 🏭 🧾 👆 🛠️ 🔁.
✋️ 📤 ⚠ 🌐❔ 👆 💪 💪 🔐 `Request` 🎚 🔗.
## 🔃 `Request` 🎚
**FastAPI** 🤙 **💃** 🔘, ⏮️ 🧽 📚 🧰 🔛 🔝, 👆 💪 ⚙️ 💃 <a href="https://www.starlette.io/requests/" class="external-link" target="_blank">`Request`</a> 🎚 🔗 🕐❔ 👆 💪.
⚫️ 🔜 ⛓ 👈 🚥 👆 🤚 📊 ⚪️➡️ `Request` 🎚 🔗 (🖼, ✍ 💪) ⚫️ 🏆 🚫 ✔, 🗜 ⚖️ 📄 (⏮️ 🗄, 🏧 🛠️ 👩‍💻 🔢) FastAPI.
👐 🙆 🎏 🔢 📣 🛎 (🖼, 💪 ⏮️ Pydantic 🏷) 🔜 ✔, 🗜, ✍, ♒️.
✋️ 📤 🎯 💼 🌐❔ ⚫️ ⚠ 🤚 `Request` 🎚.
## ⚙️ `Request` 🎚 🔗
➡️ 🌈 👆 💚 🤚 👩‍💻 📢 📢/🦠 🔘 👆 *➡ 🛠️ 🔢*.
👈 👆 💪 🔐 📨 🔗.
```Python hl_lines="1 7-8"
{!../../../docs_src/using_request_directly/tutorial001.py!}
```
📣 *➡ 🛠️ 🔢* 🔢 ⏮️ 🆎 `Request` **FastAPI** 🔜 💭 🚶‍♀️ `Request` 👈 🔢.
!!! tip
🗒 👈 👉 💼, 👥 📣 ➡ 🔢 ⤴️ 📨 🔢.
, ➡ 🔢 🔜 ⚗, ✔, 🗜 ✔ 🆎 &amp; ✍ ⏮️ 🗄.
🎏 🌌, 👆 💪 📣 🙆 🎏 🔢 🛎, &amp; ➡, 🤚 `Request` 💁‍♂️.
## `Request` 🧾
👆 💪 ✍ 🌅 🔃 <a href="https://www.starlette.io/requests/" class="external-link" target="_blank">`Request` 🎚 🛂 💃 🧾 🕸</a>.
!!! note "📡 "
👆 💪 ⚙️ `from starlette.requests import Request`.
**FastAPI** 🚚 ⚫️ 🔗 🏪 👆, 👩‍💻. ✋️ ⚫️ 👟 🔗 ⚪️➡️ 💃.

View File

@@ -0,0 +1,184 @@
# *️⃣
👆 💪 ⚙️ <a href="https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API" class="external-link" target="_blank"> *️⃣ </a> ⏮️ **FastAPI**.
## ❎ `WebSockets`
🥇 👆 💪 ❎ `WebSockets`:
<div class="termy">
```console
$ pip install websockets
---> 100%
```
</div>
## *️⃣ 👩‍💻
### 🏭
👆 🏭 ⚙️, 👆 🎲 ✔️ 🕸 ✍ ⏮️ 🏛 🛠️ 💖 😥, Vue.js ⚖️ 📐.
&amp; 🔗 ⚙️ *️⃣ ⏮️ 👆 👩‍💻 👆 🔜 🎲 ⚙️ 👆 🕸 🚙.
⚖️ 👆 💪 ✔️ 🇦🇸 📱 🈸 👈 🔗 ⏮️ 👆 *️⃣ 👩‍💻 🔗, 🇦🇸 📟.
⚖️ 👆 5⃣📆 ✔️ 🙆 🎏 🌌 🔗 ⏮️ *️⃣ 🔗.
---
✋️ 👉 🖼, 👥 🔜 ⚙️ 📶 🙅 🕸 📄 ⏮️ 🕸, 🌐 🔘 📏 🎻.
👉, ↗️, 🚫 ⚖ &amp; 👆 🚫🔜 ⚙️ ⚫️ 🏭.
🏭 👆 🔜 ✔️ 1⃣ 🎛 🔛.
✋️ ⚫️ 🙅 🌌 🎯 🔛 💽-🚄 *️⃣ &amp; ✔️ 👷 🖼:
```Python hl_lines="2 6-38 41-43"
{!../../../docs_src/websockets/tutorial001.py!}
```
## ✍ `websocket`
👆 **FastAPI** 🈸, ✍ `websocket`:
```Python hl_lines="1 46-47"
{!../../../docs_src/websockets/tutorial001.py!}
```
!!! note "📡 "
👆 💪 ⚙️ `from starlette.websockets import WebSocket`.
**FastAPI** 🚚 🎏 `WebSocket` 🔗 🏪 👆, 👩‍💻. ✋️ ⚫️ 👟 🔗 ⚪️➡️ 💃.
## ⌛ 📧 &amp; 📨 📧
👆 *️⃣ 🛣 👆 💪 `await` 📧 &amp; 📨 📧.
```Python hl_lines="48-52"
{!../../../docs_src/websockets/tutorial001.py!}
```
👆 💪 📨 &amp; 📨 💱, ✍, &amp; 🎻 💽.
## 🔄 ⚫️
🚥 👆 📁 📛 `main.py`, 🏃 👆 🈸 ⏮️:
<div class="termy">
```console
$ uvicorn main:app --reload
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
📂 👆 🖥 <a href="http://127.0.0.1:8000" class="external-link" target="_blank">http://127.0.0.1:8000</a>.
👆 🔜 👀 🙅 📃 💖:
<img src="/img/tutorial/websockets/image01.png">
👆 💪 🆎 📧 🔢 📦, &amp; 📨 👫:
<img src="/img/tutorial/websockets/image02.png">
&amp; 👆 **FastAPI** 🈸 ⏮️ *️⃣ 🔜 📨 🔙:
<img src="/img/tutorial/websockets/image03.png">
👆 💪 📨 (&amp; 📨) 📚 📧:
<img src="/img/tutorial/websockets/image04.png">
&amp; 🌐 👫 🔜 ⚙️ 🎏 *️⃣ 🔗.
## ⚙️ `Depends` &amp; 🎏
*️⃣ 🔗 👆 💪 🗄 ⚪️➡️ `fastapi` &amp; ⚙️:
* `Depends`
* `Security`
* `Cookie`
* `Header`
* `Path`
* `Query`
👫 👷 🎏 🌌 🎏 FastAPI 🔗/*➡ 🛠️*:
```Python hl_lines="66-77 76-91"
{!../../../docs_src/websockets/tutorial002.py!}
```
!!! info
👉 *️⃣ ⚫️ 🚫 🤙 ⚒ 🔑 🤚 `HTTPException`, ↩️ 👥 🤚 `WebSocketException`.
👆 💪 ⚙️ 📪 📟 ⚪️➡️ <a href="https://tools.ietf.org/html/rfc6455#section-7.4.1" class="external-link" target="_blank">☑ 📟 🔬 🔧</a>.
### 🔄 *️⃣ ⏮️ 🔗
🚥 👆 📁 📛 `main.py`, 🏃 👆 🈸 ⏮️:
<div class="termy">
```console
$ uvicorn main:app --reload
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
📂 👆 🖥 <a href="http://127.0.0.1:8000" class="external-link" target="_blank">http://127.0.0.1:8000</a>.
📤 👆 💪 ⚒:
* "🏬 🆔", ⚙️ ➡.
* "🤝" ⚙️ 🔢 🔢.
!!! tip
👀 👈 🔢 `token` 🔜 🍵 🔗.
⏮️ 👈 👆 💪 🔗 *️⃣ &amp; ⤴️ 📨 &amp; 📨 📧:
<img src="/img/tutorial/websockets/image05.png">
## 🚚 🔀 &amp; 💗 👩‍💻
🕐❔ *️⃣ 🔗 📪, `await websocket.receive_text()` 🔜 🤚 `WebSocketDisconnect` ⚠, ❔ 👆 💪 ⤴️ ✊ &amp; 🍵 💖 👉 🖼.
```Python hl_lines="81-83"
{!../../../docs_src/websockets/tutorial003.py!}
```
🔄 ⚫️ 👅:
* 📂 📱 ⏮️ 📚 🖥 📑.
* ✍ 📧 ⚪️➡️ 👫.
* ⤴️ 🔐 1⃣ 📑.
👈 🔜 🤚 `WebSocketDisconnect` ⚠, &amp; 🌐 🎏 👩‍💻 🔜 📨 📧 💖:
```
Client #1596980209979 left the chat
```
!!! tip
📱 🔛 ⭐ &amp; 🙅 🖼 🎦 ❔ 🍵 &amp; 📻 📧 📚 *️⃣ 🔗.
✋️ ✔️ 🤯 👈, 🌐 🍵 💾, 👁 📇, ⚫️ 🔜 🕴 👷 ⏪ 🛠️ 🏃, &amp; 🔜 🕴 👷 ⏮️ 👁 🛠️.
🚥 👆 💪 🕳 ⏩ 🛠️ ⏮️ FastAPI ✋️ 👈 🌖 🏋️, 🐕‍🦺 ✳, ✳ ⚖️ 🎏, ✅ <a href="https://github.com/encode/broadcaster" class="external-link" target="_blank">🗜/📻</a>.
## 🌅
💡 🌅 🔃 🎛, ✅ 💃 🧾:
* <a href="https://www.starlette.io/websockets/" class="external-link" target="_blank"> `WebSocket` 🎓</a>.
* <a href="https://www.starlette.io/endpoints/#websocketendpoint" class="external-link" target="_blank">🎓-⚓️ *️⃣ 🚚</a>.

View File

@@ -0,0 +1,37 @@
# ✅ 🇨🇻 - 🏺, ✳, 🎏
👆 💪 🗻 🇨🇻 🈸 👆 👀 ⏮️ [🎧 🈸 - 🗻](./sub-applications.md){.internal-link target=_blank}, [⛅ 🗳](./behind-a-proxy.md){.internal-link target=_blank}.
👈, 👆 💪 ⚙️ `WSGIMiddleware` &amp; ⚙️ ⚫️ 🎁 👆 🇨🇻 🈸, 🖼, 🏺, ✳, ♒️.
## ⚙️ `WSGIMiddleware`
👆 💪 🗄 `WSGIMiddleware`.
⤴️ 🎁 🇨🇻 (✅ 🏺) 📱 ⏮️ 🛠️.
&amp; ⤴️ 🗻 👈 🔽 ➡.
```Python hl_lines="2-3 22"
{!../../../docs_src/wsgi/tutorial001.py!}
```
## ✅ ⚫️
🔜, 🔠 📨 🔽 ➡ `/v1/` 🔜 🍵 🏺 🈸.
&amp; 🎂 🔜 🍵 **FastAPI**.
🚥 👆 🏃 ⚫️ ⏮️ Uvicorn &amp; 🚶 <a href="http://localhost:8000/v1/" class="external-link" target="_blank">http://localhost:8000/v1/</a> 👆 🔜 👀 📨 ⚪️➡️ 🏺:
```txt
Hello, World from Flask!
```
&amp; 🚥 👆 🚶 <a href="http://localhost:8000/v2" class="external-link" target="_blank">http://localhost:8000/v2</a> 👆 🔜 👀 📨 ⚪️➡️ FastAPI:
```JSON
{
"message": "Hello World"
}
```

View File

@@ -0,0 +1,414 @@
# 🎛, 🌈 &amp; 🔺
⚫️❔ 😮 **FastAPI**, ❔ ⚫️ 🔬 🎏 🎛 &amp; ⚫️❔ ⚫️ 🇭🇲 ⚪️➡️ 👫.
## 🎶
**FastAPI** 🚫🔜 🔀 🚥 🚫 ⏮️ 👷 🎏.
📤 ✔️ 📚 🧰 ✍ ⏭ 👈 ✔️ 😮 🚮 🏗.
👤 ✔️ ❎ 🏗 🆕 🛠️ 📚 1⃣2⃣🗓. 🥇 👤 🔄 ❎ 🌐 ⚒ 📔 **FastAPI** ⚙️ 📚 🎏 🛠️, 🔌-🔌, &amp; 🧰.
✋️ ☝, 📤 🙅‍♂ 🎏 🎛 🌘 🏗 🕳 👈 🚚 🌐 👫 ⚒, ✊ 🏆 💭 ⚪️➡️ ⏮️ 🧰, &amp; 🌀 👫 🏆 🌌 💪, ⚙️ 🇪🇸 ⚒ 👈 ➖🚫 💪 ⏭ (🐍 3⃣.6️⃣ 🆎 🔑).
## ⏮️ 🧰
### <a href="https://www.djangoproject.com/" class="external-link" target="_blank">✳</a>
⚫️ 🌅 🌟 🐍 🛠️ &amp; 🛎 🕴. ⚫️ ⚙️ 🏗 ⚙️ 💖 👱📔.
⚫️ 📶 😆 🔗 ⏮️ 🔗 💽 (💖 ✳ ⚖️ ✳),, ✔️ ☁ 💽 (💖 🗄, ✳, 👸, ♒️) 👑 🏪 🚒 🚫 📶 ⏩.
⚫️ ✍ 🏗 🕸 👩‍💻, 🚫 ✍ 🔗 ⚙️ 🏛 🕸 (💖 😥, Vue.js &amp; 📐) ⚖️ 🎏 ⚙️ (💖 <abbr title="Internet of Things">☁</abbr> 📳) 🔗 ⏮️ ⚫️.
### <a href="https://www.django-rest-framework.org/" class="external-link" target="_blank">✳ 🎂 🛠️</a>
✳ 🎂 🛠️ ✍ 🗜 🧰 🏗 🕸 🔗 ⚙️ ✳ 🔘, 📉 🚮 🛠️ 🛠️.
⚫️ ⚙️ 📚 🏢 ✅ 🦎, 🟥 👒 &amp; 🎟.
⚫️ 🕐 🥇 🖼 **🏧 🛠️ 🧾**, &amp; 👉 🎯 🕐 🥇 💭 👈 😮 "🔎" **FastAPI**.
!!! note
✳ 🎂 🛠️ ✍ ✡ 🇺🇸🏛. 🎏 👼 💃 &amp; Uvicorn, 🔛 ❔ **FastAPI** ⚓️.
!!! check "😮 **FastAPI** "
✔️ 🏧 🛠️ 🧾 🕸 👩‍💻 🔢.
### <a href="https://flask.palletsprojects.com" class="external-link" target="_blank">🏺</a>
🏺 "🕸", ⚫️ 🚫 🔌 💽 🛠️ 🚫 📚 👜 👈 👟 🔢 ✳.
👉 🦁 &amp; 💪 ✔ 🔨 👜 💖 ⚙️ ☁ 💽 👑 💽 💾 ⚙️.
⚫️ 📶 🙅, ⚫️ 📶 🏋️ 💡, 👐 🧾 🤚 🙁 📡 ☝.
⚫️ 🛎 ⚙️ 🎏 🈸 👈 🚫 🎯 💪 💽, 👩‍💻 🧾, ⚖️ 🙆 📚 ⚒ 👈 👟 🏤-🏗 ✳. 👐 📚 👫 ⚒ 💪 🚮 ⏮️ 🔌-🔌.
👉 ⚖ 🍕, &amp; "🕸" 👈 💪 ↔ 📔 ⚫️❔ ⚫️❔ 💪 🔑 ⚒ 👈 👤 💚 🚧.
👐 🦁 🏺, ⚫️ 😑 💖 👍 🏏 🏗 🔗. ⏭ 👜 🔎 "✳ 🎂 🛠️" 🏺.
!!! check "😮 **FastAPI** "
◾-🛠️. ⚒ ⚫️ ⏩ 🌀 &amp; 🏏 🧰 &amp; 🍕 💪.
✔️ 🙅 &amp; ⏩ ⚙️ 🕹 ⚙️.
### <a href="https://requests.readthedocs.io" class="external-link" target="_blank">📨</a>
**FastAPI** 🚫 🤙 🎛 **📨**. 👫 ↔ 📶 🎏.
⚫️ 🔜 🤙 ⚠ ⚙️ 📨 *🔘* FastAPI 🈸.
✋️, FastAPI 🤚 🌈 ⚪️➡️ 📨.
**📨** 🗃 *🔗* ⏮️ 🔗 (👩‍💻), ⏪ **FastAPI** 🗃 *🏗* 🔗 (💽).
👫, 🌖 ⚖️ 🌘, 🔄 🔚, 🔗 🔠 🎏.
📨 ✔️ 📶 🙅 &amp; 🏋️ 🔧, ⚫️ 📶 ⏩ ⚙️, ⏮️ 🤔 🔢. ✋️ 🎏 🕰, ⚫️ 📶 🏋️ &amp; 🛃.
👈 ⚫️❔, 💬 🛂 🕸:
&gt; 📨 1⃣ 🏆 ⏬ 🐍 📦 🌐 🕰
🌌 👆 ⚙️ ⚫️ 📶 🙅. 🖼, `GET` 📨, 👆 🔜 ✍:
```Python
response = requests.get("http://example.com/some/url")
```
FastAPI 😑 🛠️ *➡ 🛠️* 💪 👀 💖:
```Python hl_lines="1"
@app.get("/some/url")
def read_url():
return {"message": "Hello World"}
```
👀 🔀 `requests.get(...)` &amp; `@app.get(...)`.
!!! check "😮 **FastAPI** "
* ✔️ 🙅 &amp; 🏋️ 🛠️.
* ⚙️ 🇺🇸🔍 👩‍🔬 📛 (🛠️) 🔗, 🎯 &amp; 🏋️ 🌌.
* ✔️ 🤔 🔢, ✋️ 🏋️ 🛃.
### <a href="https://swagger.io/" class="external-link" target="_blank">🦁</a> / <a href="https://github.com/OAI/OpenAPI-Specification/" class="external-link" target="_blank">🗄</a>
👑 ⚒ 👤 💚 ⚪️➡️ ✳ 🎂 🛠️ 🏧 🛠️ 🧾.
⤴️ 👤 🔎 👈 📤 🐩 📄 🔗, ⚙️ 🎻 (⚖️ 📁, ↔ 🎻) 🤙 🦁.
&amp; 📤 🕸 👩‍💻 🔢 🦁 🛠️ ⏪ ✍. , 💆‍♂ 💪 🏗 🦁 🧾 🛠️ 🔜 ✔ ⚙️ 👉 🕸 👩‍💻 🔢 🔁.
☝, 🦁 👐 💾 🏛, 📁 🗄.
👈 ⚫️❔ 🕐❔ 💬 🔃 ⏬ 2⃣.0️⃣ ⚫️ ⚠ 💬 "🦁", &amp; ⏬ 3 "🗄".
!!! check "😮 **FastAPI** "
🛠️ &amp; ⚙️ 📂 🐩 🛠️ 🔧, ↩️ 🛃 🔗.
&amp; 🛠️ 🐩-⚓️ 👩‍💻 🔢 🧰:
* <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">🦁 🎚</a>
* <a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">📄</a>
👫 2⃣ 👐 📶 🌟 &amp; ⚖, ✋️ 🔨 ⏩ 🔎, 👆 💪 🔎 💯 🌖 🎛 👩‍💻 🔢 🗄 (👈 👆 💪 ⚙️ ⏮️ **FastAPI**).
### 🏺 🎂 🛠️
📤 📚 🏺 🎂 🛠️, ✋️ ⏮️ 💰 🕰 &amp; 👷 🔘 🔬 👫, 👤 🔎 👈 📚 😞 ⚖️ 🚫, ⏮️ 📚 🧍 ❔ 👈 ⚒ 👫 🙃.
### <a href="https://marshmallow.readthedocs.io/en/stable/" class="external-link" target="_blank">🍭</a>
1⃣ 👑 ⚒ 💪 🛠️ ⚙️ 📊 "<abbr title="also called marshalling, conversion">🛠️</abbr>" ❔ ✊ 📊 ⚪️➡️ 📟 (🐍) &amp; 🏭 ⚫️ 🔘 🕳 👈 💪 📨 🔘 🕸. 🖼, 🏭 🎚 ⚗ 📊 ⚪️➡️ 💽 🔘 🎻 🎚. 🏭 `datetime` 🎚 🔘 🎻, ♒️.
1⃣ 🦏 ⚒ 💚 🔗 💽 🔬, ⚒ 💭 👈 💽 ☑, 🤝 🎯 🔢. 🖼, 👈 🏑 `int`, &amp; 🚫 🎲 🎻. 👉 ✴️ ⚠ 📨 💽.
🍵 💽 🔬 ⚙️, 👆 🔜 ✔️ 🌐 ✅ ✋, 📟.
👫 ⚒ ⚫️❔ 🍭 🏗 🚚. ⚫️ 👑 🗃, &amp; 👤 ✔️ ⚙️ ⚫️ 📚 ⏭.
✋️ ⚫️ ✍ ⏭ 📤 🔀 🐍 🆎 🔑. , 🔬 🔠 <abbr title="the definition of how data should be formed">🔗</abbr> 👆 💪 ⚙️ 🎯 🇨🇻 &amp; 🎓 🚚 🍭.
!!! check "😮 **FastAPI** "
⚙️ 📟 🔬 "🔗" 👈 🚚 💽 🆎 &amp; 🔬, 🔁.
### <a href="https://webargs.readthedocs.io/en/latest/" class="external-link" target="_blank">Webarg</a>
1⃣ 🦏 ⚒ ✔ 🔗 <abbr title="reading and converting to Python data">✍</abbr> 📊 ⚪️➡️ 📨 📨.
Webarg 🧰 👈 ⚒ 🚚 👈 🔛 🔝 📚 🛠️, 🔌 🏺.
⚫️ ⚙️ 🍭 🔘 💽 🔬. &amp; ⚫️ ✍ 🎏 👩‍💻.
⚫️ 👑 🧰 &amp; 👤 ✔️ ⚙️ ⚫️ 📚 💁‍♂️, ⏭ ✔️ **FastAPI**.
!!! info
Webarg ✍ 🎏 🍭 👩‍💻.
!!! check "😮 **FastAPI** "
✔️ 🏧 🔬 📨 📨 💽.
### <a href="https://apispec.readthedocs.io/en/stable/" class="external-link" target="_blank">APISpec</a>
🍭 &amp; Webarg 🚚 🔬, ✍ &amp; 🛠️ 🔌-🔌.
✋️ 🧾 ❌. ⤴️ APISpec ✍.
⚫️ 🔌-📚 🛠️ (&amp; 📤 🔌-💃 💁‍♂️).
🌌 ⚫️ 👷 👈 👆 ✍ 🔑 🔗 ⚙️ 📁 📁 🔘 #️⃣ 🔠 🔢 🚚 🛣.
&amp; ⚫️ 🏗 🗄 🔗.
👈 ❔ ⚫️ 👷 🏺, 💃, 🆘, ♒️.
✋️ ⤴️, 👥 ✔️ 🔄 ⚠ ✔️ ◾-❕, 🔘 🐍 🎻 (🦏 📁).
👨‍🎨 💪 🚫 🌅 ⏮️ 👈. &amp; 🚥 👥 🔀 🔢 ⚖️ 🍭 🔗 &amp; 💭 🔀 👈 📁#️⃣, 🏗 🔗 🔜 ❌.
!!! info
APISpec ✍ 🎏 🍭 👩‍💻.
!!! check "😮 **FastAPI** "
🐕‍🦺 📂 🐩 🛠️, 🗄.
### <a href="https://flask-apispec.readthedocs.io/en/latest/" class="external-link" target="_blank">🏺-Apispec</a>
⚫️ 🏺 🔌 -, 👈 👔 👯‍♂️ Webarg, 🍭 &amp; APISpec.
⚫️ ⚙️ ⚪️➡️ Webarg &amp; 🍭 🔁 🏗 🗄 🔗, ⚙️ APISpec.
⚫️ 👑 🧰, 📶 🔽-📈. ⚫️ 🔜 🌌 🌖 🌟 🌘 📚 🏺 🔌-🔌 👅 📤. ⚫️ 💪 ↩️ 🚮 🧾 💁‍♂️ 🩲 &amp; 📝.
👉 ❎ ✔️ ✍ 📁 (1⃣ ❕) 🔘 🐍 ✍.
👉 🌀 🏺, 🏺-Apispec ⏮️ 🍭 &amp; Webarg 👇 💕 👩‍💻 📚 ⏭ 🏗 **FastAPI**.
⚙️ ⚫️ ↘️ 🏗 📚 🏺 🌕-📚 🚂. 👫 👑 📚 👤 (&amp; 📚 🔢 🏉) ✔️ ⚙️ 🆙 🔜:
* <a href="https://github.com/tiangolo/full-stack" class="external-link" target="_blank">https://github.com/tiangolo/full-stack</a>
* <a href="https://github.com/tiangolo/full-stack-flask-couchbase" class="external-link" target="_blank">https://github.com/tiangolo/full-stack-flask-couchbase</a>
* <a href="https://github.com/tiangolo/full-stack-flask-couchdb" class="external-link" target="_blank">https://github.com/tiangolo/full-stack-flask-couchdb</a>
&amp; 👫 🎏 🌕-📚 🚂 🧢 [**FastAPI** 🏗 🚂](project-generation.md){.internal-link target=_blank}.
!!! info
🏺-Apispec ✍ 🎏 🍭 👩‍💻.
!!! check "😮 **FastAPI** "
🏗 🗄 🔗 🔁, ⚪️➡️ 🎏 📟 👈 🔬 🛠️ &amp; 🔬.
### <a href="https://nestjs.com/" class="external-link" target="_blank">NestJS</a> (&amp; <a href="https://angular.io/" class="external-link" target="_blank">📐</a>)
👉 ➖🚫 🚫 🐍, NestJS 🕸 (📕) ✳ 🛠️ 😮 📐.
⚫️ 🏆 🕳 🙁 🎏 ⚫️❔ 💪 🔨 ⏮️ 🏺-Apispec.
⚫️ ✔️ 🛠️ 🔗 💉 ⚙️, 😮 📐 2⃣. ⚫️ 🚚 🏤-® "💉" (💖 🌐 🎏 🔗 💉 ⚙️ 👤 💭),, ⚫️ 🚮 🎭 &amp; 📟 🔁.
🔢 🔬 ⏮️ 📕 🆎 (🎏 🐍 🆎 🔑), 👨‍🎨 🐕‍🦺 👍.
✋️ 📕 📊 🚫 🛡 ⏮️ 📹 🕸, ⚫️ 🚫🔜 ⚓️ 🔛 🆎 🔬 🔬, 🛠️ &amp; 🧾 🎏 🕰. ↩️ 👉 &amp; 🔧 🚫, 🤚 🔬, 🛠️ &amp; 🏧 🔗 ⚡, ⚫️ 💪 🚮 👨‍🎨 📚 🥉. , ⚫️ ▶️️ 🔁.
⚫️ 💪 🚫 🍵 🔁 🏷 📶 👍. , 🚥 🎻 💪 📨 🎻 🎚 👈 ✔️ 🔘 🏑 👈 🔄 🐦 🎻 🎚, ⚫️ 🚫🔜 ☑ 📄 &amp; ✔.
!!! check "😮 **FastAPI** "
⚙️ 🐍 🆎 ✔️ 👑 👨‍🎨 🐕‍🦺.
✔️ 🏋️ 🔗 💉 ⚙️. 🔎 🌌 📉 📟 🔁.
### <a href="https://sanic.readthedocs.io/en/latest/" class="external-link" target="_blank">🤣</a>
⚫️ 🕐 🥇 📶 ⏩ 🐍 🛠️ ⚓️ 🔛 `asyncio`. ⚫️ ⚒ 📶 🎏 🏺.
!!! note "📡 "
⚫️ ⚙️ <a href="https://github.com/MagicStack/uvloop" class="external-link" target="_blank">`uvloop`</a> ↩️ 🔢 🐍 `asyncio` ➰. 👈 ⚫️❔ ⚒ ⚫️ ⏩.
⚫️ 🎯 😮 Uvicorn &amp; 💃, 👈 ⏳ ⏩ 🌘 🤣 📂 📇.
!!! check "😮 **FastAPI** "
🔎 🌌 ✔️ 😜 🎭.
👈 ⚫️❔ **FastAPI** ⚓️ 🔛 💃, ⚫️ ⏩ 🛠️ 💪 (💯 🥉-🥳 📇).
### <a href="https://falconframework.org/" class="external-link" target="_blank">🦅</a>
🦅 1⃣ ↕ 🎭 🐍 🛠️, ⚫️ 🔧 ⭐, &amp; 👷 🏛 🎏 🛠️ 💖 🤗.
⚫️ 🏗 ✔️ 🔢 👈 📨 2⃣ 🔢, 1⃣ "📨" &amp; 1⃣ "📨". ⤴️ 👆 "✍" 🍕 ⚪️➡️ 📨, &amp; "✍" 🍕 📨. ↩️ 👉 🔧, ⚫️ 🚫 💪 📣 📨 🔢 &amp; 💪 ⏮️ 🐩 🐍 🆎 🔑 🔢 🔢.
, 💽 🔬, 🛠️, &amp; 🧾, ✔️ ⌛ 📟, 🚫 🔁. ⚖️ 👫 ✔️ 🛠️ 🛠️ 🔛 🔝 🦅, 💖 🤗. 👉 🎏 🔺 🔨 🎏 🛠️ 👈 😮 🦅 🔧, ✔️ 1⃣ 📨 🎚 &amp; 1⃣ 📨 🎚 🔢.
!!! check "😮 **FastAPI** "
🔎 🌌 🤚 👑 🎭.
⤴️ ⏮️ 🤗 (🤗 ⚓️ 🔛 🦅) 😮 **FastAPI** 📣 `response` 🔢 🔢.
👐 FastAPI ⚫️ 📦, &amp; ⚙️ ✴️ ⚒ 🎚, 🍪, &amp; 🎛 👔 📟.
### <a href="https://moltenframework.com/" class="external-link" target="_blank">♨</a>
👤 🔎 ♨ 🥇 ▶️ 🏗 **FastAPI**. &amp; ⚫️ ✔️ 🎏 💭:
* ⚓️ 🔛 🐍 🆎 🔑.
* 🔬 &amp; 🧾 ⚪️➡️ 👫 🆎.
* 🔗 💉 ⚙️.
⚫️ 🚫 ⚙️ 💽 🔬, 🛠️ &amp; 🧾 🥉-🥳 🗃 💖 Pydantic, ⚫️ ✔️ 🚮 👍. , 👫 💽 🆎 🔑 🔜 🚫 ♻ 💪.
⚫️ 🚚 🐥 🍖 🌅 🔁 📳. &amp; ⚫️ ⚓️ 🔛 🇨🇻 (↩️ 🔫), ⚫️ 🚫 🔧 ✊ 📈 ↕-🎭 🚚 🧰 💖 Uvicorn, 💃 &amp; 🤣.
🔗 💉 ⚙️ 🚚 🏤-® 🔗 &amp; 🔗 ❎ 🧢 🔛 📣 🆎. , ⚫️ 🚫 💪 📣 🌅 🌘 1⃣ "🦲" 👈 🚚 🎯 🆎.
🛣 📣 👁 🥉, ⚙️ 🔢 📣 🎏 🥉 (↩️ ⚙️ 👨‍🎨 👈 💪 🥉 ▶️️ 🔛 🔝 🔢 👈 🍵 🔗). 👉 🔐 ❔ ✳ 🔨 ⚫️ 🌘 ❔ 🏺 (&amp; 💃) 🔨 ⚫️. ⚫️ 🎏 📟 👜 👈 📶 😆 🔗.
!!! check "😮 **FastAPI** "
🔬 🔬 💽 🆎 ⚙️ "🔢" 💲 🏷 🔢. 👉 📉 👨‍🎨 🐕‍🦺, &amp; ⚫️ 🚫 💪 Pydantic ⏭.
👉 🤙 😮 🛠️ 🍕 Pydantic, 🐕‍🦺 🎏 🔬 📄 👗 (🌐 👉 🛠️ 🔜 ⏪ 💪 Pydantic).
### <a href="https://www.hug.rest/" class="external-link" target="_blank">🤗</a>
🤗 🕐 🥇 🛠️ 🛠️ 📄 🛠️ 🔢 🆎 ⚙️ 🐍 🆎 🔑. 👉 👑 💭 👈 😮 🎏 🧰 🎏.
⚫️ ⚙️ 🛃 🆎 🚮 📄 ↩️ 🐩 🐍 🆎, ✋️ ⚫️ 🦏 🔁 ⏩.
⚫️ 🕐 🥇 🛠️ 🏗 🛃 🔗 📣 🎂 🛠️ 🎻.
⚫️ 🚫 ⚓️ 🔛 🐩 💖 🗄 &amp; 🎻 🔗. ⚫️ 🚫🔜 🎯 🛠️ ⚫️ ⏮️ 🎏 🧰, 💖 🦁 🎚. ✋️ 🔄, ⚫️ 📶 💡 💭.
⚫️ ✔️ 😌, ⭐ ⚒: ⚙️ 🎏 🛠️, ⚫️ 💪 ✍ 🔗 &amp; 🇳🇨.
⚫️ ⚓️ 🔛 ⏮️ 🐩 🔁 🐍 🕸 🛠️ (🇨🇻), ⚫️ 💪 🚫 🍵 *️⃣ &amp; 🎏 👜, 👐 ⚫️ ✔️ ↕ 🎭 💁‍♂️.
!!! info
🤗 ✍ ✡ 🗄, 🎏 👼 <a href="https://github.com/timothycrosley/isort" class="external-link" target="_blank">`isort`</a>, 👑 🧰 🔁 😇 🗄 🐍 📁.
!!! check "💭 😮 **FastAPI**"
🤗 😮 🍕 APIStar, &amp; 1⃣ 🧰 👤 🔎 🏆 👍, 🌟 APIStar.
🤗 😍 **FastAPI** ⚙️ 🐍 🆎 🔑 📣 🔢, &amp; 🏗 🔗 ⚖ 🛠️ 🔁.
🤗 😮 **FastAPI** 📣 `response` 🔢 🔢 ⚒ 🎚 &amp; 🍪.
### <a href="https://github.com/encode/apistar" class="external-link" target="_blank">APIStar</a> (&lt;= 0⃣.5️⃣)
▶️️ ⏭ 🤔 🏗 **FastAPI** 👤 🔎 **APIStar** 💽. ⚫️ ✔️ 🌖 🌐 👤 👀 &amp; ✔️ 👑 🔧.
⚫️ 🕐 🥇 🛠️ 🛠️ ⚙️ 🐍 🆎 🔑 📣 🔢 &amp; 📨 👈 👤 ⏱ 👀 (⏭ NestJS &amp; ♨). 👤 🔎 ⚫️ 🌅 ⚖️ 🌘 🎏 🕰 🤗. ✋️ APIStar ⚙️ 🗄 🐩.
⚫️ ✔️ 🏧 💽 🔬, 💽 🛠️ &amp; 🗄 🔗 ⚡ ⚓️ 🔛 🎏 🆎 🔑 📚 🥉.
💪 🔗 🔑 🚫 ⚙️ 🎏 🐍 🆎 🔑 💖 Pydantic, ⚫️ 🍖 🌅 🎏 🍭,, 👨‍🎨 🐕‍🦺 🚫🔜 👍, ✋️, APIStar 🏆 💪 🎛.
⚫️ ✔️ 🏆 🎭 📇 🕰 (🕴 💥 💃).
🥇, ⚫️ 🚫 ✔️ 🏧 🛠️ 🧾 🕸 🎚, ✋️ 👤 💭 👤 💪 🚮 🦁 🎚 ⚫️.
⚫️ ✔️ 🔗 💉 ⚙️. ⚫️ ✔ 🏤-® 🦲, 🎏 🧰 🔬 🔛. ✋️, ⚫️ 👑 ⚒.
👤 🙅 💪 ⚙️ ⚫️ 🌕 🏗, ⚫️ 🚫 ✔️ 💂‍♂ 🛠️,, 👤 🚫 🚫 ❎ 🌐 ⚒ 👤 ✔️ ⏮️ 🌕-📚 🚂 ⚓️ 🔛 🏺-Apispec. 👤 ✔️ 👇 📈 🏗 ✍ 🚲 📨 ❎ 👈 🛠️.
✋️ ⤴️, 🏗 🎯 🔀.
⚫️ 🙅‍♂ 📏 🛠️ 🕸 🛠️, 👼 💪 🎯 🔛 💃.
🔜 APIStar ⚒ 🧰 ✔ 🗄 🔧, 🚫 🕸 🛠️.
!!! info
APIStar ✍ ✡ 🇺🇸🏛. 🎏 👨 👈 ✍:
* ✳ 🎂 🛠️
* 💃 (❔ **FastAPI** ⚓️)
* Uvicorn (⚙️ 💃 &amp; **FastAPI**)
!!! check "😮 **FastAPI** "
🔀.
💭 📣 💗 👜 (💽 🔬, 🛠️ &amp; 🧾) ⏮️ 🎏 🐍 🆎, 👈 🎏 🕰 🚚 👑 👨‍🎨 🐕‍🦺, 🕳 👤 🤔 💎 💭.
&amp; ⏮️ 🔎 📏 🕰 🎏 🛠️ &amp; 🔬 📚 🎏 🎛, APIStar 🏆 🎛 💪.
⤴️ APIStar ⛔️ 🔀 💽 &amp; 💃 ✍, &amp; 🆕 👻 🏛 ✅ ⚙️. 👈 🏁 🌈 🏗 **FastAPI**.
👤 🤔 **FastAPI** "🛐 👨‍💼" APIStar, ⏪ 📉 &amp; 📈 ⚒, ⌨ ⚙️, &amp; 🎏 🍕, ⚓️ 🔛 🏫 ⚪️➡️ 🌐 👉 ⏮️ 🧰.
## ⚙️ **FastAPI**
### <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a>
Pydantic 🗃 🔬 💽 🔬, 🛠️ &amp; 🧾 (⚙️ 🎻 🔗) ⚓️ 🔛 🐍 🆎 🔑.
👈 ⚒ ⚫️ 📶 🏋️.
⚫️ ⭐ 🍭. 👐 ⚫️ ⏩ 🌘 🍭 📇. &amp; ⚫️ ⚓️ 🔛 🎏 🐍 🆎 🔑, 👨‍🎨 🐕‍🦺 👑.
!!! check "**FastAPI** ⚙️ ⚫️"
🍵 🌐 💽 🔬, 💽 🛠️ &amp; 🏧 🏷 🧾 (⚓️ 🔛 🎻 🔗).
**FastAPI** ⤴️ ✊ 👈 🎻 🔗 💽 &amp; 🚮 ⚫️ 🗄, ↖️ ⚪️➡️ 🌐 🎏 👜 ⚫️ 🔨.
### <a href="https://www.starlette.io/" class="external-link" target="_blank">💃</a>
💃 💿 <abbr title="The new standard for building asynchronous Python web">🔫</abbr> 🛠️/🧰, ❔ 💯 🏗 ↕-🎭 ✳ 🐕‍🦺.
⚫️ 📶 🙅 &amp; 🏋️. ⚫️ 🔧 💪 🏧, &amp; ✔️ 🔧 🦲.
⚫️ ✔️:
* 🤙 🎆 🎭.
* *️⃣ 🐕‍🦺.
* -🛠️ 🖥 📋.
* 🕴 &amp; 🤫 🎉.
* 💯 👩‍💻 🏗 🔛 🇸🇲.
* ⚜, 🗜, 🎻 📁, 🎏 📨.
* 🎉 &amp; 🍪 🐕‍🦺.
* 1⃣0⃣0⃣ 💯 💯 💰.
* 1⃣0⃣0⃣ 💯 🆎 ✍ ✍.
* 👩‍❤‍👨 🏋️ 🔗.
💃 ⏳ ⏩ 🐍 🛠️ 💯. 🕴 💥 Uvicorn, ❔ 🚫 🛠️, ✋️ 💽.
💃 🚚 🌐 🔰 🕸 🕸 🛠️.
✋️ ⚫️ 🚫 🚚 🏧 💽 🔬, 🛠️ ⚖️ 🧾.
👈 1⃣ 👑 👜 👈 **FastAPI** 🚮 🔛 🔝, 🌐 ⚓️ 🔛 🐍 🆎 🔑 (⚙️ Pydantic). 👈, 🔗 💉 ⚙️, 💂‍♂ 🚙, 🗄 🔗 ⚡, ♒️.
!!! note "📡 "
🔫 🆕 "🐩" 🛠️ ✳ 🐚 🏉 👨‍🎓. ⚫️ 🚫 "🐍 🐩" (🇩🇬), 👐 👫 🛠️ 🔨 👈.
👐, ⚫️ ⏪ ⚙️ "🐩" 📚 🧰. 👉 📉 📉 🛠️, 👆 💪 🎛 Uvicorn 🙆 🎏 🔫 💽 (💖 👸 ⚖️ Hypercorn), ⚖️ 👆 💪 🚮 🔫 🔗 🧰, 💖 `python-socketio`.
!!! check "**FastAPI** ⚙️ ⚫️"
🍵 🌐 🐚 🕸 🍕. ❎ ⚒ 🔛 🔝.
🎓 `FastAPI` ⚫️ 😖 🔗 ⚪️➡️ 🎓 `Starlette`.
, 🕳 👈 👆 💪 ⏮️ 💃, 👆 💪 ⚫️ 🔗 ⏮️ **FastAPI**, ⚫️ 🌖 💃 🔛 💊.
### <a href="https://www.uvicorn.org/" class="external-link" target="_blank">Uvicorn</a>
Uvicorn 🌩-⏩ 🔫 💽, 🏗 🔛 uvloop &amp; httptool.
⚫️ 🚫 🕸 🛠️, ✋️ 💽. 🖼, ⚫️ 🚫 🚚 🧰 🕹 ➡. 👈 🕳 👈 🛠️ 💖 💃 (⚖️ **FastAPI**) 🔜 🚚 🔛 🔝.
⚫️ 👍 💽 💃 &amp; **FastAPI**.
!!! check "**FastAPI** 👍 ⚫️"
👑 🕸 💽 🏃 **FastAPI** 🈸.
👆 💪 🌀 ⚫️ ⏮️ 🐁, ✔️ 🔁 👁-🛠️ 💽.
✅ 🌅 [🛠️](deployment/index.md){.internal-link target=_blank} 📄.
## 📇 &amp; 🚅
🤔, 🔬, &amp; 👀 🔺 🖖 Uvicorn, 💃 &amp; FastAPI, ✅ 📄 🔃 [📇](benchmarks.md){.internal-link target=_blank}.

430
docs/em/docs/async.md Normal file
View File

@@ -0,0 +1,430 @@
# 🛠️ &amp; 🔁 / ⌛
🔃 `async def`*➡ 🛠️ 🔢* &amp; 🖥 🔃 🔁 📟, 🛠️, &amp; 🔁.
## 🏃 ❓
<abbr title="too long; didn't read"><strong>🆑;👩‍⚕️:</strong></abbr>
🚥 👆 ⚙️ 🥉 🥳 🗃 👈 💬 👆 🤙 👫 ⏮️ `await`, 💖:
```Python
results = await some_library()
```
⤴️, 📣 👆 *➡ 🛠️ 🔢* ⏮️ `async def` 💖:
```Python hl_lines="2"
@app.get('/')
async def read_results():
results = await some_library()
return results
```
!!! note
👆 💪 🕴 ⚙️ `await` 🔘 🔢 ✍ ⏮️ `async def`.
---
🚥 👆 ⚙️ 🥉 🥳 🗃 👈 🔗 ⏮️ 🕳 (💽, 🛠️, 📁 ⚙️, ♒️.) &amp; 🚫 ✔️ 🐕‍🦺 ⚙️ `await`, (👉 ⏳ 💼 🌅 💽 🗃), ⤴️ 📣 👆 *➡ 🛠️ 🔢* 🛎, ⏮️ `def`, 💖:
```Python hl_lines="2"
@app.get('/')
def results():
results = some_library()
return results
```
---
🚥 👆 🈸 (😫) 🚫 ✔️ 🔗 ⏮️ 🕳 🙆 &amp; ⌛ ⚫️ 📨, ⚙️ `async def`.
---
🚥 👆 🚫 💭, ⚙️ 😐 `def`.
---
**🗒**: 👆 💪 🌀 `def` &amp; `async def` 👆 *➡ 🛠️ 🔢* 🌅 👆 💪 &amp; 🔬 🔠 1⃣ ⚙️ 🏆 🎛 👆. FastAPI 🔜 ▶️️ 👜 ⏮️ 👫.
😆, 🙆 💼 🔛, FastAPI 🔜 👷 🔁 &amp; 📶 ⏩.
✋️ 📄 📶 🔛, ⚫️ 🔜 💪 🎭 🛠️.
## 📡
🏛 ⏬ 🐍 ✔️ 🐕‍🦺 **"🔁 📟"** ⚙️ 🕳 🤙 **"🔁"**, ⏮️ **`async` &amp; `await`** ❕.
➡️ 👀 👈 🔤 🍕 📄 🔛:
* **🔁 📟**
* **`async` &amp; `await`**
* **🔁**
## 🔁 📟
🔁 📟 ⛓ 👈 🇪🇸 👶 ✔️ 🌌 💬 💻 / 📋 👶 👈 ☝ 📟, ⚫️ 👶 🔜 ✔️ ⌛ *🕳 🙆* 🏁 👱 🙆. ➡️ 💬 👈 *🕳 🙆* 🤙 "🐌-📁" 👶.
, ⏮️ 👈 🕰, 💻 💪 🚶 &amp; 🎏 👷, ⏪ "🐌-📁" 👶 🏁.
⤴️ 💻 / 📋 👶 🔜 👟 🔙 🔠 🕰 ⚫️ ✔️ 🤞 ↩️ ⚫️ ⌛ 🔄, ⚖️ 🕐❔ ⚫️ 👶 🏁 🌐 👷 ⚫️ ✔️ 👈 ☝. &amp; ⚫️ 👶 🔜 👀 🚥 🙆 📋 ⚫️ ⌛ ✔️ ⏪ 🏁, 🤸 ⚫️❔ ⚫️ ✔️.
⏭, ⚫️ 👶 ✊ 🥇 📋 🏁 (➡️ 💬, 👆 "🐌-📁" 👶) &amp; 😣 ⚫️❔ ⚫️ ✔️ ⏮️ ⚫️.
👈 "⌛ 🕳 🙆" 🛎 🔗 <abbr title="Input and Output">👤/🅾</abbr> 🛠️ 👈 📶 "🐌" (🔬 🚅 🕹 &amp; 💾 💾), 💖 ⌛:
* 📊 ⚪️➡️ 👩‍💻 📨 🔘 🕸
* 📊 📨 👆 📋 📨 👩‍💻 🔘 🕸
* 🎚 📁 💾 ✍ ⚙️ &amp; 🤝 👆 📋
* 🎚 👆 📋 🤝 ⚙️ ✍ 💾
* 🛰 🛠️ 🛠️
* 💽 🛠️ 🏁
* 💽 🔢 📨 🏁
* ♒️.
🛠️ 🕰 🍴 ✴️ ⌛ <abbr title="Input and Output">👤/🅾</abbr> 🛠️, 👫 🤙 👫 "👤/🅾 🔗" 🛠️.
⚫️ 🤙 "🔁" ↩️ 💻 / 📋 🚫 ✔️ "🔁" ⏮️ 🐌 📋, ⌛ ☑ 🙍 👈 📋 🏁, ⏪ 🔨 🕳, 💪 ✊ 📋 🏁 &amp; 😣 👷.
↩️ 👈, 💆‍♂ "🔁" ⚙️, 🕐 🏁, 📋 💪 ⌛ ⏸ 🐥 👄 (⏲) 💻 / 📋 🏁 ⚫️❔ ⚫️ 🚶, &amp; ⤴️ 👟 🔙 ✊ 🏁 &amp; 😣 👷 ⏮️ 👫.
"🔁" (👽 "🔁") 👫 🛎 ⚙️ ⚖ "🔁", ↩️ 💻 / 📋 ⏩ 🌐 📶 🔁 ⏭ 🔀 🎏 📋, 🚥 👈 🔁 🔌 ⌛.
### 🛠️ &amp; 🍔
👉 💭 **🔁** 📟 🔬 🔛 🕣 🤙 **"🛠️"**. ⚫️ 🎏 ⚪️➡️ **"🔁"**.
**🛠️** &amp; **🔁** 👯‍♂️ 🔗 "🎏 👜 😥 🌅 ⚖️ 🌘 🎏 🕰".
✋️ 🖖 *🛠️* &amp; *🔁* 🎏.
👀 🔺, 🌈 📄 📖 🔃 🍔:
### 🛠️ 🍔
👆 🚶 ⏮️ 👆 🥰 🤚 ⏩ 🥕, 👆 🧍 ⏸ ⏪ 🏧 ✊ ✔ ⚪️➡️ 👫👫 🚪 👆. 👶
<img src="/img/async/concurrent-burgers/concurrent-burgers-01.png" class="illustration">
⤴️ ⚫️ 👆 🔄, 👆 🥉 👆 ✔ 2⃣ 📶 🎀 🍔 👆 🥰 &amp; 👆. 👶 👶
<img src="/img/async/concurrent-burgers/concurrent-burgers-02.png" class="illustration">
🏧 💬 🕳 🍳 👨‍🍳 👫 💭 👫 ✔️ 🏗 👆 🍔 (✋️ 👫 ⏳ 🏗 🕐 ⏮️ 👩‍💻).
<img src="/img/async/concurrent-burgers/concurrent-burgers-03.png" class="illustration">
👆 💸. 👶
🏧 🤝 👆 🔢 👆 🔄.
<img src="/img/async/concurrent-burgers/concurrent-burgers-04.png" class="illustration">
⏪ 👆 ⌛, 👆 🚶 ⏮️ 👆 🥰 &amp; ⚒ 🏓, 👆 🧎 &amp; 💬 ⏮️ 👆 🥰 📏 🕰 (👆 🍔 📶 🎀 &amp; ✊ 🕰 🏗).
👆 🏖 🏓 ⏮️ 👆 🥰, ⏪ 👆 ⌛ 🍔, 👆 💪 💸 👈 🕰 😮 ❔ 👌, 🐨 &amp; 🙃 👆 🥰 👶 👶 👶.
<img src="/img/async/concurrent-burgers/concurrent-burgers-05.png" class="illustration">
⏪ ⌛ &amp; 💬 👆 🥰, ⚪️➡️ 🕰 🕰, 👆 ✅ 🔢 🖥 🔛 ⏲ 👀 🚥 ⚫️ 👆 🔄 ⏪.
⤴️ ☝, ⚫️ 😒 👆 🔄. 👆 🚶 ⏲, 🤚 👆 🍔 &amp; 👟 🔙 🏓.
<img src="/img/async/concurrent-burgers/concurrent-burgers-06.png" class="illustration">
👆 &amp; 👆 🥰 🍴 🍔 &amp; ✔️ 👌 🕰. 👶
<img src="/img/async/concurrent-burgers/concurrent-burgers-07.png" class="illustration">
!!! info
🌹 🖼 <a href="https://www.instagram.com/ketrinadrawsalot" class="external-link" target="_blank">👯 🍏</a>. 👶
---
🌈 👆 💻 / 📋 👶 👈 📖.
⏪ 👆 ⏸, 👆 ⛽ 👶, ⌛ 👆 🔄, 🚫 🔨 🕳 📶 "😌". ✋️ ⏸ ⏩ ↩️ 🏧 🕴 ✊ ✔ (🚫 🏗 👫), 👈 👌.
⤴️, 🕐❔ ⚫️ 👆 🔄, 👆 ☑ "😌" 👷, 👆 🛠️ 🍣, 💭 ⚫️❔ 👆 💚, 🤚 👆 🥰 ⚒, 💸, ✅ 👈 👆 🤝 ☑ 💵 ⚖️ 💳, ✅ 👈 👆 🈚 ☑, ✅ 👈 ✔ ✔️ ☑ 🏬, ♒️.
✋️ ⤴️, ✋️ 👆 🚫 ✔️ 👆 🍔, 👆 👷 ⏮️ 🏧 "🔛 ⏸" ⏸, ↩️ 👆 ✔️ ⌛ 👶 👆 🍔 🔜.
✋️ 👆 🚶 ↖️ ⚪️➡️ ⏲ &amp; 🧎 🏓 ⏮️ 🔢 👆 🔄, 👆 💪 🎛 👶 👆 🙋 👆 🥰, &amp; "👷" 👶 👶 🔛 👈. ⤴️ 👆 🔄 🔨 🕳 📶 "😌" 😏 ⏮️ 👆 🥰 👶.
⤴️ 🏧 👶 💬 "👤 🏁 ⏮️ 🔨 🍔" 🚮 👆 🔢 🔛 ⏲ 🖥, ✋️ 👆 🚫 🦘 💖 😜 ⏪ 🕐❔ 🖥 🔢 🔀 👆 🔄 🔢. 👆 💭 🙅‍♂ 1⃣ 🔜 📎 👆 🍔 ↩️ 👆 ✔️ 🔢 👆 🔄, &amp; 👫 ✔️ 👫.
👆 ⌛ 👆 🥰 🏁 📖 (🏁 ⏮️ 👷 👶 / 📋 🛠️ 👶), 😀 🖐 &amp; 💬 👈 👆 🔜 🍔 ⏸.
⤴️ 👆 🚶 ⏲ 👶, ▶️ 📋 👈 🔜 🏁 👶, ⚒ 🍔, 💬 👏 &amp; ✊ 👫 🏓. 👈 🏁 👈 🔁 / 📋 🔗 ⏮️ ⏲ ⏹. 👈 🔄, ✍ 🆕 📋, "🍴 🍔" 👶 👶, ✋️ ⏮️ 1⃣ "🤚 🍔" 🏁 ⏹.
### 🔗 🍔
🔜 ➡️ 🌈 👫 ➖🚫 🚫 "🛠️ 🍔", ✋️ "🔗 🍔".
👆 🚶 ⏮️ 👆 🥰 🤚 🔗 ⏩ 🥕.
👆 🧍 ⏸ ⏪ 📚 (➡️ 💬 8⃣) 🏧 👈 🎏 🕰 🍳 ✊ ✔ ⚪️➡️ 👫👫 🚪 👆.
👱 ⏭ 👆 ⌛ 👫 🍔 🔜 ⏭ 🍂 ⏲ ↩️ 🔠 8⃣ 🏧 🚶 &amp; 🏗 🍔 ▶️️ ↖️ ⏭ 💆‍♂ ⏭ ✔.
<img src="/img/async/parallel-burgers/parallel-burgers-01.png" class="illustration">
⤴️ ⚫️ 😒 👆 🔄, 👆 🥉 👆 ✔ 2⃣ 📶 🎀 🍔 👆 🥰 &amp; 👆.
👆 💸 👶.
<img src="/img/async/parallel-burgers/parallel-burgers-02.png" class="illustration">
🏧 🚶 👨‍🍳.
👆 ⌛, 🧍 🚪 ⏲ 👶, 👈 🙅‍♂ 1⃣ 🙆 ✊ 👆 🍔 ⏭ 👆, 📤 🙅‍♂ 🔢 🔄.
<img src="/img/async/parallel-burgers/parallel-burgers-03.png" class="illustration">
👆 &amp; 👆 🥰 😩 🚫 ➡️ 🙆 🤚 🚪 👆 &amp; ✊ 👆 🍔 🕐❔ 👫 🛬, 👆 🚫🔜 💸 🙋 👆 🥰. 👶
👉 "🔁" 👷, 👆 "🔁" ⏮️ 🏧/🍳 👶 👶. 👆 ✔️ ⌛ 👶 &amp; 📤 ☑ 🙍 👈 🏧/🍳 👶 👶 🏁 🍔 &amp; 🤝 👫 👆, ⚖️ ⏪, 👱 🙆 💪 ✊ 👫.
<img src="/img/async/parallel-burgers/parallel-burgers-04.png" class="illustration">
⤴️ 👆 🏧/🍳 👶 👶 😒 👟 🔙 ⏮️ 👆 🍔, ⏮️ 📏 🕰 ⌛ 👶 📤 🚪 ⏲.
<img src="/img/async/parallel-burgers/parallel-burgers-05.png" class="illustration">
👆 ✊ 👆 🍔 &amp; 🚶 🏓 ⏮️ 👆 🥰.
👆 🍴 👫, &amp; 👆 🔨. ⏹
<img src="/img/async/parallel-burgers/parallel-burgers-06.png" class="illustration">
📤 🚫 🌅 💬 ⚖️ 😏 🌅 🕰 💸 ⌛ 👶 🚪 ⏲. 👶
!!! info
🌹 🖼 <a href="https://www.instagram.com/ketrinadrawsalot" class="external-link" target="_blank">👯 🍏</a>. 👶
---
👉 😐 🔗 🍔, 👆 💻 / 📋 👶 ⏮️ 2⃣ 🕹 (👆 &amp; 👆 🥰), 👯‍♂️ ⌛ 👶 &amp; 💡 👫 🙋 👶 "⌛ 🔛 ⏲" 👶 📏 🕰.
⏩ 🥕 🏪 ✔️ 8⃣ 🕹 (🏧/🍳). ⏪ 🛠️ 🍔 🏪 💪 ✔️ ✔️ 🕴 2⃣ (1⃣ 🏧 &amp; 1⃣ 🍳).
✋️, 🏁 💡 🚫 🏆. 👶
---
👉 🔜 🔗 🌓 📖 🍔. 👶
🌅 "🎰 👨‍❤‍👨" 🖼 👉, 🌈 🏦.
🆙 ⏳, 🏆 🏦 ✔️ 💗 🏧 👶 👶 👶 👶 👶 👶 👶 👶 &amp; 🦏 ⏸ 👶 👶 👶 👶 👶 👶 👶 👶.
🌐 🏧 🔨 🌐 👷 ⏮️ 1⃣ 👩‍💻 ⏮️ 🎏 👶 👶 👶.
&amp; 👆 ✔️ ⌛ 👶 ⏸ 📏 🕰 ⚖️ 👆 💸 👆 🔄.
👆 🎲 🚫🔜 💚 ✊ 👆 🥰 👶 ⏮️ 👆 👷 🏦 👶.
### 🍔 🏁
👉 😐 "⏩ 🥕 🍔 ⏮️ 👆 🥰", 📤 📚 ⌛ 👶, ⚫️ ⚒ 📚 🌅 🔑 ✔️ 🛠️ ⚙️ ⏸ 👶 👶.
👉 💼 🌅 🕸 🈸.
📚, 📚 👩‍💻, ✋️ 👆 💽 ⌛ 👶 👫 🚫--👍 🔗 📨 👫 📨.
&amp; ⤴️ ⌛ 👶 🔄 📨 👟 🔙.
👉 "⌛" 👶 ⚖ ⏲, ✋️, ⚖ ⚫️ 🌐, ⚫️ 📚 ⌛ 🔚.
👈 ⚫️❔ ⚫️ ⚒ 📚 🔑 ⚙️ 🔁 ⏸ 👶 👶 📟 🕸 🔗.
👉 😇 🔀 ⚫️❔ ⚒ ✳ 🌟 (✋️ ✳ 🚫 🔗) &amp; 👈 💪 🚶 🛠️ 🇪🇸.
&amp; 👈 🎏 🎚 🎭 👆 🤚 ⏮️ **FastAPI**.
&amp; 👆 💪 ✔️ 🔁 &amp; 🔀 🎏 🕰, 👆 🤚 ↕ 🎭 🌘 🌅 💯 ✳ 🛠️ &amp; 🔛 🇷🇪 ⏮️ 🚶, ❔ ✍ 🇪🇸 🔐 🅱 <a href="https://www.techempower.com/benchmarks/#section=data-r17&hw=ph&test=query&l=zijmkf-1" class="external-link" target="_blank">(🌐 👏 💃)</a>.
### 🛠️ 👍 🌘 🔁 ❓
😆 ❗ 👈 🚫 🛐 📖.
🛠️ 🎏 🌘 🔁. &amp; ⚫️ 👻 🔛 **🎯** 😐 👈 🔌 📚 ⌛. ↩️ 👈, ⚫️ 🛎 📚 👍 🌘 🔁 🕸 🈸 🛠️. ✋️ 🚫 🌐.
, ⚖ 👈 👅, 🌈 📄 📏 📖:
&gt; 👆 ✔️ 🧹 🦏, 💩 🏠.
*😆, 👈 🎂 📖*.
---
📤 🙅‍♂ ⌛ 👶 🙆, 📚 👷 🔨, 🔛 💗 🥉 🏠.
👆 💪 ✔️ 🔄 🍔 🖼, 🥇 🏠 🧖‍♂, ⤴️ 👨‍🍳, ✋️ 👆 🚫 ⌛ 👶 🕳, 🧹 &amp; 🧹, 🔄 🚫🔜 📉 🕳.
⚫️ 🔜 ✊ 🎏 💸 🕰 🏁 ⏮️ ⚖️ 🍵 🔄 (🛠️) &amp; 👆 🔜 ✔️ ⌛ 🎏 💸 👷.
✋️ 👉 💼, 🚥 👆 💪 ✊️ 8⃣ 👰-🏧/🍳/🔜-🧹, &amp; 🔠 1⃣ 👫 ( 👆) 💪 ✊ 🏒 🏠 🧹 ⚫️, 👆 💪 🌐 👷 **🔗**, ⏮️ , &amp; 🏁 🌅 🔜.
👉 😐, 🔠 1⃣ 🧹 (🔌 👆) 🔜 🕹, 🤸 👫 🍕 👨‍🏭.
&amp; 🏆 🛠️ 🕰 ✊ ☑ 👷 (↩️ ⌛), &amp; 👷 💻 ⌛ <abbr title="Central Processing Unit">💽</abbr>, 👫 🤙 👫 ⚠ "💽 🎁".
---
⚠ 🖼 💽 🔗 🛠️ 👜 👈 🚚 🏗 🧪 🏭.
🖼:
* **🎧** ⚖️ **🖼 🏭**.
* **💻 👓**: 🖼 ✍ 💯 🔅, 🔠 🔅 ✔️ 3⃣ 💲 / 🎨, 🏭 👈 🛎 🚚 💻 🕳 🔛 📚 🔅, 🌐 🎏 🕰.
* **🎰 🏫**: ⚫️ 🛎 🚚 📚 "✖" &amp; "🖼" ✖. 💭 🦏 📋 ⏮️ 🔢 &amp; ✖ 🌐 👫 👯‍♂️ 🎏 🕰.
* **⏬ 🏫**: 👉 🎧-🏑 🎰 🏫,, 🎏 ✔. ⚫️ 👈 📤 🚫 👁 📋 🔢 ✖, ✋️ 🦏 ⚒ 👫, &amp; 📚 💼, 👆 ⚙️ 🎁 🕹 🏗 &amp; / ⚖️ ⚙️ 👈 🏷.
### 🛠️ 🔁: 🕸 🎰 🏫
⏮️ **FastAPI** 👆 💪 ✊ 📈 🛠️ 👈 📶 ⚠ 🕸 🛠️ (🎏 👑 🧲 ✳).
✋️ 👆 💪 🐄 💰 🔁 &amp; 💾 (✔️ 💗 🛠️ 🏃‍♂ 🔗) **💽 🎁** ⚖ 💖 👈 🎰 🏫 ⚙️.
👈, 🙅 👐 👈 🐍 👑 🇪🇸 **💽 🧪**, 🎰 🏫 &amp; ✴️ ⏬ 🏫, ⚒ FastAPI 📶 👍 🏏 💽 🧪 / 🎰 🏫 🕸 🔗 &amp; 🈸 (👪 📚 🎏).
👀 ❔ 🏆 👉 🔁 🏭 👀 📄 🔃 [🛠️](deployment/index.md){.internal-link target=_blank}.
## `async` &amp; `await`
🏛 ⏬ 🐍 ✔️ 📶 🏋️ 🌌 🔬 🔁 📟. 👉 ⚒ ⚫️ 👀 💖 😐 "🔁" 📟 &amp; "⌛" 👆 ▶️️ 🙍.
🕐❔ 📤 🛠️ 👈 🔜 🚚 ⌛ ⏭ 🤝 🏁 &amp; ✔️ 🐕‍🦺 👉 🆕 🐍 ⚒, 👆 💪 📟 ⚫️ 💖:
```Python
burgers = await get_burgers(2)
```
🔑 📥 `await`. ⚫️ 💬 🐍 👈 ⚫️ ✔️ ⌛ ⏸ `get_burgers(2)` 🏁 🔨 🚮 👜 👶 ⏭ ♻ 🏁 `burgers`. ⏮️ 👈, 🐍 🔜 💭 👈 ⚫️ 💪 🚶 &amp; 🕳 🙆 👶 👶 👐 (💖 📨 1⃣ 📨).
`await` 👷, ⚫️ ✔️ 🔘 🔢 👈 🐕‍🦺 👉 🔀. 👈, 👆 📣 ⚫️ ⏮️ `async def`:
```Python hl_lines="1"
async def get_burgers(number: int):
# Do some asynchronous stuff to create the burgers
return burgers
```
...↩️ `def`:
```Python hl_lines="2"
# This is not asynchronous
def get_sequential_burgers(number: int):
# Do some sequential stuff to create the burgers
return burgers
```
⏮️ `async def`, 🐍 💭 👈, 🔘 👈 🔢, ⚫️ ✔️ 🤔 `await` 🧬, &amp; 👈 ⚫️ 💪 "⏸" ⏸ 🛠️ 👈 🔢 &amp; 🚶 🕳 🙆 👶 ⏭ 👟 🔙.
🕐❔ 👆 💚 🤙 `async def` 🔢, 👆 ✔️ "⌛" ⚫️. , 👉 🏆 🚫 👷:
```Python
# This won't work, because get_burgers was defined with: async def
burgers = get_burgers(2)
```
---
, 🚥 👆 ⚙️ 🗃 👈 💬 👆 👈 👆 💪 🤙 ⚫️ ⏮️ `await`, 👆 💪 ✍ *➡ 🛠️ 🔢* 👈 ⚙️ ⚫️ ⏮️ `async def`, 💖:
```Python hl_lines="2-3"
@app.get('/burgers')
async def read_burgers():
burgers = await get_burgers(2)
return burgers
```
### 🌅 📡
👆 💪 ✔️ 👀 👈 `await` 💪 🕴 ⚙️ 🔘 🔢 🔬 ⏮️ `async def`.
✋️ 🎏 🕰, 🔢 🔬 ⏮️ `async def` ✔️ "⌛". , 🔢 ⏮️ `async def` 💪 🕴 🤙 🔘 🔢 🔬 ⏮️ `async def` 💁‍♂️.
, 🔃 🥚 &amp; 🐔, ❔ 👆 🤙 🥇 `async` 🔢 ❓
🚥 👆 👷 ⏮️ **FastAPI** 👆 🚫 ✔️ 😟 🔃 👈, ↩️ 👈 "🥇" 🔢 🔜 👆 *➡ 🛠️ 🔢*, &amp; FastAPI 🔜 💭 ❔ ▶️️ 👜.
✋️ 🚥 👆 💚 ⚙️ `async` / `await` 🍵 FastAPI, 👆 💪 ⚫️ 👍.
### ✍ 👆 👍 🔁 📟
💃 (&amp; **FastAPI**) ⚓️ 🔛 <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a>, ❔ ⚒ ⚫️ 🔗 ⏮️ 👯‍♂️ 🐍 🐩 🗃 <a href="https://docs.python.org/3/library/asyncio-task.html" class="external-link" target="_blank">✳</a> &amp; <a href="https://trio.readthedocs.io/en/stable/" class="external-link" target="_blank">🎻</a>.
🎯, 👆 💪 🔗 ⚙️ <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a> 👆 🏧 🛠️ ⚙️ 💼 👈 🚚 🌅 🏧 ⚓ 👆 👍 📟.
&amp; 🚥 👆 🚫 ⚙️ FastAPI, 👆 💪 ✍ 👆 👍 🔁 🈸 ⏮️ <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a> 🏆 🔗 &amp; 🤚 🚮 💰 (✅ *📊 🛠️*).
### 🎏 📨 🔁 📟
👉 👗 ⚙️ `async` &amp; `await` 📶 🆕 🇪🇸.
✋️ ⚫️ ⚒ 👷 ⏮️ 🔁 📟 📚 ⏩.
👉 🎏 ❕ (⚖️ 🌖 🌓) 🔌 ⏳ 🏛 ⏬ 🕸 (🖥 &amp; ✳).
✋️ ⏭ 👈, 🚚 🔁 📟 🌖 🏗 &amp; ⚠.
⏮️ ⏬ 🐍, 👆 💪 ✔️ ⚙️ 🧵 ⚖️ <a href="https://www.gevent.org/" class="external-link" target="_blank">🐁</a>. ✋️ 📟 🌌 🌖 🏗 🤔, , &amp; 💭 🔃.
⏮️ ⏬ ✳ / 🖥 🕸, 👆 🔜 ✔️ ⚙️ "⏲". ❔ ↘️ <a href="http://callbackhell.com/" class="external-link" target="_blank">⏲ 🔥😈</a>.
## 🔁
**🔁** 📶 🎀 ⚖ 👜 📨 `async def` 🔢. 🐍 💭 👈 ⚫️ 🕳 💖 🔢 👈 ⚫️ 💪 ▶️ &amp; 👈 ⚫️ 🔜 🔚 ☝, ✋️ 👈 ⚫️ 5⃣📆 ⏸ ⏸ 🔘 💁‍♂️, 🕐❔ 📤 `await` 🔘 ⚫️.
✋️ 🌐 👉 🛠️ ⚙️ 🔁 📟 ⏮️ `async` &amp; `await` 📚 🕰 🔬 ⚙️ "🔁". ⚫️ ⭐ 👑 🔑 ⚒ 🚶, "🔁".
## 🏁
➡️ 👀 🎏 🔤 ⚪️➡️ 🔛:
> 🏛 ⏬ 🐍 ✔️ 🐕‍🦺 **"🔁 📟"** ⚙️ 🕳 🤙 **"🔁"**, ⏮️ **`async` &amp; `await`** ❕.
👈 🔜 ⚒ 🌅 🔑 🔜. 👶
🌐 👈 ⚫️❔ 🏋️ FastAPI (🔘 💃) &amp; ⚫️❔ ⚒ ⚫️ ✔️ ✅ 🎆 🎭.
## 📶 📡
!!! warning
👆 💪 🎲 🚶 👉.
👉 📶 📡 ❔ **FastAPI** 👷 🔘.
🚥 👆 ✔️ 📡 💡 (🈶-🏋, 🧵, 🍫, ♒️.) &amp; 😟 🔃 ❔ FastAPI 🍵 `async def` 🆚 😐 `def`, 🚶 ⤴️.
### ➡ 🛠️ 🔢
🕐❔ 👆 📣 *➡ 🛠️ 🔢* ⏮️ 😐 `def` ↩️ `async def`, ⚫️ 🏃 🔢 🧵 👈 ⤴️ ⌛, ↩️ 🤙 🔗 (⚫️ 🔜 🍫 💽).
🚥 👆 👟 ⚪️➡️ 1⃣ 🔁 🛠️ 👈 🔨 🚫 👷 🌌 🔬 🔛 &amp; 👆 ⚙️ ⚖ 🙃 📊-🕴 *➡ 🛠️ 🔢* ⏮️ ✅ `def` 🤪 🎭 📈 (🔃 1⃣0⃣0⃣ 💓), 🙏 🗒 👈 **FastAPI** ⭐ 🔜 🔄. 👫 💼, ⚫️ 👻 ⚙️ `async def` 🚥 👆 *➡ 🛠️ 🔢* ⚙️ 📟 👈 🎭 🚧 <abbr title="Input/Output: disk reading or writing, network communications.">👤/🅾</abbr>.
, 👯‍♂️ ⚠, 🤞 👈 **FastAPI** 🔜 [⏩](/#performance){.internal-link target=_blank} 🌘 (⚖️ 🌘 ⭐) 👆 ⏮️ 🛠️.
### 🔗
🎏 ✔ [🔗](./tutorial/dependencies/index.md){.internal-link target=_blank}. 🚥 🔗 🐩 `def` 🔢 ↩️ `async def`, ⚫️ 🏃 🔢 🧵.
### 🎧-🔗
👆 💪 ✔️ 💗 🔗 &amp; [🎧-🔗](./tutorial/dependencies/sub-dependencies.md){.internal-link target=_blank} 🚫 🔠 🎏 (🔢 🔢 🔑), 👫 💪 ✍ ⏮️ `async def` &amp; ⏮️ 😐 `def`. ⚫️ 🔜 👷, &amp; 🕐 ✍ ⏮️ 😐 `def` 🔜 🤙 🔛 🔢 🧵 (⚪️➡️ 🧵) ↩️ "⌛".
### 🎏 🚙 🔢
🙆 🎏 🚙 🔢 👈 👆 🤙 🔗 💪 ✍ ⏮️ 😐 `def` ⚖️ `async def` &amp; FastAPI 🏆 🚫 📉 🌌 👆 🤙 ⚫️.
👉 🔅 🔢 👈 FastAPI 🤙 👆: *➡ 🛠️ 🔢* &amp; 🔗.
🚥 👆 🚙 🔢 😐 🔢 ⏮️ `def`, ⚫️ 🔜 🤙 🔗 (👆 ✍ ⚫️ 👆 📟), 🚫 🧵, 🚥 🔢 ✍ ⏮️ `async def` ⤴️ 👆 🔜 `await` 👈 🔢 🕐❔ 👆 🤙 ⚫️ 👆 📟.
---
🔄, 👉 📶 📡 👈 🔜 🎲 ⚠ 🚥 👆 👟 🔎 👫.
⏪, 👆 🔜 👍 ⏮️ 📄 ⚪️➡️ 📄 🔛: <a href="#in-a-hurry">🏃 ❓</a>.

View File

@@ -0,0 +1,34 @@
# 📇
🔬 🇸🇲 📇 🎦 **FastAPI** 🈸 🏃‍♂ 🔽 Uvicorn <a href="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7" class="external-link" target="_blank">1⃣ ⏩ 🐍 🛠️ 💪</a>, 🕴 🔛 💃 &amp; Uvicorn 👫 (⚙️ 🔘 FastAPI). (*)
✋️ 🕐❔ ✅ 📇 &amp; 🔺 👆 🔜 ✔️ 📄 🤯.
## 📇 &amp; 🚅
🕐❔ 👆 ✅ 📇, ⚫️ ⚠ 👀 📚 🧰 🎏 🆎 🔬 🌓.
🎯, 👀 Uvicorn, 💃 &amp; FastAPI 🔬 👯‍♂️ (👪 📚 🎏 🧰).
🙅 ⚠ ❎ 🧰, 👍 🎭 ⚫️ 🔜 🤚. &amp; 🏆 📇 🚫 💯 🌖 ⚒ 🚚 🧰.
🔗 💖:
* **Uvicorn**: 🔫 💽
* **💃**: (⚙️ Uvicorn) 🕸 🕸
* **FastAPI**: (⚙️ 💃) 🛠️ 🕸 ⏮️ 📚 🌖 ⚒ 🏗 🔗, ⏮️ 💽 🔬, ♒️.
* **Uvicorn**:
* 🔜 ✔️ 🏆 🎭, ⚫️ 🚫 ✔️ 🌅 📟 ↖️ ⚪️➡️ 💽 ⚫️.
* 👆 🚫🔜 ✍ 🈸 Uvicorn 🔗. 👈 🔜 ⛓ 👈 👆 📟 🔜 ✔️ 🔌 🌖 ⚖️ 🌘, 🌘, 🌐 📟 🚚 💃 (⚖️ **FastAPI**). &amp; 🚥 👆 👈, 👆 🏁 🈸 🔜 ✔️ 🎏 🌥 ✔️ ⚙️ 🛠️ &amp; 📉 👆 📱 📟 &amp; 🐛.
* 🚥 👆 ⚖ Uvicorn, 🔬 ⚫️ 🛡 👸, Hypercorn, ✳, ♒️. 🈸 💽.
* **💃**:
* 🔜 ✔️ ⏭ 🏆 🎭, ⏮️ Uvicorn. 👐, 💃 ⚙️ Uvicorn 🏃. , ⚫️ 🎲 💪 🕴 🤚 "🐌" 🌘 Uvicorn ✔️ 🛠️ 🌅 📟.
* ✋️ ⚫️ 🚚 👆 🧰 🏗 🙅 🕸 🈸, ⏮️ 🕹 ⚓️ 🔛 ➡, ♒️.
* 🚥 👆 ⚖ 💃, 🔬 ⚫️ 🛡 🤣, 🏺, ✳, ♒️. 🕸 🛠️ (⚖️ 🕸).
* **FastAPI**:
* 🎏 🌌 👈 💃 ⚙️ Uvicorn &amp; 🚫🔜 ⏩ 🌘 ⚫️, **FastAPI** ⚙️ 💃, ⚫️ 🚫🔜 ⏩ 🌘 ⚫️.
* FastAPI 🚚 🌅 ⚒ 🔛 🔝 💃. ⚒ 👈 👆 🌖 🕧 💪 🕐❔ 🏗 🔗, 💖 💽 🔬 &amp; 🛠️. &amp; ⚙️ ⚫️, 👆 🤚 🏧 🧾 🆓 (🏧 🧾 🚫 🚮 🌥 🏃‍♂ 🈸, ⚫️ 🏗 🔛 🕴).
* 🚥 👆 🚫 ⚙️ FastAPI &amp; ⚙️ 💃 🔗 (⚖️ 1⃣ 🧰, 💖 🤣, 🏺, 🆘, ♒️) 👆 🔜 ✔️ 🛠️ 🌐 💽 🔬 &amp; 🛠️ 👆. , 👆 🏁 🈸 🔜 ✔️ 🎏 🌥 🚥 ⚫️ 🏗 ⚙️ FastAPI. &amp; 📚 💼, 👉 💽 🔬 &amp; 🛠️ 🦏 💸 📟 ✍ 🈸.
* , ⚙️ FastAPI 👆 ♻ 🛠️ 🕰, 🐛, ⏸ 📟, &amp; 👆 🔜 🎲 🤚 🎏 🎭 (⚖️ 👍) 👆 🔜 🚥 👆 🚫 ⚙️ ⚫️ (👆 🔜 ✔️ 🛠️ ⚫️ 🌐 👆 📟).
* 🚥 👆 ⚖ FastAPI, 🔬 ⚫️ 🛡 🕸 🈸 🛠️ (⚖️ ⚒ 🧰) 👈 🚚 💽 🔬, 🛠️ &amp; 🧾, 💖 🏺-apispec, NestJS, ♨, ♒️. 🛠️ ⏮️ 🛠️ 🏧 💽 🔬, 🛠️ &amp; 🧾.

View File

@@ -0,0 +1,465 @@
# 🛠️ - 📉
🥇, 👆 💪 💚 👀 🔰 🌌 [ FastAPI &amp; 🤚 ](help-fastapi.md){.internal-link target=_blank}.
## 🛠️
🚥 👆 ⏪ 🖖 🗃 &amp; 👆 💭 👈 👆 💪 ⏬ 🤿 📟, 📥 📄 ⚒ 🆙 👆 🌐.
### 🕹 🌐 ⏮️ `venv`
👆 💪 ✍ 🕹 🌐 📁 ⚙️ 🐍 `venv` 🕹:
<div class="termy">
```console
$ python -m venv env
```
</div>
👈 🔜 ✍ 📁 `./env/` ⏮️ 🐍 💱 &amp; ⤴️ 👆 🔜 💪 ❎ 📦 👈 ❎ 🌐.
### 🔓 🌐
🔓 🆕 🌐 ⏮️:
=== "💾, 🇸🇻"
<div class="termy">
```console
$ source ./env/bin/activate
```
</div>
=== "🚪 📋"
<div class="termy">
```console
$ .\env\Scripts\Activate.ps1
```
</div>
=== "🚪 🎉"
⚖️ 🚥 👆 ⚙️ 🎉 🖥 (✅ <a href="https://gitforwindows.org/" class="external-link" target="_blank">🐛 🎉</a>):
<div class="termy">
```console
$ source ./env/Scripts/activate
```
</div>
✅ ⚫️ 👷, ⚙️:
=== "💾, 🇸🇻, 🚪 🎉"
<div class="termy">
```console
$ which pip
some/directory/fastapi/env/bin/pip
```
</div>
=== "🚪 📋"
<div class="termy">
```console
$ Get-Command pip
some/directory/fastapi/env/bin/pip
```
</div>
🚥 ⚫️ 🎦 `pip` 💱 `env/bin/pip` ⤴️ ⚫️ 👷. 👶
⚒ 💭 👆 ✔️ 📰 🐖 ⏬ 🔛 👆 🕹 🌐 ❎ ❌ 🔛 ⏭ 📶:
<div class="termy">
```console
$ python -m pip install --upgrade pip
---> 100%
```
</div>
!!! tip
🔠 🕰 👆 ❎ 🆕 📦 ⏮️ `pip` 🔽 👈 🌐, 🔓 🌐 🔄.
👉 ⚒ 💭 👈 🚥 👆 ⚙️ 📶 📋 ❎ 👈 📦, 👆 ⚙️ 1⃣ ⚪️➡️ 👆 🇧🇿 🌐 &amp; 🚫 🙆 🎏 👈 💪 ❎ 🌐.
### 🐖
⏮️ 🔓 🌐 🔬 🔛:
<div class="termy">
```console
$ pip install -r requirements.txt
---> 100%
```
</div>
⚫️ 🔜 ❎ 🌐 🔗 &amp; 👆 🇧🇿 FastAPI 👆 🇧🇿 🌐.
#### ⚙️ 👆 🇧🇿 FastAPI
🚥 👆 ✍ 🐍 📁 👈 🗄 &amp; ⚙️ FastAPI, &amp; 🏃 ⚫️ ⏮️ 🐍 ⚪️➡️ 👆 🇧🇿 🌐, ⚫️ 🔜 ⚙️ 👆 🇧🇿 FastAPI 📟.
&amp; 🚥 👆 👈 🇧🇿 FastAPI 📟, ⚫️ ❎ ⏮️ `-e`, 🕐❔ 👆 🏃 👈 🐍 📁 🔄, ⚫️ 🔜 ⚙️ 🍋 ⏬ FastAPI 👆 ✍.
👈 🌌, 👆 🚫 ✔️ "❎" 👆 🇧🇿 ⏬ 💪 💯 🔠 🔀.
### 📁
📤 ✍ 👈 👆 💪 🏃 👈 🔜 📁 &amp; 🧹 🌐 👆 📟:
<div class="termy">
```console
$ bash scripts/format.sh
```
</div>
⚫️ 🔜 🚘-😇 🌐 👆 🗄.
⚫️ 😇 👫 ☑, 👆 💪 ✔️ FastAPI ❎ 🌐 👆 🌐, ⏮️ 📋 📄 🔛 ⚙️ `-e`.
## 🩺
🥇, ⚒ 💭 👆 ⚒ 🆙 👆 🌐 🔬 🔛, 👈 🔜 ❎ 🌐 📄.
🧾 ⚙️ <a href="https://www.mkdocs.org/" class="external-link" target="_blank">⬜</a>.
&amp; 📤 🧰/✍ 🥉 🍵 ✍ `./scripts/docs.py`.
!!! tip
👆 🚫 💪 👀 📟 `./scripts/docs.py`, 👆 ⚙️ ⚫️ 📋 ⏸.
🌐 🧾 ✍ 📁 📁 `./docs/en/`.
📚 🔰 ✔️ 🍫 📟.
🌅 💼, 👫 🍫 📟 ☑ 🏁 🈸 👈 💪 🏃.
👐, 👈 🍫 📟 🚫 ✍ 🔘 ✍, 👫 🐍 📁 `./docs_src/` 📁.
&amp; 👈 🐍 📁 🔌/💉 🧾 🕐❔ 🏭 🕸.
### 🩺 💯
🏆 💯 🤙 🏃 🛡 🖼 📁 🧾.
👉 ⚒ 💭 👈:
* 🧾 🆙 📅.
* 🧾 🖼 💪 🏃.
* 🌅 ⚒ 📔 🧾, 🚚 💯 💰.
⏮️ 🇧🇿 🛠️, 📤 ✍ 👈 🏗 🕸 &amp; ✅ 🙆 🔀, 🖖-🔫:
<div class="termy">
```console
$ python ./scripts/docs.py live
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
</div>
⚫️ 🔜 🍦 🧾 🔛 `http://127.0.0.1:8008`.
👈 🌌, 👆 💪 ✍ 🧾/ 📁 &amp; 👀 🔀 🖖.
#### 🏎 ✳ (📦)
👩‍🌾 📥 🎦 👆 ❔ ⚙️ ✍ `./scripts/docs.py` ⏮️ `python` 📋 🔗.
✋️ 👆 💪 ⚙️ <a href="https://typer.tiangolo.com/typer-cli/" class="external-link" target="_blank">🏎 ✳</a>, &amp; 👆 🔜 🤚 ✍ 👆 📶 📋 ⏮️ ❎ 🛠️.
🚥 👆 ❎ 🏎 ✳, 👆 💪 ❎ 🛠️ ⏮️:
<div class="termy">
```console
$ typer --install-completion
zsh completion installed in /home/user/.bashrc.
Completion will take effect once you restart the terminal.
```
</div>
### 📱 &amp; 🩺 🎏 🕰
🚥 👆 🏃 🖼 ⏮️, ✅:
<div class="termy">
```console
$ uvicorn tutorial001:app --reload
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
Uvicorn 🔢 🔜 ⚙️ ⛴ `8000`, 🧾 🔛 ⛴ `8008` 🏆 🚫 ⚔.
### ✍
⏮️ ✍ 📶 🌅 👍 ❗ &amp; ⚫️ 💪 🚫 🔨 🍵 ⚪️➡️ 👪. 👶 👶
📥 📶 ⏮️ ✍.
#### 💁‍♂ &amp; 📄
* ✅ ⏳ <a href="https://github.com/tiangolo/fastapi/pulls" class="external-link" target="_blank">♻ 🚲 📨</a> 👆 🇪🇸 &amp; 🚮 📄 ✔ 🔀 ⚖️ ✔ 👫.
!!! tip
👆 💪 <a href="https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request" class="external-link" target="_blank">🚮 🏤 ⏮️ 🔀 🔑</a> ♻ 🚲 📨.
✅ 🩺 🔃 <a href="https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-pull-request-reviews" class="external-link" target="_blank">❎ 🚲 📨 📄</a> ✔ ⚫️ ⚖️ 📨 🔀.
* ✅ <a href="https://github.com/tiangolo/fastapi/issues" class="external-link" target="_blank">❔</a> 👀 🚥 📤 1⃣ 🛠️ ✍ 👆 🇪🇸.
* 🚮 👁 🚲 📨 📍 📃 💬. 👈 🔜 ⚒ ⚫️ 🌅 ⏩ 🎏 📄 ⚫️.
🇪🇸 👤 🚫 💬, 👤 🔜 ⌛ 📚 🎏 📄 ✍ ⏭ 🔗.
* 👆 💪 ✅ 🚥 📤 ✍ 👆 🇪🇸 &amp; 🚮 📄 👫, 👈 🔜 👤 💭 👈 ✍ ☑ &amp; 👤 💪 🔗 ⚫️.
* ⚙️ 🎏 🐍 🖼 &amp; 🕴 💬 ✍ 🩺. 👆 🚫 ✔️ 🔀 🕳 👉 👷.
* ⚙️ 🎏 🖼, 📁 📛, &amp; 🔗. 👆 🚫 ✔️ 🔀 🕳 ⚫️ 👷.
* ✅ 2⃣-🔤 📟 🇪🇸 👆 💚 💬 👆 💪 ⚙️ 🏓 <a href="https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes" class="external-link" target="_blank">📇 💾 6⃣3⃣9⃣-1⃣ 📟</a>.
#### ♻ 🇪🇸
➡️ 💬 👆 💚 💬 📃 🇪🇸 👈 ⏪ ✔️ ✍ 📃, 💖 🇪🇸.
💼 🇪🇸, 2⃣-🔤 📟 `es`. , 📁 🇪🇸 ✍ 🔎 `docs/es/`.
!!! tip
👑 ("🛂") 🇪🇸 🇪🇸, 🔎 `docs/en/`.
🔜 🏃 🖖 💽 🩺 🇪🇸:
<div class="termy">
```console
// Use the command "live" and pass the language code as a CLI argument
$ python ./scripts/docs.py live es
<span style="color: green;">[INFO]</span> Serving on http://127.0.0.1:8008
<span style="color: green;">[INFO]</span> Start watching changes
<span style="color: green;">[INFO]</span> Start detecting changes
```
</div>
🔜 👆 💪 🚶 <a href="http://127.0.0.1:8008" class="external-link" target="_blank">http://127.0.0.1:8008</a> &amp; 👀 👆 🔀 🖖.
🚥 👆 👀 FastAPI 🩺 🕸, 👆 🔜 👀 👈 🔠 🇪🇸 ✔️ 🌐 📃. ✋️ 📃 🚫 💬 &amp; ✔️ 📨 🔃 ❌ ✍.
✋️ 🕐❔ 👆 🏃 ⚫️ 🌐 💖 👉, 👆 🔜 🕴 👀 📃 👈 ⏪ 💬.
🔜 ➡️ 💬 👈 👆 💚 🚮 ✍ 📄 [⚒](features.md){.internal-link target=_blank}.
* 📁 📁:
```
docs/en/docs/features.md
```
* 📋 ⚫️ ⚫️❔ 🎏 🗺 ✋️ 🇪🇸 👆 💚 💬, ✅:
```
docs/es/docs/features.md
```
!!! tip
👀 👈 🕴 🔀 ➡ &amp; 📁 📛 🇪🇸 📟, ⚪️➡️ `en` `es`.
* 🔜 📂 ⬜ 📁 📁 🇪🇸:
```
docs/en/mkdocs.yml
```
* 🔎 🥉 🌐❔ 👈 `docs/features.md` 🔎 📁 📁. 👱 💖:
```YAML hl_lines="8"
site_name: FastAPI
# More stuff
nav:
- FastAPI: index.md
- Languages:
- en: /
- es: /es/
- features.md
```
* 📂 ⬜ 📁 📁 🇪🇸 👆 ✍, ✅:
```
docs/es/mkdocs.yml
```
* 🚮 ⚫️ 📤 ☑ 🎏 🗺 ⚫️ 🇪🇸, ✅:
```YAML hl_lines="8"
site_name: FastAPI
# More stuff
nav:
- FastAPI: index.md
- Languages:
- en: /
- es: /es/
- features.md
```
⚒ 💭 👈 🚥 📤 🎏 ⛔, 🆕 ⛔ ⏮️ 👆 ✍ ⚫️❔ 🎏 ✔ 🇪🇸 ⏬.
🚥 👆 🚶 👆 🖥 👆 🔜 👀 👈 🔜 🩺 🎦 👆 🆕 📄. 👶
🔜 👆 💪 💬 ⚫️ 🌐 &amp; 👀 ❔ ⚫️ 👀 👆 🖊 📁.
#### 🆕 🇪🇸
➡️ 💬 👈 👆 💚 🚮 ✍ 🇪🇸 👈 🚫 💬, 🚫 📃.
➡️ 💬 👆 💚 🚮 ✍ 🇭🇹, &amp; ⚫️ 🚫 📤 🩺.
✅ 🔗 ⚪️➡️ 🔛, 📟 "🇭🇹" `ht`.
⏭ 🔁 🏃 ✍ 🏗 🆕 ✍ 📁:
<div class="termy">
```console
// Use the command new-lang, pass the language code as a CLI argument
$ python ./scripts/docs.py new-lang ht
Successfully initialized: docs/ht
Updating ht
Updating en
```
</div>
🔜 👆 💪 ✅ 👆 📟 👨‍🎨 ⏳ ✍ 📁 `docs/ht/`.
!!! tip
✍ 🥇 🚲 📨 ⏮️ 👉, ⚒ 🆙 📳 🆕 🇪🇸, ⏭ ❎ ✍.
👈 🌌 🎏 💪 ⏮️ 🎏 📃 ⏪ 👆 👷 🔛 🥇 🕐. 👶
▶️ ✍ 👑 📃, `docs/ht/index.md`.
⤴️ 👆 💪 😣 ⏮️ ⏮️ 👩‍🌾, "♻ 🇪🇸".
##### 🆕 🇪🇸 🚫 🐕‍🦺
🚥 🕐❔ 🏃‍♂ 🖖 💽 ✍ 👆 🤚 ❌ 🔃 🇪🇸 🚫 🐕‍🦺, 🕳 💖:
```
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: partials/language/xx.html
```
👈 ⛓ 👈 🎢 🚫 🐕‍🦺 👈 🇪🇸 (👉 💼, ⏮️ ❌ 2⃣-🔤 📟 `xx`).
✋️ 🚫 😟, 👆 💪 ⚒ 🎢 🇪🇸 🇪🇸 &amp; ⤴️ 💬 🎚 🩺.
🚥 👆 💪 👈, ✍ `mkdocs.yml` 👆 🆕 🇪🇸, ⚫️ 🔜 ✔️ 🕳 💖:
```YAML hl_lines="5"
site_name: FastAPI
# More stuff
theme:
# More stuff
language: xx
```
🔀 👈 🇪🇸 ⚪️➡️ `xx` (⚪️➡️ 👆 🇪🇸 📟) `en`.
⤴️ 👆 💪 ▶️ 🖖 💽 🔄.
#### 🎮 🏁
🕐❔ 👆 ⚙️ ✍ `./scripts/docs.py` ⏮️ `live` 📋 ⚫️ 🕴 🎦 📁 &amp; ✍ 💪 ⏮️ 🇪🇸.
✋️ 🕐 👆 🔨, 👆 💪 💯 ⚫️ 🌐 ⚫️ 🔜 👀 💳.
👈, 🥇 🏗 🌐 🩺:
<div class="termy">
```console
// Use the command "build-all", this will take a bit
$ python ./scripts/docs.py build-all
Updating es
Updating en
Building docs for: en
Building docs for: es
Successfully built docs for: es
Copying en index.md to README.md
```
</div>
👈 🏗 🌐 🩺 `./docs_build/` 🔠 🇪🇸. 👉 🔌 ❎ 🙆 📁 ⏮️ ❌ ✍, ⏮️ 🗒 💬 👈 "👉 📁 🚫 ✔️ ✍". ✋️ 👆 🚫 ✔️ 🕳 ⏮️ 👈 📁.
⤴️ ⚫️ 🏗 🌐 👈 🔬 ⬜ 🕸 🔠 🇪🇸, 🌀 👫, &amp; 🏗 🏁 🔢 `./site/`.
⤴️ 👆 💪 🍦 👈 ⏮️ 📋 `serve`:
<div class="termy">
```console
// Use the command "serve" after running "build-all"
$ python ./scripts/docs.py serve
Warning: this is a very simple server. For development, use mkdocs serve instead.
This is here only to preview a site with translations already built.
Make sure you run the build-all command first.
Serving at: http://127.0.0.1:8008
```
</div>
## 💯
📤 ✍ 👈 👆 💪 🏃 🌐 💯 🌐 📟 &amp; 🏗 💰 📄 🕸:
<div class="termy">
```console
$ bash scripts/test-cov-html.sh
```
</div>
👉 📋 🏗 📁 `./htmlcov/`, 🚥 👆 📂 📁 `./htmlcov/index.html` 👆 🖥, 👆 💪 🔬 🖥 🇹🇼 📟 👈 📔 💯, &amp; 👀 🚥 📤 🙆 🇹🇼 ❌.

View File

@@ -0,0 +1,311 @@
# 🛠️ 🔧
🕐❔ 🛠️ **FastAPI** 🈸, ⚖️ 🤙, 🙆 🆎 🕸 🛠️, 📤 📚 🔧 👈 👆 🎲 💅 🔃, &amp; ⚙️ 👫 👆 💪 🔎 **🏆 ☑** 🌌 **🛠️ 👆 🈸**.
⚠ 🔧:
* 💂‍♂ - 🇺🇸🔍
* 🏃‍♂ 🔛 🕴
*
* 🧬 (🔢 🛠️ 🏃)
* 💾
* ⏮️ 🔁 ⏭ ▶️
👥 🔜 👀 ❔ 👫 🔜 📉 **🛠️**.
🔚, 🏆 🎯 💪 **🍦 👆 🛠️ 👩‍💻** 🌌 👈 **🔐**, **❎ 📉**, &amp; ⚙️ **📊 ** (🖼 🛰 💽/🕹 🎰) ♻ 💪. 👶
👤 🔜 💬 👆 🍖 🌖 🔃 👫 **🔧** 📥, &amp; 👈 🔜 🤞 🤝 👆 **🤔** 👆 🔜 💪 💭 ❔ 🛠️ 👆 🛠️ 📶 🎏 🌐, 🎲 **🔮** 🕐 👈 🚫 🔀.
🤔 👫 🔧, 👆 🔜 💪 **🔬 &amp; 🔧** 🏆 🌌 🛠️ **👆 👍 🔗**.
⏭ 📃, 👤 🔜 🤝 👆 🌅 **🧱 🍮** 🛠️ FastAPI 🈸.
✋️ 🔜, ➡️ ✅ 👉 ⚠ **⚛ 💭**. 👫 🔧 ✔ 🙆 🎏 🆎 🕸 🛠️. 👶
## 💂‍♂ - 🇺🇸🔍
[⏮️ 📃 🔃 🇺🇸🔍](./https.md){.internal-link target=_blank} 👥 🇭🇲 🔃 ❔ 🇺🇸🔍 🚚 🔐 👆 🛠️.
👥 👀 👈 🇺🇸🔍 🛎 🚚 🦲 **🔢** 👆 🈸 💽, **🤝 ❎ 🗳**.
&amp; 📤 ✔️ 🕳 🈚 **♻ 🇺🇸🔍 📄**, ⚫️ 💪 🎏 🦲 ⚖️ ⚫️ 💪 🕳 🎏.
### 🖼 🧰 🇺🇸🔍
🧰 👆 💪 ⚙️ 🤝 ❎ 🗳:
* Traefik
* 🔁 🍵 📄 🔕 👶
* 📥
* 🔁 🍵 📄 🔕 👶
* 👌
* ⏮️ 🔢 🦲 💖 Certbot 📄 🔕
*
* ⏮️ 🔢 🦲 💖 Certbot 📄 🔕
* Kubernetes ⏮️ 🚧 🕹 💖 👌
* ⏮️ 🔢 🦲 💖 🛂-👨‍💼 📄 🔕
* 🍵 🔘 ☁ 🐕‍🦺 🍕 👫 🐕‍🦺 (✍ 🔛 👶)
1⃣ 🎛 👈 👆 💪 ⚙️ **☁ 🐕‍🦺** 👈 🔨 🌖 👷 ✅ ⚒ 🆙 🇺🇸🔍. ⚫️ 💪 ✔️ 🚫 ⚖️ 🈚 👆 🌅, ♒️. ✋️ 👈 💼, 👆 🚫🔜 ✔️ ⚒ 🆙 🤝 ❎ 🗳 👆.
👤 🔜 🎦 👆 🧱 🖼 ⏭ 📃.
---
⤴️ ⏭ 🔧 🤔 🌐 🔃 📋 🏃 👆 ☑ 🛠️ (✅ Uvicorn).
## 📋 &amp; 🛠️
👥 🔜 💬 📚 🔃 🏃 "**🛠️**", ⚫️ ⚠ ✔️ ☯ 🔃 ⚫️❔ ⚫️ ⛓, &amp; ⚫️❔ 🔺 ⏮️ 🔤 "**📋**".
### ⚫️❔ 📋
🔤 **📋** 🛎 ⚙️ 🔬 📚 👜:
* **📟** 👈 👆 ✍, **🐍 📁**.
* **📁** 👈 💪 **🛠️** 🏃‍♂ ⚙️, 🖼: `python`, `python.exe` ⚖️ `uvicorn`.
* 🎯 📋 ⏪ ⚫️ **🏃‍♂** 🔛 🏗 ⚙️, ⚙️ 💽, &amp; ♻ 👜 🔛 💾. 👉 🤙 **🛠️**.
### ⚫️❔ 🛠️
🔤 **🛠️** 🛎 ⚙️ 🌖 🎯 🌌, 🕴 🔗 👜 👈 🏃 🏃‍♂ ⚙️ (💖 🏁 ☝ 🔛):
* 🎯 📋 ⏪ ⚫️ **🏃‍♂** 🔛 🏃‍♂ ⚙️.
* 👉 🚫 🔗 📁, 🚫 📟, ⚫️ 🔗 **🎯** 👜 👈 **🛠️** &amp; 🔄 🏃‍♂ ⚙️.
* 🙆 📋, 🙆 📟, **💪 🕴 👜** 🕐❔ ⚫️ **🛠️**. , 🕐❔ 📤 **🛠️ 🏃**.
* 🛠️ 💪 **❎** (⚖️ "💥") 👆, ⚖️ 🏃‍♂ ⚙️. 👈 ☝, ⚫️ ⛔️ 🏃/ 🛠️, &amp; ⚫️ 💪 **🙅‍♂ 📏 👜**.
* 🔠 🈸 👈 👆 ✔️ 🏃 🔛 👆 💻 ✔️ 🛠️ ⛅ ⚫️, 🔠 🏃‍♂ 📋, 🔠 🚪, ♒️. &amp; 📤 🛎 📚 🛠️ 🏃 **🎏 🕰** ⏪ 💻 🔛.
* 📤 💪 **💗 🛠️** **🎏 📋** 🏃 🎏 🕰.
🚥 👆 ✅ 👅 "📋 👨‍💼" ⚖️ "⚙️ 🖥" (⚖️ 🎏 🧰) 👆 🏃‍♂ ⚙️, 👆 🔜 💪 👀 📚 👈 🛠️ 🏃‍♂.
&amp; , 🖼, 👆 🔜 🎲 👀 👈 📤 💗 🛠️ 🏃 🎏 🖥 📋 (🦎, 💄, 📐, ♒️). 👫 🛎 🏃 1⃣ 🛠️ 📍 📑, 🎏 🛠️.
<img class="shadow" src="/img/deployment/concepts/image01.png">
---
🔜 👈 👥 💭 🔺 🖖 ⚖ **🛠️** &amp; **📋**, ➡️ 😣 💬 🔃 🛠️.
## 🏃‍♂ 🔛 🕴
🌅 💼, 🕐❔ 👆 ✍ 🕸 🛠️, 👆 💚 ⚫️ **🕧 🏃‍♂**, ➡, 👈 👆 👩‍💻 💪 🕧 🔐 ⚫️. 👉 ↗️, 🚥 👆 ✔️ 🎯 🤔 ⚫️❔ 👆 💚 ⚫️ 🏃 🕴 🎯 ⚠, ✋️ 🌅 🕰 👆 💚 ⚫️ 🕧 🏃‍♂ &amp; **💪**.
### 🛰 💽
🕐❔ 👆 ⚒ 🆙 🛰 💽 (☁ 💽, 🕹 🎰, ♒️.) 🙅 👜 👆 💪 🏃 Uvicorn (⚖️ 🎏) ❎, 🎏 🌌 👆 🕐❔ 🛠️ 🌐.
&amp; ⚫️ 🔜 👷 &amp; 🔜 ⚠ **⏮️ 🛠️**.
✋️ 🚥 👆 🔗 💽 💸, **🏃‍♂ 🛠️** 🔜 🎲 ☠️.
&amp; 🚥 💽 ⏏ (🖼 ⏮️ , ⚖️ 🛠️ ⚪️➡️ ☁ 🐕‍🦺) 👆 🎲 **🏆 🚫 👀 ⚫️**. &amp; ↩️ 👈, 👆 🏆 🚫 💭 👈 👆 ✔️ ⏏ 🛠️ ❎. , 👆 🛠️ 🔜 🚧 ☠️. 👶
### 🏃 🔁 🔛 🕴
🏢, 👆 🔜 🎲 💚 💽 📋 (✅ Uvicorn) ▶️ 🔁 🔛 💽 🕴, &amp; 🍵 💪 🙆 **🗿 🏥**, ✔️ 🛠️ 🕧 🏃 ⏮️ 👆 🛠️ (✅ Uvicorn 🏃‍♂ 👆 FastAPI 📱).
### 🎏 📋
🏆 👉, 👆 🔜 🛎 ✔️ **🎏 📋** 👈 🔜 ⚒ 💭 👆 🈸 🏃 🔛 🕴. &amp; 📚 💼, ⚫️ 🔜 ⚒ 💭 🎏 🦲 ⚖️ 🈸 🏃, 🖼, 💽.
### 🖼 🧰 🏃 🕴
🖼 🧰 👈 💪 👉 👨‍🏭:
*
* Kubernetes
* ☁ ✍
* ☁ 🐝 📳
*
* 👨‍💻
* 🍵 🔘 ☁ 🐕‍🦺 🍕 👫 🐕‍🦺
* 🎏...
👤 🔜 🤝 👆 🌅 🧱 🖼 ⏭ 📃.
## ⏏
🎏 ⚒ 💭 👆 🈸 🏃 🔛 🕴, 👆 🎲 💚 ⚒ 💭 ⚫️ **⏏** ⏮️ ❌.
### 👥 ⚒ ❌
👥, 🗿, ⚒ **❌**, 🌐 🕰. 🖥 🌖 *🕧* ✔️ **🐛** 🕵‍♂ 🎏 🥉. 👶
&amp; 👥 👩‍💻 🚧 📉 📟 👥 🔎 👈 🐛 &amp; 👥 🛠️ 🆕 ⚒ (🎲 ❎ 🆕 🐛 💁‍♂️ 👶).
### 🤪 ❌ 🔁 🍵
🕐❔ 🏗 🕸 🔗 ⏮️ FastAPI, 🚥 📤 ❌ 👆 📟, FastAPI 🔜 🛎 🔌 ⚫️ 👁 📨 👈 ⏲ ❌. 🛡
👩‍💻 🔜 🤚 **5⃣0⃣0⃣ 🔗 💽 ❌** 👈 📨, ✋️ 🈸 🔜 😣 👷 ⏭ 📨 ↩️ 💥 🍕.
### 🦏 ❌ - 💥
👐, 📤 5⃣📆 💼 🌐❔ 👥 ✍ 📟 👈 **💥 🎂 🈸** ⚒ Uvicorn &amp; 🐍 💥. 👶
&amp; , 👆 🔜 🎲 🚫 💚 🈸 🚧 ☠️ ↩️ 📤 ❌ 1⃣ 🥉, 👆 🎲 💚 ⚫️ **😣 🏃** 🌘 *➡ 🛠️* 👈 🚫 💔.
### ⏏ ⏮️ 💥
✋️ 👈 💼 ⏮️ 🤙 👎 ❌ 👈 💥 🏃‍♂ **🛠️**, 👆 🔜 💚 🔢 🦲 👈 🈚 **🔁** 🛠️, 🌘 👩‍❤‍👨 🕰...
!!! tip
...👐 🚥 🎂 🈸 **💥 ⏪** ⚫️ 🎲 🚫 ⚒ 🔑 🚧 🔁 ⚫️ ♾. ✋️ 📚 💼, 👆 🔜 🎲 👀 ⚫️ ⏮️ 🛠️, ⚖️ 🌘 ▶️️ ⏮️ 🛠️.
➡️ 🎯 🔛 👑 💼, 🌐❔ ⚫️ 💪 💥 🍕 🎯 💼 **🔮**, &amp; ⚫️ ⚒ 🔑 ⏏ ⚫️.
👆 🔜 🎲 💚 ✔️ 👜 🈚 🔁 👆 🈸 **🔢 🦲**, ↩️ 👈 ☝, 🎏 🈸 ⏮️ Uvicorn &amp; 🐍 ⏪ 💥, 📤 🕳 🎏 📟 🎏 📱 👈 💪 🕳 🔃 ⚫️.
### 🖼 🧰 ⏏ 🔁
🏆 💼, 🎏 🧰 👈 ⚙️ **🏃 📋 🔛 🕴** ⚙️ 🍵 🏧 **⏏**.
🖼, 👉 💪 🍵:
*
* Kubernetes
* ☁ ✍
* ☁ 🐝 📳
*
* 👨‍💻
* 🍵 🔘 ☁ 🐕‍🦺 🍕 👫 🐕‍🦺
* 🎏...
## 🧬 - 🛠️ &amp; 💾
⏮️ FastAPI 🈸, ⚙️ 💽 📋 💖 Uvicorn, 🏃‍♂ ⚫️ 🕐 **1⃣ 🛠️** 💪 🍦 💗 👩‍💻 🔁.
✋️ 📚 💼, 👆 🔜 💚 🏃 📚 👨‍🏭 🛠️ 🎏 🕰.
### 💗 🛠️ - 👨‍🏭
🚥 👆 ✔️ 🌅 👩‍💻 🌘 ⚫️❔ 👁 🛠️ 💪 🍵 (🖼 🚥 🕹 🎰 🚫 💁‍♂️ 🦏) &amp; 👆 ✔️ **💗 🐚** 💽 💽, ⤴️ 👆 💪 ✔️ **💗 🛠️** 🏃‍♂ ⏮️ 🎏 🈸 🎏 🕰, &amp; 📎 🌐 📨 👪 👫.
🕐❔ 👆 🏃 **💗 🛠️** 🎏 🛠️ 📋, 👫 🛎 🤙 **👨‍🏭**.
### 👨‍🏭 🛠️ &amp; ⛴
💭 ⚪️➡️ 🩺 [🔃 🇺🇸🔍](./https.md){.internal-link target=_blank} 👈 🕴 1⃣ 🛠️ 💪 👂 🔛 1⃣ 🌀 ⛴ &amp; 📢 📢 💽 ❓
👉 ☑.
, 💪 ✔️ **💗 🛠️** 🎏 🕰, 📤 ✔️ **👁 🛠️ 👂 🔛 ⛴** 👈 ⤴️ 📶 📻 🔠 👨‍🏭 🛠️ 🌌.
### 💾 📍 🛠️
🔜, 🕐❔ 📋 📐 👜 💾, 🖼, 🎰 🏫 🏷 🔢, ⚖️ 🎚 ⭕ 📁 🔢, 🌐 👈 **🍴 👄 💾 (💾)** 💽.
&amp; 💗 🛠️ 🛎 **🚫 💰 🙆 💾**. 👉 ⛓ 👈 🔠 🏃 🛠️ ✔️ 🚮 👍 👜, 🔢, &amp; 💾. &amp; 🚥 👆 😩 ⭕ 💸 💾 👆 📟, **🔠 🛠️** 🔜 🍴 🌓 💸 💾.
### 💽 💾
🖼, 🚥 👆 📟 📐 🎰 🏫 🏷 ⏮️ **1⃣ 💾 📐**, 🕐❔ 👆 🏃 1⃣ 🛠️ ⏮️ 👆 🛠️, ⚫️ 🔜 🍴 🌘 1⃣ 💾 💾. &amp; 🚥 👆 ▶️ **4⃣ 🛠️** (4⃣ 👨‍🏭), 🔠 🔜 🍴 1⃣ 💾 💾. 🌐, 👆 🛠️ 🔜 🍴 **4⃣ 💾 💾**.
&amp; 🚥 👆 🛰 💽 ⚖️ 🕹 🎰 🕴 ✔️ 3⃣ 💾 💾, 🔄 📐 🌅 🌘 4⃣ 💾 💾 🔜 🤕 ⚠. 👶
### 💗 🛠️ - 🖼
👉 🖼, 📤 **👨‍💼 🛠️** 👈 ▶️ &amp; 🎛 2**👨‍🏭 🛠️**.
👉 👨‍💼 🛠️ 🔜 🎲 1⃣ 👂 🔛 **⛴** 📢. &amp; ⚫️ 🔜 📶 🌐 📻 👨‍🏭 🛠️.
👈 👨‍🏭 🛠️ 🔜 🕐 🏃‍♂ 👆 🈸, 👫 🔜 🎭 👑 📊 📨 **📨** &amp; 📨 **📨**, &amp; 👫 🔜 📐 🕳 👆 🚮 🔢 💾.
<img src="/img/deployment/concepts/process-ram.svg">
&amp; ↗️, 🎏 🎰 🔜 🎲 ✔️ **🎏 🛠️** 🏃 👍, ↖️ ⚪️➡️ 👆 🈸.
😌 👈 🌐 **💽 ⚙️** 🔠 🛠️ 💪 **🪀** 📚 🤭 🕰, ✋️ **💾 (💾)** 🛎 🚧 🌖 ⚖️ 🌘 **⚖**.
🚥 👆 ✔️ 🛠️ 👈 🔨 ⭐ 💸 📊 🔠 🕰 &amp; 👆 ✔️ 📚 👩‍💻, ⤴️ **💽 🛠️** 🔜 🎲 ** (↩️ 🕧 🔜 🆙 &amp; 🔽 🔜).
### 🖼 🧬 🧰 &amp; 🎛
📤 💪 📚 🎯 🏆 👉, &amp; 👤 🔜 💬 👆 🌅 🔃 🎯 🎛 ⏭ 📃, 🖼 🕐❔ 💬 🔃 ☁ &amp; 📦.
👑 ⚛ 🤔 👈 📤 ✔️ **👁** 🦲 🚚 **⛴** **📢 📢**. &amp; ⤴️ ⚫️ ✔️ ✔️ 🌌 **📶** 📻 🔁 **🛠️/👨‍🏭**.
📥 💪 🌀 &amp; 🎛:
* **🐁** 🛠️ **Uvicorn 👨‍🏭**
* 🐁 🔜 **🛠️ 👨‍💼** 👂 🔛 **📢** &amp; **⛴**, 🧬 🔜 ✔️ **💗 Uvicorn 👨‍🏭 🛠️**
* **Uvicorn** 🛠️ **Uvicorn 👨‍🏭**
* 1⃣ Uvicorn **🛠️ 👨‍💼** 🔜 👂 🔛 **📢** &amp; **⛴**, &amp; ⚫️ 🔜 ▶️ **💗 Uvicorn 👨‍🏭 🛠️**
* **Kubernetes** &amp; 🎏 📎 **📦 ⚙️**
* 🕳 **☁** 🧽 🔜 👂 🔛 **📢** &amp; **⛴**. 🧬 🔜 ✔️ **💗 📦**, 🔠 ⏮️ **1⃣ Uvicorn 🛠️** 🏃‍♂
* **☁ 🐕‍🦺** 👈 🍵 👉 👆
* ☁ 🐕‍🦺 🔜 🎲 **🍵 🧬 👆**. ⚫️ 🔜 🎲 ➡️ 👆 🔬 **🛠️ 🏃**, ⚖️ **📦 🖼** ⚙️, 🙆 💼, ⚫️ 🔜 🌅 🎲 **👁 Uvicorn 🛠️**, &amp; ☁ 🐕‍🦺 🔜 🈚 🔁 ⚫️.
!!! tip
🚫 😟 🚥 👫 🏬 🔃 **📦**, ☁, ⚖️ Kubernetes 🚫 ⚒ 📚 🔑.
👤 🔜 💬 👆 🌅 🔃 📦 🖼, ☁, Kubernetes, ♒️. 🔮 📃: [FastAPI 📦 - ☁](./docker.md){.internal-link target=_blank}.
## ⏮️ 🔁 ⏭ ▶️
📤 📚 💼 🌐❔ 👆 💚 🎭 📶 **⏭ ▶️** 👆 🈸.
🖼, 👆 💪 💚 🏃 **💽 🛠️**.
✋️ 🌅 💼, 👆 🔜 💚 🎭 👉 🔁 🕴 **🕐**.
, 👆 🔜 💚 ✔️ **👁 🛠️** 🎭 👈 **⏮️ 🔁**, ⏭ ▶️ 🈸.
&amp; 👆 🔜 ✔️ ⚒ 💭 👈 ⚫️ 👁 🛠️ 🏃 👈 ⏮️ 🔁 ** 🚥 ⏮️, 👆 ▶️ **💗 🛠️** (💗 👨‍🏭) 🈸 ⚫️. 🚥 👈 🔁 🏃 **💗 🛠️**, 👫 🔜 **❎** 👷 🏃‍♂ ⚫️ 🔛 **🔗**, &amp; 🚥 📶 🕳 💎 💖 💽 🛠️, 👫 💪 🤕 ⚔ ⏮️ 🔠 🎏.
↗️, 📤 💼 🌐❔ 📤 🙅‍♂ ⚠ 🏃 ⏮️ 🔁 💗 🕰, 👈 💼, ⚫️ 📚 ⏩ 🍵.
!!! tip
, ✔️ 🤯 👈 ⚓️ 🔛 👆 🖥, 💼 👆 **5⃣📆 🚫 💪 🙆 ⏮️ 🔁** ⏭ ▶️ 👆 🈸.
👈 💼, 👆 🚫🔜 ✔️ 😟 🔃 🙆 👉. 🤷
### 🖼 ⏮️ 🔁 🎛
👉 🔜 **🪀 🙇** 🔛 🌌 👆 **🛠️ 👆 ⚙️**, &amp; ⚫️ 🔜 🎲 🔗 🌌 👆 ▶️ 📋, 🚚 ⏏, ♒️.
📥 💪 💭:
* "🕑 📦" Kubernetes 👈 🏃 ⏭ 👆 📱 📦
* 🎉 ✍ 👈 🏃 ⏮️ 🔁 &amp; ⤴️ ▶️ 👆 🈸
* 👆 🔜 💪 🌌 ▶️/⏏ *👈* 🎉 ✍, 🔍 ❌, ♒️.
!!! tip
👤 🔜 🤝 👆 🌅 🧱 🖼 🔨 👉 ⏮️ 📦 🔮 📃: [FastAPI 📦 - ☁](./docker.md){.internal-link target=_blank}.
## 🛠️
👆 💽(Ⓜ) () ****, 👆 💪 🍴 ⚖️ **⚙️**, ⏮️ 👆 📋, 📊 🕰 🔛 💽, &amp; 💾 💾 💪.
❔ 🌅 ⚙️ 👆 💚 😩/♻ ❓ ⚫️ 💪 ⏩ 💭 "🚫 🌅", ✋️ 🌌, 👆 🔜 🎲 💚 🍴 **🌅 💪 🍵 💥**.
🚥 👆 💸 3⃣ 💽 ✋️ 👆 ⚙️ 🕴 🐥 🍖 👫 💾 &amp; 💽, 👆 🎲 **🗑 💸** 👶, &amp; 🎲 **🗑 💽 🔦 🏋️** 👶, ♒️.
👈 💼, ⚫️ 💪 👻 ✔️ 🕴 2⃣ 💽 &amp; ⚙️ ↕ 🌐 👫 (💽, 💾, 💾, 🕸 💿, ♒️).
🔛 🎏 ✋, 🚥 👆 ✔️ 2⃣ 💽 &amp; 👆 ⚙️ **1⃣0⃣0⃣ 💯 👫 💽 &amp; 💾**, ☝ 1⃣ 🛠️ 🔜 💭 🌅 💾, &amp; 💽 🔜 ✔️ ⚙️ 💾 "💾" (❔ 💪 💯 🕰 🐌), ⚖️ **💥**. ⚖️ 1⃣ 🛠️ 💪 💪 📊 &amp; 🔜 ✔️ ⌛ ⏭ 💽 🆓 🔄.
👉 💼, ⚫️ 🔜 👍 🤚 **1 💽** &amp; 🏃 🛠️ 🔛 ⚫️ 👈 👫 🌐 ✔️ **🥃 💾 &amp; 💽 🕰**.
📤 🤞 👈 🤔 👆 ✔️ **🌵** ⚙️ 👆 🛠️. 🎲 ⚫️ 🚶 🦠, ⚖️ 🎲 🎏 🐕‍🦺 ⚖️ 🤖 ▶️ ⚙️ ⚫️. &amp; 👆 💪 💚 ✔️ 🔒 👈 💼.
👆 💪 🚮 **❌ 🔢** 🎯, 🖼, 🕳 **🖖 5⃣0⃣ 💯 9⃣0⃣ 💯** 🛠️. ☝ 👈 📚 🎲 👑 👜 👆 🔜 💚 ⚖ &amp; ⚙️ ⚒ 👆 🛠️.
👆 💪 ⚙️ 🙅 🧰 💖 `htop` 👀 💽 &amp; 💾 ⚙️ 👆 💽 ⚖️ 💸 ⚙️ 🔠 🛠️. ⚖️ 👆 💪 ⚙️ 🌖 🏗 ⚖ 🧰, ❔ 5⃣📆 📎 🤭 💽, ♒️.
## 🌃
👆 ✔️ 👂 📥 👑 🔧 👈 👆 🔜 🎲 💪 ✔️ 🤯 🕐❔ 🤔 ❔ 🛠️ 👆 🈸:
* 💂‍♂ - 🇺🇸🔍
* 🏃‍♂ 🔛 🕴
*
* 🧬 (🔢 🛠️ 🏃)
* 💾
* ⏮️ 🔁 ⏭ ▶️
🤔 👉 💭 &amp; ❔ ✔ 👫 🔜 🤝 👆 🤔 💪 ✊ 🙆 🚫 🕐❔ 🛠️ &amp; 🛠️ 👆 🛠️. 👶
⏭ 📄, 👤 🔜 🤝 👆 🌅 🧱 🖼 💪 🎛 👆 💪 ⏩. 👶

View File

@@ -0,0 +1,698 @@
# FastAPI 📦 - ☁
🕐❔ 🛠️ FastAPI 🈸 ⚠ 🎯 🏗 **💾 📦 🖼**. ⚫️ 🛎 🔨 ⚙️ <a href="https://www.docker.com/" class="external-link" target="_blank">**☁**</a>. 👆 💪 ⤴️ 🛠️ 👈 📦 🖼 1⃣ 👩‍❤‍👨 💪 🌌.
⚙️ 💾 📦 ✔️ 📚 📈 ✅ **💂‍♂**, **🔬**, **🦁**, &amp; 🎏.
!!! tip
🏃 &amp; ⏪ 💭 👉 💩 ❓ 🦘 [`Dockerfile` 🔛 👶](#build-a-docker-image-for-fastapi).
<details>
<summary>📁 🎮 👶</summary>
```Dockerfile
FROM python:3.9
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./app /code/app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
# If running behind a proxy like Nginx or Traefik add --proxy-headers
# CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80", "--proxy-headers"]
```
</details>
## ⚫️❔ 📦
📦 (✴️ 💾 📦) 📶 **💿** 🌌 📦 🈸 ✅ 🌐 👫 🔗 &amp; 💪 📁 ⏪ 🚧 👫 ❎ ⚪️➡️ 🎏 📦 (🎏 🈸 ⚖️ 🦲) 🎏 ⚙️.
💾 📦 🏃 ⚙️ 🎏 💾 💾 🦠 (🎰, 🕹 🎰, ☁ 💽, ♒️). 👉 ⛓ 👈 👫 📶 💿 (🔬 🌕 🕹 🎰 👍 🎂 🏃‍♂ ⚙️).
👉 🌌, 📦 🍴 **🐥 **, 💸 ⭐ 🏃‍♂ 🛠️ 🔗 (🕹 🎰 🔜 🍴 🌅 🌅).
📦 ✔️ 👫 👍 **❎** 🏃‍♂ 🛠️ (🛎 1⃣ 🛠️), 📁 ⚙️, &amp; 🕸, 🔬 🛠️, 💂‍♂, 🛠️, ♒️.
## ⚫️❔ 📦 🖼
**📦** 🏃 ⚪️➡️ **📦 🖼**.
📦 🖼 **🎻** ⏬ 🌐 📁, 🌐 🔢, &amp; 🔢 📋/📋 👈 🔜 🎁 📦. **🎻** 📥 ⛓ 👈 📦 **🖼** 🚫 🏃, ⚫️ 🚫 🛠️, ⚫️ 🕴 📦 📁 &amp; 🗃.
🔅 "**📦 🖼**" 👈 🏪 🎻 🎚,"**📦**" 🛎 🔗 🏃‍♂ 👐, 👜 👈 **🛠️**.
🕐❔ **📦** ▶️ &amp; 🏃‍♂ (▶️ ⚪️➡️ **📦 🖼**) ⚫️ 💪 ✍ ⚖️ 🔀 📁, 🌐 🔢, ♒️. 👈 🔀 🔜 🔀 🕴 👈 📦, ✋️ 🔜 🚫 😣 👽 📦 🖼 (🔜 🚫 🖊 💾).
📦 🖼 ⭐ **📋** 📁 &amp; 🎚, ✅ `python` &amp; 📁 `main.py`.
&amp; **📦** ⚫️ (🔅 **📦 🖼**) ☑ 🏃 👐 🖼, ⭐ **🛠️**. 👐, 📦 🏃 🕴 🕐❔ ⚫️ ✔️ **🛠️ 🏃** (&amp; 🛎 ⚫️ 🕴 👁 🛠️). 📦 ⛔️ 🕐❔ 📤 🙅‍♂ 🛠️ 🏃 ⚫️.
## 📦 🖼
☁ ✔️ 1⃣ 👑 🧰 ✍ &amp; 🛠️ **📦 🖼** &amp; **📦**.
&amp; 📤 📢 <a href="https://hub.docker.com/" class="external-link" target="_blank">☁ 🎡</a> ⏮️ 🏤-⚒ **🛂 📦 🖼** 📚 🧰, 🌐, 💽, &amp; 🈸.
🖼, 📤 🛂 <a href="https://hub.docker.com/_/python" class="external-link" target="_blank">🐍 🖼</a>.
&amp; 📤 📚 🎏 🖼 🎏 👜 💖 💽, 🖼:
* <a href="https://hub.docker.com/_/postgres" class="external-link" target="_blank">✳</a>
* <a href="https://hub.docker.com/_/mysql" class="external-link" target="_blank">✳</a>
* <a href="https://hub.docker.com/_/mongo" class="external-link" target="_blank">✳</a>
* <a href="https://hub.docker.com/_/redis" class="external-link" target="_blank">✳</a>, ♒️.
⚙️ 🏤-⚒ 📦 🖼 ⚫️ 📶 ⏩ **🌀** &amp; ⚙️ 🎏 🧰. 🖼, 🔄 👅 🆕 💽. 🌅 💼, 👆 💪 ⚙️ **🛂 🖼**, &amp; 🔗 👫 ⏮️ 🌐 🔢.
👈 🌌, 📚 💼 👆 💪 💡 🔃 📦 &amp; ☁ &amp; 🏤-⚙️ 👈 💡 ⏮️ 📚 🎏 🧰 &amp; 🦲.
, 👆 🔜 🏃 **💗 📦** ⏮️ 🎏 👜, 💖 💽, 🐍 🈸, 🕸 💽 ⏮️ 😥 🕸 🈸, &amp; 🔗 👫 👯‍♂️ 📨 👫 🔗 🕸.
🌐 📦 🧾 ⚙️ (💖 ☁ ⚖️ Kubernetes) ✔️ 👫 🕸 ⚒ 🛠️ 🔘 👫.
## 📦 &amp; 🛠️
**📦 🖼** 🛎 🔌 🚮 🗃 🔢 📋 ⚖️ 📋 👈 🔜 🏃 🕐❔ **📦** ▶️ &amp; 🔢 🚶‍♀️ 👈 📋. 📶 🎏 ⚫️❔ 🔜 🚥 ⚫️ 📋 ⏸.
🕐❔ **📦** ▶️, ⚫️ 🔜 🏃 👈 📋/📋 (👐 👆 💪 🔐 ⚫️ &amp; ⚒ ⚫️ 🏃 🎏 📋/📋).
📦 🏃 📏 **👑 🛠️** (📋 ⚖️ 📋) 🏃.
📦 🛎 ✔️ **👁 🛠️**, ✋️ ⚫️ 💪 ▶️ ✳ ⚪️➡️ 👑 🛠️, &amp; 👈 🌌 👆 🔜 ✔️ **💗 🛠️** 🎏 📦.
✋️ ⚫️ 🚫 💪 ✔️ 🏃‍♂ 📦 🍵 **🌘 1⃣ 🏃‍♂ 🛠️**. 🚥 👑 🛠️ ⛔️, 📦 ⛔️.
## 🏗 ☁ 🖼 FastAPI
🆗, ➡️ 🏗 🕳 🔜 ❗ 👶
👤 🔜 🎦 👆 ❔ 🏗 **☁ 🖼** FastAPI **⚪️➡️ 🖌**, ⚓️ 🔛 **🛂 🐍** 🖼.
👉 ⚫️❔ 👆 🔜 💚 **🏆 💼**, 🖼:
* ⚙️ **Kubernetes** ⚖️ 🎏 🧰
* 🕐❔ 🏃‍♂ 🔛 **🍓 👲**
* ⚙️ ☁ 🐕‍🦺 👈 🔜 🏃 📦 🖼 👆, ♒️.
### 📦 📄
👆 🔜 🛎 ✔️ **📦 📄** 👆 🈸 📁.
⚫️ 🔜 🪀 ✴️ 🔛 🧰 👆 ⚙️ **❎** 👈 📄.
🌅 ⚠ 🌌 ⚫️ ✔️ 📁 `requirements.txt` ⏮️ 📦 📛 &amp; 👫 ⏬, 1⃣ 📍 ⏸.
👆 🔜 ↗️ ⚙️ 🎏 💭 👆 ✍ [🔃 FastAPI ⏬](./versions.md){.internal-link target=_blank} ⚒ ↔ ⏬.
🖼, 👆 `requirements.txt` 💪 👀 💖:
```
fastapi>=0.68.0,<0.69.0
pydantic>=1.8.0,<2.0.0
uvicorn>=0.15.0,<0.16.0
```
&amp; 👆 🔜 🛎 ❎ 👈 📦 🔗 ⏮️ `pip`, 🖼:
<div class="termy">
```console
$ pip install -r requirements.txt
---> 100%
Successfully installed fastapi pydantic uvicorn
```
</div>
!!! info
📤 🎏 📁 &amp; 🧰 🔬 &amp; ❎ 📦 🔗.
👤 🔜 🎦 👆 🖼 ⚙️ 🎶 ⏪ 📄 🔛. 👶
### ✍ **FastAPI** 📟
*`app` 📁 &amp; ⛔ ⚫️.
* ✍ 🛁 📁 `__init__.py`.
*`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}
```
### 📁
🔜 🎏 🏗 📁 ✍ 📁 `Dockerfile` ⏮️:
```{ .dockerfile .annotate }
# (1)
FROM python:3.9
# (2)
WORKDIR /code
# (3)
COPY ./requirements.txt /code/requirements.txt
# (4)
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# (5)
COPY ./app /code/app
# (6)
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
```
1⃣. ▶️ ⚪️➡️ 🛂 🐍 🧢 🖼.
2⃣. ⚒ ⏮️ 👷 📁 `/code`.
👉 🌐❔ 👥 🔜 🚮 `requirements.txt` 📁 &amp; `app` 📁.
3⃣. 📁 📁 ⏮️ 📄 `/code` 📁.
📁 **🕴** 📁 ⏮️ 📄 🥇, 🚫 🎂 📟.
👉 📁 **🚫 🔀 🛎**, ☁ 🔜 🔍 ⚫️ &amp; ⚙️ **💾** 👉 🔁, 🛠️ 💾 ⏭ 🔁 💁‍♂️.
4⃣. ❎ 📦 🔗 📄 📁.
`--no-cache-dir` 🎛 💬 `pip` 🚫 🖊 ⏬ 📦 🌐, 👈 🕴 🚥 `pip` 🔜 🏃 🔄 ❎ 🎏 📦, ✋️ 👈 🚫 💼 🕐❔ 👷 ⏮️ 📦.
!!! note
`--no-cache-dir` 🕴 🔗 `pip`, ⚫️ ✔️ 🕳 ⏮️ ☁ ⚖️ 📦.
`--upgrade` 🎛 💬 `pip` ♻ 📦 🚥 👫 ⏪ ❎.
↩️ ⏮️ 🔁 🖨 📁 💪 🔍 **☁ 💾**, 👉 🔁 🔜 **⚙️ ☁ 💾** 🕐❔ 💪.
⚙️ 💾 👉 🔁 🔜 **🖊** 👆 📚 **🕰** 🕐❔ 🏗 🖼 🔄 &amp; 🔄 ⏮️ 🛠️, ↩️ **⏬ &amp; ❎** 🌐 🔗 **🔠 🕰**.
5⃣. 📁 `./app` 📁 🔘 `/code` 📁.
👉 ✔️ 🌐 📟 ❔ ⚫️❔ **🔀 🌅 🛎** ☁ **💾** 🏆 🚫 ⚙️ 👉 ⚖️ 🙆 **📄 🔁** 💪.
, ⚫️ ⚠ 🚮 👉 **🏘 🔚** `Dockerfile`, 🔬 📦 🖼 🏗 🕰.
6⃣. ⚒ **📋** 🏃 `uvicorn` 💽.
`CMD` ✊ 📇 🎻, 🔠 👫 🎻 ⚫️❔ 👆 🔜 🆎 📋 ⏸ 👽 🚀.
👉 📋 🔜 🏃 ⚪️➡️ **⏮️ 👷 📁**, 🎏 `/code` 📁 👆 ⚒ 🔛 ⏮️ `WORKDIR /code`.
↩️ 📋 🔜 ▶️ `/code` &amp; 🔘 ⚫️ 📁 `./app` ⏮️ 👆 📟, **Uvicorn** 🔜 💪 👀 &amp; **🗄** `app` ⚪️➡️ `app.main`.
!!! tip
📄 ⚫️❔ 🔠 ⏸ 🔨 🖊 🔠 🔢 💭 📟. 👶
👆 🔜 🔜 ✔️ 📁 📊 💖:
```
.
├── app
│   ├── __init__.py
│ └── main.py
├── Dockerfile
└── requirements.txt
```
#### ⛅ 🤝 ❎ 🗳
🚥 👆 🏃‍♂ 👆 📦 ⛅ 🤝 ❎ 🗳 (📐 ⚙) 💖 👌 ⚖️ Traefik, 🚮 🎛 `--proxy-headers`, 👉 🔜 💬 Uvicorn 💙 🎚 📨 👈 🗳 💬 ⚫️ 👈 🈸 🏃 ⛅ 🇺🇸🔍, ♒️.
```Dockerfile
CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]
```
#### ☁ 💾
📤 ⚠ 🎱 👉 `Dockerfile`, 👥 🥇 📁 **📁 ⏮️ 🔗 😞**, 🚫 🎂 📟. ➡️ 👤 💬 👆 ⚫️❔ 👈.
```Dockerfile
COPY ./requirements.txt /code/requirements.txt
```
☁ &amp; 🎏 🧰 **🏗** 👉 📦 🖼 **🔁**, 🚮 **1⃣ 🧽 🔛 🔝 🎏**, ▶️ ⚪️➡️ 🔝 `Dockerfile` &amp; ❎ 🙆 📁 ✍ 🔠 👩‍🌾 `Dockerfile`.
☁ &amp; 🎏 🧰 ⚙️ **🔗 💾** 🕐❔ 🏗 🖼, 🚥 📁 🚫 🔀 ↩️ 🏁 🕰 🏗 📦 🖼, ⤴️ ⚫️ 🔜 **🏤-⚙️ 🎏 🧽** ✍ 🏁 🕰, ↩️ 🖨 📁 🔄 &amp; 🏗 🆕 🧽 ⚪️➡️ 🖌.
❎ 📁 📁 🚫 🎯 📉 👜 💁‍♂️ 🌅, ✋️ ↩️ ⚫️ ⚙️ 💾 👈 🔁, ⚫️ 💪 **⚙️ 💾 ⏭ 🔁**. 🖼, ⚫️ 💪 ⚙️ 💾 👩‍🌾 👈 ❎ 🔗 ⏮️:
```Dockerfile
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
```
📁 ⏮️ 📦 📄 **🏆 🚫 🔀 🛎**. , 🖨 🕴 👈 📁, ☁ 🔜 💪 **⚙️ 💾** 👈 🔁.
&amp; ⤴️, ☁ 🔜 💪 **⚙️ 💾 ⏭ 🔁** 👈 ⏬ &amp; ❎ 👈 🔗. &amp; 📥 🌐❔ 👥 **🖊 📚 🕰**. 👶 ...&amp; ❎ 😩 ⌛. 👶 👶
⏬ &amp; ❎ 📦 🔗 **💪 ✊ ⏲**, ✋️ ⚙️ **💾** 🔜 **✊ 🥈** 🌅.
&amp; 👆 🔜 🏗 📦 🖼 🔄 &amp; 🔄 ⏮️ 🛠️ ✅ 👈 👆 📟 🔀 👷, 📤 📚 📈 🕰 👉 🔜 🖊.
⤴️, 🏘 🔚 `Dockerfile`, 👥 📁 🌐 📟. 👉 ⚫️❔ **🔀 🏆 🛎**, 👥 🚮 ⚫️ 🏘 🔚, ↩️ 🌖 🕧, 🕳 ⏮️ 👉 🔁 🔜 🚫 💪 ⚙️ 💾.
```Dockerfile
COPY ./app /code/app
```
### 🏗 ☁ 🖼
🔜 👈 🌐 📁 🥉, ➡️ 🏗 📦 🖼.
* 🚶 🏗 📁 (🌐❔ 👆 `Dockerfile` , ⚗ 👆 `app` 📁).
* 🏗 👆 FastAPI 🖼:
<div class="termy">
```console
$ docker build -t myimage .
---> 100%
```
</div>
!!! tip
👀 `.` 🔚, ⚫️ 🌓 `./`, ⚫️ 💬 ☁ 📁 ⚙️ 🏗 📦 🖼.
👉 💼, ⚫️ 🎏 ⏮️ 📁 (`.`).
### ▶️ ☁ 📦
* 🏃 📦 ⚓️ 🔛 👆 🖼:
<div class="termy">
```console
$ docker run -d --name mycontainer -p 80:80 myimage
```
</div>
## ✅ ⚫️
👆 🔜 💪 ✅ ⚫️ 👆 ☁ 📦 📛, 🖼: <a href="http://192.168.99.100/items/5?q=somequery" class="external-link" target="_blank">http://192.168.99.100/items/5?q=somequery</a> ⚖️ <a href="http://127.0.0.1/items/5?q=somequery" class="external-link" target="_blank">http://127.0.0.1/items/5?q=somequery</a> (⚖️ 🌓, ⚙️ 👆 ☁ 🦠).
👆 🔜 👀 🕳 💖:
```JSON
{"item_id": 5, "q": "somequery"}
```
## 🎓 🛠️ 🩺
🔜 👆 💪 🚶 <a href="http://192.168.99.100/docs" class="external-link" target="_blank">http://192.168.99.100/docs</a> ⚖️ <a href="http://127.0.0.1/docs" class="external-link" target="_blank">http://127.0.0.1/docs</a> (⚖️ 🌓, ⚙️ 👆 ☁ 🦠).
👆 🔜 👀 🏧 🎓 🛠️ 🧾 (🚚 <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank">🦁 🎚</a>):
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
## 🎛 🛠️ 🩺
&amp; 👆 💪 🚶 <a href="http://192.168.99.100/redoc" class="external-link" target="_blank">http://192.168.99.100/redoc</a> ⚖️ <a href="http://127.0.0.1/redoc" class="external-link" target="_blank">http://127.0.0.1/redoc</a> (⚖️ 🌓, ⚙️ 👆 ☁ 🦠).
👆 🔜 👀 🎛 🏧 🧾 (🚚 <a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank">📄</a>):
![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
## 🏗 ☁ 🖼 ⏮️ 👁-📁 FastAPI
🚥 👆 FastAPI 👁 📁, 🖼, `main.py` 🍵 `./app` 📁, 👆 📁 📊 💪 👀 💖 👉:
```
.
├── Dockerfile
├── main.py
└── requirements.txt
```
⤴️ 👆 🔜 ✔️ 🔀 🔗 ➡ 📁 📁 🔘 `Dockerfile`:
```{ .dockerfile .annotate hl_lines="10 13" }
FROM python:3.9
WORKDIR /code
COPY ./requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# (1)
COPY ./main.py /code/
# (2)
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]
```
1⃣. 📁 `main.py` 📁 `/code` 📁 🔗 (🍵 🙆 `./app` 📁).
2⃣. 🏃 Uvicorn &amp; 💬 ⚫️ 🗄 `app` 🎚 ⚪️➡️ `main` (↩️ 🏭 ⚪️➡️ `app.main`).
⤴️ 🔆 Uvicorn 📋 ⚙️ 🆕 🕹 `main` ↩️ `app.main` 🗄 FastAPI 🎚 `app`.
## 🛠️ 🔧
➡️ 💬 🔄 🔃 🎏 [🛠️ 🔧](./concepts.md){.internal-link target=_blank} ⚖ 📦.
📦 ✴️ 🧰 📉 🛠️ **🏗 &amp; 🛠️** 🈸, ✋️ 👫 🚫 🛠️ 🎯 🎯 🍵 👉 **🛠️ 🔧**, &amp; 📤 📚 💪 🎛.
**👍 📰** 👈 ⏮️ 🔠 🎏 🎛 📤 🌌 📔 🌐 🛠️ 🔧. 👶
➡️ 📄 👉 **🛠️ 🔧** ⚖ 📦:
* 🇺🇸🔍
* 🏃‍♂ 🔛 🕴
* ⏏
* 🧬 (🔢 🛠️ 🏃)
* 💾
* ⏮️ 🔁 ⏭ ▶️
## 🇺🇸🔍
🚥 👥 🎯 🔛 **📦 🖼** FastAPI 🈸 (&amp; ⏪ 🏃‍♂ **📦**), 🇺🇸🔍 🛎 🔜 🍵 **🗜** 1⃣ 🧰.
⚫️ 💪 1⃣ 📦, 🖼 ⏮️ <a href="https://traefik.io/" class="external-link" target="_blank">Traefik</a>, 🚚 **🇺🇸🔍** &amp; **🏧** 🛠️ **📄**.
!!! tip
Traefik ✔️ 🛠️ ⏮️ ☁, Kubernetes, &amp; 🎏, ⚫️ 📶 ⏩ ⚒ 🆙 &amp; 🔗 🇺🇸🔍 👆 📦 ⏮️ ⚫️.
👐, 🇺🇸🔍 💪 🍵 ☁ 🐕‍🦺 1⃣ 👫 🐕‍🦺 (⏪ 🏃 🈸 📦).
## 🏃‍♂ 🔛 🕴 &amp; ⏏
📤 🛎 1⃣ 🧰 🈚 **▶️ &amp; 🏃‍♂** 👆 📦.
⚫️ 💪 **☁** 🔗, **☁ ✍**, **Kubernetes**, **☁ 🐕‍🦺**, ♒️.
🌅 (⚖️ 🌐) 💼, 📤 🙅 🎛 🛠️ 🏃 📦 🔛 🕴 &amp; 🛠️ ⏏ 🔛 ❌. 🖼, ☁, ⚫️ 📋 ⏸ 🎛 `--restart`.
🍵 ⚙️ 📦, ⚒ 🈸 🏃 🔛 🕴 &amp; ⏮️ ⏏ 💪 ⚠ &amp; ⚠. ✋️ 🕐❔ **👷 ⏮️ 📦** 🌅 💼 👈 🛠️ 🔌 🔢. 👶
## 🧬 - 🔢 🛠️
🚥 👆 ✔️ <abbr title="A group of machines that are configured to be connected and work together in some way.">🌑</abbr> 🎰 ⏮️ **☁**, ☁ 🐝 📳, 🖖, ⚖️ 1⃣ 🎏 🏗 ⚙️ 🛠️ 📎 📦 🔛 💗 🎰, ⤴️ 👆 🔜 🎲 💚 **🍵 🧬** **🌑 🎚** ↩️ ⚙️ **🛠️ 👨‍💼** (💖 🐁 ⏮️ 👨‍🏭) 🔠 📦.
1⃣ 📚 📎 📦 🧾 ⚙️ 💖 Kubernetes 🛎 ✔️ 🛠️ 🌌 🚚 **🧬 📦** ⏪ 🔗 **📐 ⚖** 📨 📨. 🌐 **🌑 🎚**.
📚 💼, 👆 🔜 🎲 💚 🏗 **☁ 🖼 ⚪️➡️ 🖌** [🔬 🔛](#dockerfile), ❎ 👆 🔗, &amp; 🏃‍♂ **👁 Uvicorn 🛠️** ↩️ 🏃‍♂ 🕳 💖 🐁 ⏮️ Uvicorn 👨‍🏭.
### 📐 ⚙
🕐❔ ⚙️ 📦, 👆 🔜 🛎 ✔️ 🦲 **👂 🔛 👑 ⛴**. ⚫️ 💪 🎲 1⃣ 📦 👈 **🤝 ❎ 🗳** 🍵 **🇺🇸🔍** ⚖️ 🎏 🧰.
👉 🦲 🔜 ✊ **📐** 📨 &amp; 📎 👈 👪 👨‍🏭 (🤞) **⚖** 🌌, ⚫️ 🛎 🤙 **📐 ⚙**.
!!! tip
🎏 **🤝 ❎ 🗳** 🦲 ⚙️ 🇺🇸🔍 🔜 🎲 **📐 ⚙**.
&amp; 🕐❔ 👷 ⏮️ 📦, 🎏 ⚙️ 👆 ⚙️ ▶️ &amp; 🛠️ 👫 🔜 ⏪ ✔️ 🔗 🧰 📶 **🕸 📻** (✅ 🇺🇸🔍 📨) ⚪️➡️ 👈 **📐 ⚙** (👈 💪 **🤝 ❎ 🗳**) 📦(Ⓜ) ⏮️ 👆 📱.
### 1⃣ 📐 ⚙ - 💗 👨‍🏭 📦
🕐❔ 👷 ⏮️ **Kubernetes** ⚖️ 🎏 📎 📦 🧾 ⚙️, ⚙️ 👫 🔗 🕸 🛠️ 🔜 ✔ 👁 **📐 ⚙** 👈 👂 🔛 👑 **⛴** 📶 📻 (📨) 🎲 **💗 📦** 🏃 👆 📱.
🔠 👫 📦 🏃‍♂ 👆 📱 🔜 🛎 ✔️ **1⃣ 🛠️** (✅ Uvicorn 🛠️ 🏃 👆 FastAPI 🈸). 👫 🔜 🌐 **🌓 📦**, 🏃‍♂ 🎏 👜, ✋️ 🔠 ⏮️ 🚮 👍 🛠️, 💾, ♒️. 👈 🌌 👆 🔜 ✊ 📈 **🛠️** **🎏 🐚** 💽, ⚖️ **🎏 🎰**.
&amp; 📎 📦 ⚙️ ⏮️ **📐 ⚙** 🔜 **📎 📨** 🔠 1⃣ 📦 ⏮️ 👆 📱 **🔄**. , 🔠 📨 💪 🍵 1⃣ 💗 **🔁 📦** 🏃 👆 📱.
&amp; 🛎 👉 **📐 ⚙** 🔜 💪 🍵 📨 👈 🚶 *🎏* 📱 👆 🌑 (✅ 🎏 🆔, ⚖️ 🔽 🎏 📛 ➡ 🔡), &amp; 🔜 📶 👈 📻 ▶️️ 📦 *👈 🎏* 🈸 🏃‍♂ 👆 🌑.
### 1⃣ 🛠️ 📍 📦
👉 🆎 😐, 👆 🎲 🔜 💚 ✔️ **👁 (Uvicorn) 🛠️ 📍 📦**, 👆 🔜 ⏪ 🚚 🧬 🌑 🎚.
, 👉 💼, 👆 **🔜 🚫** 💚 ✔️ 🛠️ 👨‍💼 💖 🐁 ⏮️ Uvicorn 👨‍🏭, ⚖️ Uvicorn ⚙️ 🚮 👍 Uvicorn 👨‍🏭. 👆 🔜 💚 ✔️ **👁 Uvicorn 🛠️** 📍 📦 (✋️ 🎲 💗 📦).
✔️ 1⃣ 🛠️ 👨‍💼 🔘 📦 (🔜 ⏮️ 🐁 ⚖️ Uvicorn 🛠️ Uvicorn 👨‍🏭) 🔜 🕴 🚮 **🙃 🔀** 👈 👆 🌅 🎲 ⏪ ✊ 💅 ⏮️ 👆 🌑 ⚙️.
### 📦 ⏮️ 💗 🛠️ &amp; 🎁 💼
↗️, 📤 **🎁 💼** 🌐❔ 👆 💪 💚 ✔️ **📦** ⏮️ **🐁 🛠️ 👨‍💼** ▶️ 📚 **Uvicorn 👨‍🏭 🛠️** 🔘.
📚 💼, 👆 💪 ⚙️ **🛂 ☁ 🖼** 👈 🔌 **🐁** 🛠️ 👨‍💼 🏃‍♂ 💗 **Uvicorn 👨‍🏭 🛠️**, &amp; 🔢 ⚒ 🔆 🔢 👨‍🏭 ⚓️ 🔛 ⏮️ 💽 🐚 🔁. 👤 🔜 💬 👆 🌅 🔃 ⚫️ 🔛 [🛂 ☁ 🖼 ⏮️ 🐁 - Uvicorn](#official-docker-image-with-gunicorn-uvicorn).
📥 🖼 🕐❔ 👈 💪 ⚒ 🔑:
#### 🙅 📱
👆 💪 💚 🛠️ 👨‍💼 📦 🚥 👆 🈸 **🙅 🥃** 👈 👆 🚫 💪 (🐥 🚫) 👌-🎶 🔢 🛠️ 💁‍♂️ 🌅, &amp; 👆 💪 ⚙️ 🏧 🔢 (⏮️ 🛂 ☁ 🖼), &amp; 👆 🏃‍♂ ⚫️ 🔛 **👁 💽**, 🚫 🌑.
#### ☁ ✍
👆 💪 🛠️ **👁 💽** (🚫 🌑) ⏮️ **☁ ✍**, 👆 🚫🔜 ✔️ ⏩ 🌌 🛠️ 🧬 📦 (⏮️ ☁ ✍) ⏪ 🛡 🔗 🕸 &amp; **📐 ⚖**.
⤴️ 👆 💪 💚 ✔️ **👁 📦** ⏮️ **🛠️ 👨‍💼** ▶️ **📚 👨‍🏭 🛠️** 🔘.
#### 🤴 &amp; 🎏 🤔
👆 💪 ✔️ **🎏 🤔** 👈 🔜 ⚒ ⚫️ ⏩ ✔️ **👁 📦** ⏮️ **💗 🛠️** ↩️ ✔️ **💗 📦** ⏮️ **👁 🛠️** 🔠 👫.
🖼 (🪀 🔛 👆 🖥) 👆 💪 ✔️ 🧰 💖 🤴 🏭 🎏 📦 👈 🔜 ✔️ 🔐 **🔠 📨** 👈 👟.
👉 💼, 🚥 👆 ✔️ **💗 📦**, 🔢, 🕐❔ 🤴 👟 **✍ ⚖**, ⚫️ 🔜 🤚 🕐 **👁 📦 🔠 🕰** (📦 👈 🍵 👈 🎯 📨), ↩️ 🤚 **📈 ⚖** 🌐 🔁 📦.
⤴️, 👈 💼, ⚫️ 💪 🙅 ✔️ **1⃣ 📦** ⏮️ **💗 🛠️**, &amp; 🇧🇿 🧰 (✅ 🤴 🏭) 🔛 🎏 📦 📈 🤴 ⚖ 🌐 🔗 🛠️ &amp; 🎦 👈 ⚖ 🔛 👈 👁 📦.
---
👑 ☝, **👌** 👉 **🚫 ✍ 🗿** 👈 👆 ✔️ 😄 ⏩. 👆 💪 ⚙️ 👫 💭 **🔬 👆 👍 ⚙️ 💼** &amp; 💭 ⚫️❔ 👍 🎯 👆 ⚙️, ✅ 👅 ❔ 🛠️ 🔧:
* 💂‍♂ - 🇺🇸🔍
* 🏃‍♂ 🔛 🕴
* ⏏
* 🧬 (🔢 🛠️ 🏃)
* 💾
* ⏮️ 🔁 ⏭ ▶️
## 💾
🚥 👆 🏃 **👁 🛠️ 📍 📦** 👆 🔜 ✔️ 🌅 ⚖️ 🌘 👍-🔬, ⚖, &amp; 📉 💸 💾 🍴 🔠 👈 📦 (🌅 🌘 1⃣ 🚥 👫 🔁).
&amp; ⤴️ 👆 💪 ⚒ 👈 🎏 💾 📉 &amp; 📄 👆 📳 👆 📦 🧾 ⚙️ (🖼 **Kubernetes**). 👈 🌌 ⚫️ 🔜 💪 **🔁 📦** **💪 🎰** ✊ 🔘 🏧 💸 💾 💪 👫, &amp; 💸 💪 🎰 🌑.
🚥 👆 🈸 **🙅**, 👉 🔜 🎲 **🚫 ⚠**, &amp; 👆 💪 🚫 💪 ✔ 🏋️ 💾 📉. ✋️ 🚥 👆 **⚙️ 📚 💾** (🖼 ⏮️ **🎰 🏫** 🏷), 👆 🔜 ✅ ❔ 🌅 💾 👆 😩 &amp; 🔆 **🔢 📦** 👈 🏃 **🔠 🎰** (&amp; 🎲 🚮 🌖 🎰 👆 🌑).
🚥 👆 🏃 **💗 🛠️ 📍 📦** (🖼 ⏮️ 🛂 ☁ 🖼) 👆 🔜 ✔️ ⚒ 💭 👈 🔢 🛠️ ▶️ 🚫 **🍴 🌖 💾** 🌘 ⚫️❔ 💪.
## ⏮️ 🔁 ⏭ ▶️ &amp; 📦
🚥 👆 ⚙️ 📦 (✅ ☁, Kubernetes), ⤴️ 📤 2⃣ 👑 🎯 👆 💪 ⚙️.
### 💗 📦
🚥 👆 ✔️ **💗 📦**, 🎲 🔠 1⃣ 🏃 **👁 🛠️** (🖼, **Kubernetes** 🌑), ⤴️ 👆 🔜 🎲 💚 ✔️ **🎏 📦** 🔨 👷 **⏮️ 📶** 👁 📦, 🏃 👁 🛠️, **⏭** 🏃 🔁 👨‍🏭 📦.
!!! info
🚥 👆 ⚙️ Kubernetes, 👉 🔜 🎲 <a href="https://kubernetes.io/docs/concepts/workloads/pods/init-containers/" class="external-link" target="_blank">🕑 📦</a>.
🚥 👆 ⚙️ 💼 📤 🙅‍♂ ⚠ 🏃‍♂ 👈 ⏮️ 📶 **💗 🕰 🔗** (🖼 🚥 👆 🚫 🏃 💽 🛠️, ✋️ ✅ 🚥 💽 🔜), ⤴️ 👆 💪 🚮 👫 🔠 📦 ▶️️ ⏭ ▶️ 👑 🛠️.
### 👁 📦
🚥 👆 ✔️ 🙅 🖥, ⏮️ **👁 📦** 👈 ⤴️ ▶️ 💗 **👨‍🏭 🛠️** (⚖️ 1⃣ 🛠️), ⤴️ 👆 💪 🏃 👈 ⏮️ 🔁 🎏 📦, ▶️️ ⏭ ▶️ 🛠️ ⏮️ 📱. 🛂 ☁ 🖼 🐕‍🦺 👉 🔘.
## 🛂 ☁ 🖼 ⏮️ 🐁 - Uvicorn
📤 🛂 ☁ 🖼 👈 🔌 🐁 🏃‍♂ ⏮️ Uvicorn 👨‍🏭, ⏮️ 📃: [💽 👨‍🏭 - 🐁 ⏮️ Uvicorn](./server-workers.md){.internal-link target=_blank}.
👉 🖼 🔜 ⚠ ✴️ ⚠ 🔬 🔛: [📦 ⏮️ 💗 🛠️ &amp; 🎁 💼](#containers-with-multiple-processes-and-special-cases).
* <a href="https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker" class="external-link" target="_blank">tiangolo/uvicorn-🐁-fastapi</a>.
!!! warning
📤 ↕ 🤞 👈 👆 **🚫** 💪 👉 🧢 🖼 ⚖️ 🙆 🎏 🎏 1⃣, &amp; 🔜 👻 📆 🏗 🖼 ⚪️➡️ 🖌 [🔬 🔛: 🏗 ☁ 🖼 FastAPI](#build-a-docker-image-for-fastapi).
👉 🖼 ✔️ **🚘-📳** 🛠️ 🔌 ⚒ **🔢 👨‍🏭 🛠️** ⚓️ 🔛 💽 🐚 💪.
⚫️ ✔️ **🤔 🔢**, ✋️ 👆 💪 🔀 &amp; 🌐 📳 ⏮️ **🌐 🔢** ⚖️ 📳 📁.
⚫️ 🐕‍🦺 🏃 <a href="https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker#pre_start_path" class="external-link" target="_blank">**⏮️ 🔁 ⏭ ▶️**</a> ⏮️ ✍.
!!! tip
👀 🌐 📳 &amp; 🎛, 🚶 ☁ 🖼 📃: <a href="https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker" class="external-link" target="_blank">Tiangolo/uvicorn-🐁-fastapi</a>.
### 🔢 🛠️ 🔛 🛂 ☁ 🖼
**🔢 🛠️** 🔛 👉 🖼 **📊 🔁** ⚪️➡️ 💽 **🐚** 💪.
👉 ⛓ 👈 ⚫️ 🔜 🔄 **🗜** 🌅 **🎭** ⚪️➡️ 💽 💪.
👆 💪 🔆 ⚫️ ⏮️ 📳 ⚙️ **🌐 🔢**, ♒️.
✋️ ⚫️ ⛓ 👈 🔢 🛠️ 🪀 🔛 💽 📦 🏃, **💸 💾 🍴** 🔜 🪀 🔛 👈.
, 🚥 👆 🈸 🍴 📚 💾 (🖼 ⏮️ 🎰 🏫 🏷), &amp; 👆 💽 ✔️ 📚 💽 🐚 **✋️ 🐥 💾**, ⤴️ 👆 📦 💪 🔚 🆙 🔄 ⚙️ 🌅 💾 🌘 ⚫️❔ 💪, &amp; 🤕 🎭 📚 (⚖️ 💥). 👶
### ✍ `Dockerfile`
📥 ❔ 👆 🔜 ✍ `Dockerfile` ⚓️ 🔛 👉 🖼:
```Dockerfile
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
COPY ./app /app
```
### 🦏 🈸
🚥 👆 ⏩ 📄 🔃 🏗 [🦏 🈸 ⏮️ 💗 📁](../tutorial/bigger-applications.md){.internal-link target=_blank}, 👆 `Dockerfile` 💪 ↩️ 👀 💖:
```Dockerfile hl_lines="7"
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
COPY ./requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
COPY ./app /app/app
```
### 🕐❔ ⚙️
👆 🔜 🎲 **🚫** ⚙️ 👉 🛂 🧢 🖼 (⚖️ 🙆 🎏 🎏 1⃣) 🚥 👆 ⚙️ **Kubernetes** (⚖️ 🎏) &amp; 👆 ⏪ ⚒ **🧬** 🌑 🎚, ⏮️ 💗 **📦**. 📚 💼, 👆 👍 📆 **🏗 🖼 ⚪️➡️ 🖌** 🔬 🔛: [🏗 ☁ 🖼 FastAPI](#build-a-docker-image-for-fastapi).
👉 🖼 🔜 ⚠ ✴️ 🎁 💼 🔬 🔛 [📦 ⏮️ 💗 🛠️ &amp; 🎁 💼](#containers-with-multiple-processes-and-special-cases). 🖼, 🚥 👆 🈸 **🙅 🥃** 👈 ⚒ 🔢 🔢 🛠️ ⚓️ 🔛 💽 👷 👍, 👆 🚫 💚 😥 ⏮️ ❎ 🛠️ 🧬 🌑 🎚, &amp; 👆 🚫 🏃 🌅 🌘 1⃣ 📦 ⏮️ 👆 📱. ⚖️ 🚥 👆 🛠️ ⏮️ **☁ ✍**, 🏃 🔛 👁 💽, ♒️.
## 🛠️ 📦 🖼
⏮️ ✔️ 📦 (☁) 🖼 📤 📚 🌌 🛠️ ⚫️.
🖼:
* ⏮️ **☁ ✍** 👁 💽
* ⏮️ **Kubernetes** 🌑
* ⏮️ ☁ 🐝 📳 🌑
* ⏮️ 1⃣ 🧰 💖 🖖
* ⏮️ ☁ 🐕‍🦺 👈 ✊ 👆 📦 🖼 &amp; 🛠️ ⚫️
## ☁ 🖼 ⏮️ 🎶
🚥 👆 ⚙️ <a href="https://python-poetry.org/" class="external-link" target="_blank">🎶</a> 🛠️ 👆 🏗 🔗, 👆 💪 ⚙️ ☁ 👁-▶️ 🏗:
```{ .dockerfile .annotate }
# (1)
FROM python:3.9 as requirements-stage
# (2)
WORKDIR /tmp
# (3)
RUN pip install poetry
# (4)
COPY ./pyproject.toml ./poetry.lock* /tmp/
# (5)
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
# (6)
FROM python:3.9
# (7)
WORKDIR /code
# (8)
COPY --from=requirements-stage /tmp/requirements.txt /code/requirements.txt
# (9)
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# (10)
COPY ./app /code/app
# (11)
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
```
1⃣. 👉 🥇 ▶️, ⚫️ 🌟 `requirements-stage`.
2⃣. ⚒ `/tmp` ⏮️ 👷 📁.
📥 🌐❔ 👥 🔜 🏗 📁 `requirements.txt`
3⃣. ❎ 🎶 👉 ☁ ▶️.
4⃣. 📁 `pyproject.toml` &amp; `poetry.lock` 📁 `/tmp` 📁.
↩️ ⚫️ ⚙️ `./poetry.lock*` (▶️ ⏮️ `*`), ⚫️ 🏆 🚫 💥 🚥 👈 📁 🚫 💪.
5⃣. 🏗 `requirements.txt` 📁.
6⃣. 👉 🏁 ▶️, 🕳 📥 🔜 🛡 🏁 📦 🖼.
7⃣. ⚒ ⏮️ 👷 📁 `/code`.
8⃣. 📁 `requirements.txt` 📁 `/code` 📁.
👉 📁 🕴 🖖 ⏮️ ☁ ▶️, 👈 ⚫️❔ 👥 ⚙️ `--from-requirements-stage` 📁 ⚫️.
9⃣. ❎ 📦 🔗 🏗 `requirements.txt` 📁.
1⃣0⃣. 📁 `app` 📁 `/code` 📁.
1⃣1⃣. 🏃 `uvicorn` 📋, 💬 ⚫️ ⚙️ `app` 🎚 🗄 ⚪️➡️ `app.main`.
!!! tip
🖊 💭 🔢 👀 ⚫️❔ 🔠 ⏸ 🔨.
**☁ ▶️** 🍕 `Dockerfile` 👈 👷 **🍕 📦 🖼** 👈 🕴 ⚙️ 🏗 📁 ⚙️ ⏪.
🥇 ▶️ 🔜 🕴 ⚙️ **❎ 🎶** &amp; **🏗 `requirements.txt`** ⏮️ 👆 🏗 🔗 ⚪️➡️ 🎶 `pyproject.toml` 📁.
👉 `requirements.txt` 📁 🔜 ⚙️ ⏮️ `pip` ⏪ **⏭ ▶️**.
🏁 📦 🖼 **🕴 🏁 ▶️** 🛡. ⏮️ ▶️(Ⓜ) 🔜 ❎.
🕐❔ ⚙️ 🎶, ⚫️ 🔜 ⚒ 🔑 ⚙️ **☁ 👁-▶️ 🏗** ↩️ 👆 🚫 🤙 💪 ✔️ 🎶 &amp; 🚮 🔗 ❎ 🏁 📦 🖼, 👆 **🕴 💪** ✔️ 🏗 `requirements.txt` 📁 ❎ 👆 🏗 🔗.
⤴️ ⏭ (&amp; 🏁) ▶️ 👆 🔜 🏗 🖼 🌅 ⚖️ 🌘 🎏 🌌 🔬 ⏭.
### ⛅ 🤝 ❎ 🗳 - 🎶
🔄, 🚥 👆 🏃‍♂ 👆 📦 ⛅ 🤝 ❎ 🗳 (📐 ⚙) 💖 👌 ⚖️ Traefik, 🚮 🎛 `--proxy-headers` 📋:
```Dockerfile
CMD ["uvicorn", "app.main:app", "--proxy-headers", "--host", "0.0.0.0", "--port", "80"]
```
## 🌃
⚙️ 📦 ⚙️ (✅ ⏮️ **☁** &amp; **Kubernetes**) ⚫️ ▶️️ 📶 🎯 🍵 🌐 **🛠️ 🔧**:
* 🇺🇸🔍
* 🏃‍♂ 🔛 🕴
* ⏏
* 🧬 (🔢 🛠️ 🏃)
* 💾
* ⏮️ 🔁 ⏭ ▶️
🌅 💼, 👆 🎲 🏆 🚫 💚 ⚙️ 🙆 🧢 🖼, &amp; ↩️ **🏗 📦 🖼 ⚪️➡️ 🖌** 1⃣ ⚓️ 🔛 🛂 🐍 ☁ 🖼.
✊ 💅 **✔** 👩‍🌾 `Dockerfile` &amp; **☁ 💾** 👆 💪 **📉 🏗 🕰**, 📉 👆 📈 (&amp; ❎ 😩). 👶
🎯 🎁 💼, 👆 💪 💚 ⚙️ 🛂 ☁ 🖼 FastAPI. 👶

View File

@@ -0,0 +1,190 @@
# 🔃 🇺🇸🔍
⚫️ ⏩ 🤔 👈 🇺🇸🔍 🕳 👈 "🛠️" ⚖️ 🚫.
✋️ ⚫️ 🌌 🌖 🏗 🌘 👈.
!!! tip
🚥 👆 🏃 ⚖️ 🚫 💅, 😣 ⏮️ ⏭ 📄 🔁 🔁 👩‍🌾 ⚒ 🌐 🆙 ⏮️ 🎏 ⚒.
**💡 🔰 🇺🇸🔍**, ⚪️➡️ 🏬 🤔, ✅ <a href="https://howhttps.works/" class="external-link" target="_blank">https://howhttps.works/</a>.
🔜, ⚪️➡️ **👩‍💻 🤔**, 📥 📚 👜 ✔️ 🤯 ⏪ 💭 🔃 🇺🇸🔍:
* 🇺🇸🔍, **💽** 💪 **✔️ "📄"** 🏗 **🥉 🥳**.
* 📚 📄 🤙 **🏆** ⚪️➡️ 🥉 🥳, 🚫 "🏗".
* 📄 ✔️ **1⃣2⃣🗓**.
* 👫 **🕛**.
* &amp; ⤴️ 👫 💪 **♻**, **🏆 🔄** ⚪️➡️ 🥉 🥳.
* 🔐 🔗 🔨 **🕸 🎚**.
* 👈 1⃣ 🧽 **🔛 🇺🇸🔍**.
* , **📄 &amp; 🔐** 🍵 🔨 **⏭ 🇺🇸🔍**.
* **🕸 🚫 💭 🔃 "🆔"**. 🕴 🔃 📢 📢.
* 🔃 **🎯 🆔** 📨 🚶 **🇺🇸🔍 💽**.
* **🇺🇸🔍 📄** "✔" **🎯 🆔**, ✋️ 🛠️ &amp; 🔐 🔨 🕸 🎚, **⏭ 💭** ❔ 🆔 🙅 ⏮️.
* **🔢**, 👈 🔜 ⛓ 👈 👆 💪 🕴 ✔️ **1⃣ 🇺🇸🔍 📄 📍 📢 📢**.
* 🙅‍♂ 🤔 ❔ 🦏 👆 💽 ⚖️ ❔ 🤪 🔠 🈸 👆 ✔️ 🔛 ⚫️ 💪.
* 📤 **⚗** 👉, 👐.
* 📤 **↔** **🤝** 🛠️ (1⃣ 🚚 🔐 🕸 🎚, ⏭ 🇺🇸🔍) 🤙 **<a href="https://en.wikipedia.org/wiki/Server_Name_Indication" class="external-link" target="_blank"><abbr title="Server Name Indication">👲</abbr></a>**.
* 👉 👲 ↔ ✔ 1⃣ 👁 💽 (⏮️ **👁 📢 📢**) ✔️ **📚 🇺🇸🔍 📄** &amp; 🍦 **💗 🇺🇸🔍 🆔/🈸**.
* 👉 👷, **👁** 🦲 (📋) 🏃 🔛 💽, 👂 🔛 **📢 📢 📢**, 🔜 ✔️ **🌐 🇺🇸🔍 📄** 💽.
* **⏮️** 🏆 🔐 🔗, 📻 🛠️ **🇺🇸🔍**.
* 🎚 **🗜**, ✋️ 👫 📨 ⏮️ **🇺🇸🔍 🛠️**.
⚫️ ⚠ 💡 ✔️ **1⃣ 📋/🇺🇸🔍 💽** 🏃 🔛 💽 (🎰, 🦠, ♒️.) &amp; **🛠️ 🌐 🇺🇸🔍 🍕**: 📨 **🗜 🇺🇸🔍 📨**, 📨 **🗜 🇺🇸🔍 📨** ☑ 🇺🇸🔍 🈸 🏃 🎏 💽 ( **FastAPI** 🈸, 👉 💼), ✊ **🇺🇸🔍 📨** ⚪️➡️ 🈸, **🗜 ⚫️** ⚙️ ☑ **🇺🇸🔍 📄** &amp; 📨 ⚫️ 🔙 👩‍💻 ⚙️ **🇺🇸🔍**. 👉 💽 🛎 🤙 **<a href="https://en.wikipedia.org/wiki/TLS_termination_proxy" class="external-link" target="_blank">🤝 ❎ 🗳</a>**.
🎛 👆 💪 ⚙️ 🤝 ❎ 🗳:
* Traefik (👈 💪 🍵 📄 🔕)
* 📥 (👈 💪 🍵 📄 🔕)
* 👌
*
## ➡️ 🗜
⏭ ➡️ 🗜, 👫 **🇺🇸🔍 📄** 💲 💙 🥉 🥳.
🛠️ 📎 1⃣ 👫 📄 ⚙️ ⚠, 🚚 📠 &amp; 📄 😥.
✋️ ⤴️ **<a href="https://letsencrypt.org/" class="external-link" target="_blank">➡️ 🗜</a>** ✍.
⚫️ 🏗 ⚪️➡️ 💾 🏛. ⚫️ 🚚 **🇺🇸🔍 📄 🆓**, 🏧 🌌. 👫 📄 ⚙️ 🌐 🐩 🔐 💂‍♂, &amp; 📏-🖖 (🔃 3⃣ 🗓️), **💂‍♂ 🤙 👍** ↩️ 👫 📉 🔆.
🆔 🔐 ✔ &amp; 📄 🏗 🔁. 👉 ✔ 🏧 🔕 👫 📄.
💭 🏧 🛠️ &amp; 🔕 👫 📄 👈 👆 💪 ✔️ **🔐 🇺🇸🔍, 🆓, ♾**.
## 🇺🇸🔍 👩‍💻
📥 🖼 ❔ 🇺🇸🔍 🛠️ 💪 👀 💖, 🔁 🔁, 💸 🙋 ✴️ 💭 ⚠ 👩‍💻.
### 🆔 📛
⚫️ 🔜 🎲 🌐 ▶️ 👆 **🏗** **🆔 📛**. ⤴️, 👆 🔜 🔗 ⚫️ 🏓 💽 (🎲 👆 🎏 ☁ 🐕‍🦺).
👆 🔜 🎲 🤚 ☁ 💽 (🕹 🎰) ⚖️ 🕳 🎏, &amp; ⚫️ 🔜 ✔️ <abbr title="That doesn't change">🔧</abbr> **📢 📢 📢**.
🏓 💽(Ⓜ) 👆 🔜 🔗 ⏺ ("`A record`") ☝ **👆 🆔** 📢 **📢 📢 👆 💽**.
👆 🔜 🎲 👉 🕐, 🥇 🕰, 🕐❔ ⚒ 🌐 🆙.
!!! tip
👉 🆔 📛 🍕 🌌 ⏭ 🇺🇸🔍, ✋️ 🌐 🪀 🔛 🆔 &amp; 📢 📢, ⚫️ 💸 💬 ⚫️ 📥.
### 🏓
🔜 ➡️ 🎯 🔛 🌐 ☑ 🇺🇸🔍 🍕.
🥇, 🖥 🔜 ✅ ⏮️ **🏓 💽** ⚫️❔ **📢 🆔**, 👉 💼, `someapp.example.com`.
🏓 💽 🔜 💬 🖥 ⚙️ 🎯 **📢 📢**. 👈 🔜 📢 📢 📢 ⚙️ 👆 💽, 👈 👆 🔗 🏓 💽.
<img src="/img/deployment/https/https01.svg">
### 🤝 🤝 ▶️
🖥 🔜 ⤴️ 🔗 ⏮️ 👈 📢 📢 🔛 **⛴ 4⃣4⃣3⃣** (🇺🇸🔍 ⛴).
🥇 🍕 📻 🛠️ 🔗 🖖 👩‍💻 &amp; 💽 &amp; 💭 🔐 🔑 👫 🔜 ⚙️, ♒️.
<img src="/img/deployment/https/https02.svg">
👉 🔗 🖖 👩‍💻 &amp; 💽 🛠️ 🤝 🔗 🤙 **🤝 🤝**.
### 🤝 ⏮️ 👲 ↔
**🕴 1⃣ 🛠️** 💽 💪 👂 🔛 🎯 **⛴** 🎯 **📢 📢**. 📤 💪 🎏 🛠️ 👂 🔛 🎏 ⛴ 🎏 📢 📢, ✋️ 🕴 1⃣ 🔠 🌀 📢 📢 &amp; ⛴.
🤝 (🇺🇸🔍) ⚙️ 🎯 ⛴ `443` 🔢. 👈 ⛴ 👥 🔜 💪.
🕴 1⃣ 🛠️ 💪 👂 🔛 👉 ⛴, 🛠️ 👈 🔜 ⚫️ 🔜 **🤝 ❎ 🗳**.
🤝 ❎ 🗳 🔜 ✔️ 🔐 1⃣ ⚖️ 🌅 **🤝 📄** (🇺🇸🔍 📄).
⚙️ **👲 ↔** 🔬 🔛, 🤝 ❎ 🗳 🔜 ✅ ❔ 🤝 (🇺🇸🔍) 📄 💪 ⚫️ 🔜 ⚙️ 👉 🔗, ⚙️ 1⃣ 👈 🏏 🆔 📈 👩‍💻.
👉 💼, ⚫️ 🔜 ⚙️ 📄 `someapp.example.com`.
<img src="/img/deployment/https/https03.svg">
👩‍💻 ⏪ **💙** 👨‍💼 👈 🏗 👈 🤝 📄 (👉 💼 ➡️ 🗜, ✋️ 👥 🔜 👀 🔃 👈 ⏪), ⚫️ 💪 **✔** 👈 📄 ☑.
⤴️, ⚙️ 📄, 👩‍💻 &amp; 🤝 ❎ 🗳 **💭 ❔ 🗜** 🎂 **🕸 📻**. 👉 🏁 **🤝 🤝** 🍕.
⏮️ 👉, 👩‍💻 &amp; 💽 ✔️ **🗜 🕸 🔗**, 👉 ⚫️❔ 🤝 🚚. &amp; ⤴️ 👫 💪 ⚙️ 👈 🔗 ▶️ ☑ **🇺🇸🔍 📻**.
&amp; 👈 ⚫️❔ **🇺🇸🔍** , ⚫️ ✅ **🇺🇸🔍** 🔘 **🔐 🤝 🔗** ↩️ 😁 (💽) 🕸 🔗.
!!! tip
👀 👈 🔐 📻 🔨 **🕸 🎚**, 🚫 🇺🇸🔍 🎚.
### 🇺🇸🔍 📨
🔜 👈 👩‍💻 &amp; 💽 (🎯 🖥 &amp; 🤝 ❎ 🗳) ✔️ **🗜 🕸 🔗**, 👫 💪 ▶️ **🇺🇸🔍 📻**.
, 👩‍💻 📨 **🇺🇸🔍 📨**. 👉 🇺🇸🔍 📨 🔘 🗜 🤝 🔗.
<img src="/img/deployment/https/https04.svg">
### 🗜 📨
🤝 ❎ 🗳 🔜 ⚙️ 🔐 ✔ **🗜 📨**, &amp; 🔜 📶 **✅ (🗜) 🇺🇸🔍 📨** 🛠️ 🏃 🈸 (🖼 🛠️ ⏮️ Uvicorn 🏃‍♂ FastAPI 🈸).
<img src="/img/deployment/https/https05.svg">
### 🇺🇸🔍 📨
🈸 🔜 🛠️ 📨 &amp; 📨 **✅ (💽) 🇺🇸🔍 📨** 🤝 ❎ 🗳.
<img src="/img/deployment/https/https06.svg">
### 🇺🇸🔍 📨
🤝 ❎ 🗳 🔜 ⤴️ **🗜 📨** ⚙️ ⚛ ✔ ⏭ (👈 ▶️ ⏮️ 📄 `someapp.example.com`), &amp; 📨 ⚫️ 🔙 🖥.
⏭, 🖥 🔜 ✔ 👈 📨 ☑ &amp; 🗜 ⏮️ ▶️️ 🔐 🔑, ♒️. ⚫️ 🔜 ⤴️ **🗜 📨** &amp; 🛠️ ⚫️.
<img src="/img/deployment/https/https07.svg">
👩‍💻 (🖥) 🔜 💭 👈 📨 👟 ⚪️➡️ ☑ 💽 ↩️ ⚫️ ⚙️ ⚛ 👫 ✔ ⚙️ **🇺🇸🔍 📄** ⏭.
### 💗 🈸
🎏 💽 (⚖️ 💽), 📤 💪 **💗 🈸**, 🖼, 🎏 🛠️ 📋 ⚖️ 💽.
🕴 1⃣ 🛠️ 💪 🚚 🎯 📢 &amp; ⛴ (🤝 ❎ 🗳 👆 🖼) ✋️ 🎏 🈸/🛠️ 💪 🏃 🔛 💽(Ⓜ) 💁‍♂️, 📏 👫 🚫 🔄 ⚙️ 🎏 **🌀 📢 📢 &amp; ⛴**.
<img src="/img/deployment/https/https08.svg">
👈 🌌, 🤝 ❎ 🗳 💪 🍵 🇺🇸🔍 &amp; 📄 **💗 🆔**, 💗 🈸, &amp; ⤴️ 📶 📨 ▶️️ 🈸 🔠 💼.
### 📄 🔕
☝ 🔮, 🔠 📄 🔜 **🕛** (🔃 3⃣ 🗓️ ⏮️ 🏗 ⚫️).
&amp; ⤴️, 📤 🔜 1⃣ 📋 (💼 ⚫️ 1⃣ 📋, 💼 ⚫️ 💪 🎏 🤝 ❎ 🗳) 👈 🔜 💬 ➡️ 🗜, &amp; ♻ 📄(Ⓜ).
<img src="/img/deployment/https/https.svg">
**🤝 📄** **🔗 ⏮️ 🆔 📛**, 🚫 ⏮️ 📢 📢.
, ♻ 📄, 🔕 📋 💪 **🎦** 🛃 (➡️ 🗜) 👈 ⚫️ 👐 **"👍" &amp; 🎛 👈 🆔**.
👈, &amp; 🏗 🎏 🈸 💪, 📤 📚 🌌 ⚫️ 💪 ⚫️. 🌟 🌌:
* **🔀 🏓 ⏺**.
* 👉, 🔕 📋 💪 🐕‍🦺 🔗 🏓 🐕‍🦺,, ⚓️ 🔛 🏓 🐕‍🦺 👆 ⚙️, 👉 5⃣📆 ⚖️ 💪 🚫 🎛.
* **🏃 💽** (🌘 ⏮️ 📄 🛠️ 🛠️) 🔛 📢 📢 📢 🔗 ⏮️ 🆔.
* 👥 💬 🔛, 🕴 1⃣ 🛠️ 💪 👂 🔛 🎯 📢 &amp; ⛴.
* 👉 1⃣ 🤔 ⚫️❔ ⚫️ 📶 ⚠ 🕐❔ 🎏 🤝 ❎ 🗳 ✊ 💅 📄 🔕 🛠️.
* ⏪, 👆 💪 ✔️ ⛔️ 🤝 ❎ 🗳 😖, ▶️ 🔕 📋 📎 📄, ⤴️ 🔗 👫 ⏮️ 🤝 ❎ 🗳, &amp; ⤴️ ⏏ 🤝 ❎ 🗳. 👉 🚫 💯, 👆 📱(Ⓜ) 🔜 🚫 💪 ⏮️ 🕰 👈 🤝 ❎ 🗳 📆.
🌐 👉 🔕 🛠️, ⏪ 🍦 📱, 1⃣ 👑 🤔 ⚫️❔ 👆 🔜 💚 ✔️ **🎏 ⚙️ 🍵 🇺🇸🔍** ⏮️ 🤝 ❎ 🗳 ↩️ ⚙️ 🤝 📄 ⏮️ 🈸 💽 🔗 (✅ Uvicorn).
## 🌃
✔️ **🇺🇸🔍** 📶 ⚠, &amp; **🎯** 🏆 💼. 🌅 🎯 👆 👩‍💻 ✔️ 🚮 🤭 🇺🇸🔍 🔃 **🤔 👉 🔧** &amp; ❔ 👫 👷.
✋️ 🕐 👆 💭 🔰 **🇺🇸🔍 👩‍💻** 👆 💪 💪 🌀 &amp; 🔗 🎏 🧰 👆 🛠️ 🌐 🙅 🌌.
⏭ 📃, 👤 🔜 🎦 👆 📚 🧱 🖼 ❔ ⚒ 🆙 **🇺🇸🔍** **FastAPI** 🈸. 👶

View File

@@ -0,0 +1,21 @@
# 🛠️
🛠️ **FastAPI** 🈸 📶 ⏩.
## ⚫️❔ 🔨 🛠️ ⛓
**🛠️** 🈸 ⛓ 🎭 💪 📶 ⚒ ⚫️ **💪 👩‍💻**.
**🕸 🛠️**, ⚫️ 🛎 🔌 🚮 ⚫️ **🛰 🎰**, ⏮️ **💽 📋** 👈 🚚 👍 🎭, ⚖, ♒️, 👈 👆 **👩‍💻** 💪 **🔐** 🈸 ♻ &amp; 🍵 🔁 ⚖️ ⚠.
👉 🔅 **🛠️** ▶️, 🌐❔ 👆 🕧 🔀 📟, 💔 ⚫️ &amp; ♻ ⚫️, ⛔️ &amp; 🔁 🛠️ 💽, ♒️.
## 🛠️ 🎛
📤 📚 🌌 ⚫️ ⚓️ 🔛 👆 🎯 ⚙️ 💼 &amp; 🧰 👈 👆 ⚙️.
👆 💪 **🛠️ 💽** 👆 ⚙️ 🌀 🧰, 👆 💪 ⚙️ **☁ 🐕‍🦺** 👈 🔨 🍕 👷 👆, ⚖️ 🎏 💪 🎛.
👤 🔜 🎦 👆 👑 🔧 👆 🔜 🎲 ✔️ 🤯 🕐❔ 🛠️ **FastAPI** 🈸 (👐 🌅 ⚫️ ✔ 🙆 🎏 🆎 🕸 🈸).
👆 🔜 👀 🌖 ✔️ 🤯 &amp; ⚒ ⚫️ ⏭ 📄. 👶

View File

@@ -0,0 +1,145 @@
# 🏃 💽 ❎ - Uvicorn
👑 👜 👆 💪 🏃 **FastAPI** 🈸 🛰 💽 🎰 🔫 💽 📋 💖 **Uvicorn**.
📤 3⃣ 👑 🎛:
* <a href="https://www.uvicorn.org/" class="external-link" target="_blank">Uvicorn</a>: ↕ 🎭 🔫 💽.
* <a href="https://pgjones.gitlab.io/hypercorn/" class="external-link" target="_blank">Hypercorn</a>: 🔫 💽 🔗 ⏮️ 🇺🇸🔍/2⃣ &amp; 🎻 👪 🎏 ⚒.
* <a href="https://github.com/django/daphne" class="external-link" target="_blank">👸</a>: 🔫 💽 🏗 ✳ 📻.
## 💽 🎰 &amp; 💽 📋
📤 🤪 🔃 📛 ✔️ 🤯. 👶
🔤 "**💽**" 🛎 ⚙️ 🔗 👯‍♂️ 🛰/☁ 💻 (⚛ ⚖️ 🕹 🎰) &amp; 📋 👈 🏃‍♂ 🔛 👈 🎰 (✅ Uvicorn).
✔️ 👈 🤯 🕐❔ 👆 ✍ "💽" 🏢, ⚫️ 💪 🔗 1⃣ 📚 2⃣ 👜.
🕐❔ 🔗 🛰 🎰, ⚫️ ⚠ 🤙 ⚫️ **💽**, ✋️ **🎰**, **💾** (🕹 🎰), **🕸**. 👈 🌐 🔗 🆎 🛰 🎰, 🛎 🏃‍♂ 💾, 🌐❔ 👆 🏃 📋.
## ❎ 💽 📋
👆 💪 ❎ 🔫 🔗 💽 ⏮️:
=== "Uvicorn"
* <a href="https://www.uvicorn.org/" class="external-link" target="_blank">Uvicorn</a>, 🌩-⏩ 🔫 💽, 🏗 🔛 uvloop &amp; httptool.
<div class="termy">
```console
$ pip install "uvicorn[standard]"
---> 100%
```
</div>
!!! tip
❎ `standard`, Uvicorn 🔜 ❎ &amp; ⚙️ 👍 🔗.
👈 ✅ `uvloop`, ↕-🎭 💧-♻ `asyncio`, 👈 🚚 🦏 🛠️ 🎭 📈.
=== "Hypercorn"
* <a href="https://gitlab.com/pgjones/hypercorn" class="external-link" target="_blank">Hypercorn</a>, 🔫 💽 🔗 ⏮️ 🇺🇸🔍/2⃣.
<div class="termy">
```console
$ pip install hypercorn
---> 100%
```
</div>
...⚖️ 🙆 🎏 🔫 💽.
## 🏃 💽 📋
👆 💪 ⤴️ 🏃 👆 🈸 🎏 🌌 👆 ✔️ ⌛ 🔰, ✋️ 🍵 `--reload` 🎛, ✅:
=== "Uvicorn"
<div class="termy">
```console
$ uvicorn main:app --host 0.0.0.0 --port 80
<span style="color: green;">INFO</span>: Uvicorn running on http://0.0.0.0:80 (Press CTRL+C to quit)
```
</div>
=== "Hypercorn"
<div class="termy">
```console
$ hypercorn main:app --bind 0.0.0.0:80
Running on 0.0.0.0:8080 over http (CTRL + C to quit)
```
</div>
!!! warning
💭 ❎ `--reload` 🎛 🚥 👆 ⚙️ ⚫️.
`--reload` 🎛 🍴 🌅 🌅 , 🌅 ⚠, ♒️.
⚫️ 📚 ⏮️ **🛠️**, ✋️ 👆 **🚫🔜 🚫** ⚙️ ⚫️ **🏭**.
## Hypercorn ⏮️ 🎻
💃 &amp; **FastAPI** ⚓️ 🔛 <a href="https://anyio.readthedocs.io/en/stable/" class="external-link" target="_blank">AnyIO</a>, ❔ ⚒ 👫 🔗 ⏮️ 👯‍♂️ 🐍 🐩 🗃 <a href="https://docs.python.org/3/library/asyncio-task.html" class="external-link" target="_blank">✳</a> &amp; <a href="https://trio.readthedocs.io/en/stable/" class="external-link" target="_blank">🎻</a>.
👐, Uvicorn ⏳ 🕴 🔗 ⏮️ ✳, &amp; ⚫️ 🛎 ⚙️ <a href="https://github.com/MagicStack/uvloop" class="external-link" target="_blank">`uvloop`</a>, ↕-🎭 💧-♻ `asyncio`.
✋️ 🚥 👆 💚 🔗 ⚙️ **🎻**, ⤴️ 👆 💪 ⚙️ **Hypercorn** ⚫️ 🐕‍🦺 ⚫️. 👶
### ❎ Hypercorn ⏮️ 🎻
🥇 👆 💪 ❎ Hypercorn ⏮️ 🎻 🐕‍🦺:
<div class="termy">
```console
$ pip install "hypercorn[trio]"
---> 100%
```
</div>
### 🏃 ⏮️ 🎻
⤴️ 👆 💪 🚶‍♀️ 📋 ⏸ 🎛 `--worker-class` ⏮️ 💲 `trio`:
<div class="termy">
```console
$ hypercorn main:app --worker-class trio
```
</div>
&amp; 👈 🔜 ▶️ Hypercorn ⏮️ 👆 📱 ⚙️ 🎻 👩‍💻.
🔜 👆 💪 ⚙️ 🎻 🔘 👆 📱. ⚖️ 👍, 👆 💪 ⚙️ AnyIO, 🚧 👆 📟 🔗 ⏮️ 👯‍♂️ 🎻 &amp; ✳. 👶
## 🛠️ 🔧
👫 🖼 🏃 💽 📋 (📧.Ⓜ Uvicorn), ▶️ **👁 🛠️**, 👂 🔛 🌐 📢 (`0.0.0.0`) 🔛 🔁 ⛴ (✅ `80`).
👉 🔰 💭. ✋️ 👆 🔜 🎲 💚 ✊ 💅 🌖 👜, 💖:
* 💂‍♂ - 🇺🇸🔍
* 🏃‍♂ 🔛 🕴
*
* 🧬 (🔢 🛠️ 🏃)
* 💾
* ⏮️ 🔁 ⏭ ▶️
👤 🔜 💬 👆 🌅 🔃 🔠 👫 🔧, ❔ 💭 🔃 👫, &amp; 🧱 🖼 ⏮️ 🎛 🍵 👫 ⏭ 📃. 👶

View File

@@ -0,0 +1,178 @@
# 💽 👨‍🏭 - 🐁 ⏮️ Uvicorn
➡️ ✅ 🔙 👈 🛠️ 🔧 ⚪️➡️ ⏭:
* 💂‍♂ - 🇺🇸🔍
* 🏃‍♂ 🔛 🕴
*
* **🧬 (🔢 🛠️ 🏃)**
* 💾
* ⏮️ 🔁 ⏭ ▶️
🆙 👉 ☝, ⏮️ 🌐 🔰 🩺, 👆 ✔️ 🎲 🏃‍♂ **💽 📋** 💖 Uvicorn, 🏃‍♂ **👁 🛠️**.
🕐❔ 🛠️ 🈸 👆 🔜 🎲 💚 ✔️ **🧬 🛠️** ✊ 📈 **💗 🐚** &amp; 💪 🍵 🌅 📨.
👆 👀 ⏮️ 📃 🔃 [🛠️ 🔧](./concepts.md){.internal-link target=_blank}, 📤 💗 🎛 👆 💪 ⚙️.
📥 👤 🔜 🎦 👆 ❔ ⚙️ <a href="https://gunicorn.org/" class="external-link" target="_blank">**🐁**</a> ⏮️ **Uvicorn 👨‍🏭 🛠️**.
!!! info
🚥 👆 ⚙️ 📦, 🖼 ⏮️ ☁ ⚖️ Kubernetes, 👤 🔜 💬 👆 🌅 🔃 👈 ⏭ 📃: [FastAPI 📦 - ☁](./docker.md){.internal-link target=_blank}.
🎯, 🕐❔ 🏃 🔛 **Kubernetes** 👆 🔜 🎲 **🚫** 💚 ⚙️ 🐁 &amp; ↩️ 🏃 **👁 Uvicorn 🛠️ 📍 📦**, ✋️ 👤 🔜 💬 👆 🔃 ⚫️ ⏪ 👈 📃.
## 🐁 ⏮️ Uvicorn 👨‍🏭
**🐁** ✴️ 🈸 💽 ⚙️ **🇨🇻 🐩**. 👈 ⛓ 👈 🐁 💪 🍦 🈸 💖 🏺 &amp; ✳. 🐁 ⚫️ 🚫 🔗 ⏮️ **FastAPI**, FastAPI ⚙️ 🆕 **<a href="https://asgi.readthedocs.io/en/latest/" class="external-link" target="_blank">🔫 🐩</a>**.
✋️ 🐁 🐕‍🦺 👷 **🛠️ 👨‍💼** &amp; 🤝 👩‍💻 💬 ⚫️ ❔ 🎯 **👨‍🏭 🛠️ 🎓** ⚙️. ⤴️ 🐁 🔜 ▶️ 1⃣ ⚖️ 🌖 **👨‍🏭 🛠️** ⚙️ 👈 🎓.
&amp; **Uvicorn** ✔️ **🐁-🔗 👨‍🏭 🎓**.
⚙️ 👈 🌀, 🐁 🔜 🚫 **🛠️ 👨‍💼**, 👂 🔛 **⛴** &amp; **📢**. &amp; ⚫️ 🔜 **📶** 📻 👨‍🏭 🛠️ 🏃 **Uvicorn 🎓**.
&amp; ⤴️ 🐁-🔗 **Uvicorn 👨‍🏭** 🎓 🔜 🈚 🏭 📊 📨 🐁 🔫 🐩 FastAPI ⚙️ ⚫️.
## ❎ 🐁 &amp; Uvicorn
<div class="termy">
```console
$ pip install "uvicorn[standard]" gunicorn
---> 100%
```
</div>
👈 🔜 ❎ 👯‍♂️ Uvicorn ⏮️ `standard` 📦 (🤚 ↕ 🎭) &amp; 🐁.
## 🏃 🐁 ⏮️ Uvicorn 👨‍🏭
⤴️ 👆 💪 🏃 🐁 ⏮️:
<div class="termy">
```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.
```
</div>
➡️ 👀 ⚫️❔ 🔠 👈 🎛 ⛓:
* `main:app`: 👉 🎏 ❕ ⚙️ Uvicorn, `main` ⛓ 🐍 🕹 📛 "`main`",, 📁 `main.py`. &amp; `app` 📛 🔢 👈 **FastAPI** 🈸.
* 👆 💪 🌈 👈 `main:app` 🌓 🐍 `import` 📄 💖:
```Python
from main import app
```
* , ❤ `main:app` 🔜 🌓 🐍 `import` 🍕 `from main import app`.
* `--workers`: 🔢 👨‍🏭 🛠️ ⚙️, 🔠 🔜 🏃 Uvicorn 👨‍🏭, 👉 💼, 4⃣ 👨‍🏭.
* `--worker-class`: 🐁-🔗 👨‍🏭 🎓 ⚙️ 👨‍🏭 🛠️.
* 📥 👥 🚶‍♀️ 🎓 👈 🐁 💪 🗄 &amp; ⚙️ ⏮️:
```Python
import uvicorn.workers.UvicornWorker
```
* `--bind`: 👉 💬 🐁 📢 &amp; ⛴ 👂, ⚙️ ❤ (`:`) 🎏 📢 &amp; ⛴.
* 🚥 👆 🏃‍♂ Uvicorn 🔗, ↩️ `--bind 0.0.0.0:80` (🐁 🎛) 👆 🔜 ⚙️ `--host 0.0.0.0` &amp; `--port 80`.
🔢, 👆 💪 👀 👈 ⚫️ 🎦 **🕹** (🛠️ 🆔) 🔠 🛠️ (⚫️ 🔢).
👆 💪 👀 👈:
* 🐁 **🛠️ 👨‍💼** ▶️ ⏮️ 🕹 `19499` (👆 💼 ⚫️ 🔜 🎏 🔢).
* ⤴️ ⚫️ ▶️ `Listening at: http://0.0.0.0:80`.
* ⤴️ ⚫️ 🔍 👈 ⚫️ ✔️ ⚙️ 👨‍🏭 🎓 `uvicorn.workers.UvicornWorker`.
* &amp; ⤴️ ⚫️ ▶️ **4⃣ 👨‍🏭**, 🔠 ⏮️ 🚮 👍 🕹: `19511`, `19513`, `19514`, &amp; `19515`.
🐁 🔜 ✊ 💅 🛠️ **☠️ 🛠️** &amp; **🔁** 🆕 🕐 🚥 💚 🚧 🔢 👨‍🏭. 👈 🍕 ⏮️ **⏏** 🔧 ⚪️➡️ 📇 🔛.
👐, 👆 🔜 🎲 💚 ✔️ 🕳 🏞 ⚒ 💭 **⏏ 🐁** 🚥 💪, &amp; **🏃 ⚫️ 🔛 🕴**, ♒️.
## Uvicorn ⏮️ 👨‍🏭
Uvicorn ✔️ 🎛 ▶️ &amp; 🏃 📚 **👨‍🏭 🛠️**.
👐, 🔜, Uvicorn 🛠️ 🚚 👨‍🏭 🛠️ 🌅 📉 🌘 🐁. , 🚥 👆 💚 ✔️ 🛠️ 👨‍💼 👉 🎚 (🐍 🎚), ⤴️ ⚫️ 💪 👍 🔄 ⏮️ 🐁 🛠️ 👨‍💼.
🙆 💼, 👆 🔜 🏃 ⚫️ 💖 👉:
<div class="termy">
```console
$ uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
<font color="#A6E22E">INFO</font>: Uvicorn running on <b>http://0.0.0.0:8080</b> (Press CTRL+C to quit)
<font color="#A6E22E">INFO</font>: Started parent process [<font color="#A1EFE4"><b>27365</b></font>]
<font color="#A6E22E">INFO</font>: Started server process [<font color="#A1EFE4">27368</font>]
<font color="#A6E22E">INFO</font>: Waiting for application startup.
<font color="#A6E22E">INFO</font>: Application startup complete.
<font color="#A6E22E">INFO</font>: Started server process [<font color="#A1EFE4">27369</font>]
<font color="#A6E22E">INFO</font>: Waiting for application startup.
<font color="#A6E22E">INFO</font>: Application startup complete.
<font color="#A6E22E">INFO</font>: Started server process [<font color="#A1EFE4">27370</font>]
<font color="#A6E22E">INFO</font>: Waiting for application startup.
<font color="#A6E22E">INFO</font>: Application startup complete.
<font color="#A6E22E">INFO</font>: Started server process [<font color="#A1EFE4">27367</font>]
<font color="#A6E22E">INFO</font>: Waiting for application startup.
<font color="#A6E22E">INFO</font>: Application startup complete.
```
</div>
🕴 🆕 🎛 📥 `--workers` 💬 Uvicorn ▶️ 4⃣ 👨‍🏭 🛠️.
👆 💪 👀 👈 ⚫️ 🎦 **🕹** 🔠 🛠️, `27365` 👪 🛠️ (👉 **🛠️ 👨‍💼**) &amp; 1⃣ 🔠 👨‍🏭 🛠️: `27368`, `27369`, `27370`, &amp; `27367`.
## 🛠️ 🔧
📥 👆 👀 ❔ ⚙️ **🐁** (⚖️ Uvicorn) 🛠️ **Uvicorn 👨‍🏭 🛠️** **🔁** 🛠️ 🈸, ✊ 📈 **💗 🐚** 💽, &amp; 💪 🍦 **🌅 📨**.
⚪️➡️ 📇 🛠️ 🔧 ⚪️➡️ 🔛, ⚙️ 👨‍🏭 🔜 ✴️ ⏮️ **🧬** 🍕, &amp; 🐥 🍖 ⏮️ **⏏**, ✋️ 👆 💪 ✊ 💅 🎏:
* **💂‍♂ - 🇺🇸🔍**
* **🏃‍♂ 🔛 🕴**
* ***⏏***
* 🧬 (🔢 🛠️ 🏃)
* **💾**
* **⏮️ 🔁 ⏭ ▶️**
## 📦 &amp; ☁
⏭ 📃 🔃 [FastAPI 📦 - ☁](./docker.md){.internal-link target=_blank} 👤 🔜 💬 🎛 👆 💪 ⚙️ 🍵 🎏 **🛠️ 🔧**.
👤 🔜 🎦 👆 **🛂 ☁ 🖼** 👈 🔌 **🐁 ⏮️ Uvicorn 👨‍🏭** &amp; 🔢 📳 👈 💪 ⚠ 🙅 💼.
📤 👤 🔜 🎦 👆 ❔ **🏗 👆 👍 🖼 ⚪️➡️ 🖌** 🏃 👁 Uvicorn 🛠️ (🍵 🐁). ⚫️ 🙅 🛠️ &amp; 🎲 ⚫️❔ 👆 🔜 💚 🕐❔ ⚙️ 📎 📦 🧾 ⚙️ 💖 **Kubernetes**.
## 🌃
👆 💪 ⚙️ **🐁** (⚖️ Uvicorn) 🛠️ 👨‍💼 ⏮️ Uvicorn 👨‍🏭 ✊ 📈 **👁-🐚 💽**, 🏃 **💗 🛠️ 🔗**.
👆 💪 ⚙️ 👉 🧰 &amp; 💭 🚥 👆 ⚒ 🆙 **👆 👍 🛠️ ⚙️** ⏪ ✊ 💅 🎏 🛠️ 🔧 👆.
✅ 👅 ⏭ 📃 💡 🔃 **FastAPI** ⏮️ 📦 (✅ ☁ &amp; Kubernetes). 👆 🔜 👀 👈 👈 🧰 ✔️ 🙅 🌌 ❎ 🎏 **🛠️ 🔧** 👍. 👶

View File

@@ -0,0 +1,87 @@
# 🔃 FastAPI ⏬
**FastAPI** ⚙️ 🏭 📚 🈸 &amp; ⚙️. &amp; 💯 💰 🚧 1⃣0⃣0⃣ 💯. ✋️ 🚮 🛠️ 🚚 🔜.
🆕 ⚒ 🚮 🛎, 🐛 🔧 🛎, &amp; 📟 🔁 📉.
👈 ⚫️❔ ⏮️ ⏬ `0.x.x`, 👉 🎨 👈 🔠 ⏬ 💪 ⚠ ✔️ 💔 🔀. 👉 ⏩ <a href="https://semver.org/" class="external-link" target="_blank">⚛ 🛠️</a> 🏛.
👆 💪 ✍ 🏭 🈸 ⏮️ **FastAPI** ▶️️ 🔜 (&amp; 👆 ✔️ 🎲 🔨 ⚫️ 🕰), 👆 ✔️ ⚒ 💭 👈 👆 ⚙️ ⏬ 👈 👷 ☑ ⏮️ 🎂 👆 📟.
## 📌 👆 `fastapi` ⏬
🥇 👜 👆 🔜 "📌" ⏬ **FastAPI** 👆 ⚙️ 🎯 📰 ⏬ 👈 👆 💭 👷 ☑ 👆 🈸.
🖼, ➡️ 💬 👆 ⚙️ ⏬ `0.45.0` 👆 📱.
🚥 👆 ⚙️ `requirements.txt` 📁 👆 💪 ✔ ⏬ ⏮️:
```txt
fastapi==0.45.0
```
👈 🔜 ⛓ 👈 👆 🔜 ⚙️ ⚫️❔ ⏬ `0.45.0`.
⚖️ 👆 💪 📌 ⚫️ ⏮️:
```txt
fastapi>=0.45.0,<0.46.0
```
👈 🔜 ⛓ 👈 👆 🔜 ⚙️ ⏬ `0.45.0` ⚖️ 🔛, ✋️ 🌘 🌘 `0.46.0`, 🖼, ⏬ `0.45.2` 🔜 🚫.
🚥 👆 ⚙️ 🙆 🎏 🧰 🛠️ 👆 👷‍♂, 💖 🎶, Pipenv, ⚖️ 🎏, 👫 🌐 ✔️ 🌌 👈 👆 💪 ⚙️ 🔬 🎯 ⏬ 👆 📦.
## 💪 ⏬
👆 💪 👀 💪 ⏬ (✅ ✅ ⚫️❔ ⏮️ 📰) [🚀 🗒](../release-notes.md){.internal-link target=_blank}.
## 🔃 ⏬
📄 ⚛ 🛠️ 🏛, 🙆 ⏬ 🔛 `1.0.0` 💪 ⚠ 🚮 💔 🔀.
FastAPI ⏩ 🏛 👈 🙆 "🐛" ⏬ 🔀 🐛 🔧 &amp; 🚫-💔 🔀.
!!! tip
"🐛" 🏁 🔢, 🖼, `0.2.3`, 🐛 ⏬ `3`.
, 👆 🔜 💪 📌 ⏬ 💖:
```txt
fastapi>=0.45.0,<0.46.0
```
💔 🔀 &amp; 🆕 ⚒ 🚮 "🇺🇲" ⏬.
!!! tip
"🇺🇲" 🔢 🖕, 🖼, `0.2.3`, 🇺🇲 ⏬ `2`.
## ♻ FastAPI ⏬
👆 🔜 🚮 💯 👆 📱.
⏮️ **FastAPI** ⚫️ 📶 ⏩ (👏 💃), ✅ 🩺: [🔬](../tutorial/testing.md){.internal-link target=_blank}
⏮️ 👆 ✔️ 💯, ⤴️ 👆 💪 ♻ **FastAPI** ⏬ 🌖 ⏮️ 1⃣, &amp; ⚒ 💭 👈 🌐 👆 📟 👷 ☑ 🏃 👆 💯.
🚥 🌐 👷, ⚖️ ⏮️ 👆 ⚒ 💪 🔀, &amp; 🌐 👆 💯 🚶‍♀️, ⤴️ 👆 💪 📌 👆 `fastapi` 👈 🆕 ⏮️ ⏬.
## 🔃 💃
👆 🚫🔜 🚫 📌 ⏬ `starlette`.
🎏 ⏬ **FastAPI** 🔜 ⚙️ 🎯 🆕 ⏬ 💃.
, 👆 💪 ➡️ **FastAPI** ⚙️ ☑ 💃 ⏬.
## 🔃 Pydantic
Pydantic 🔌 💯 **FastAPI** ⏮️ 🚮 👍 💯, 🆕 ⏬ Pydantic (🔛 `1.0.0`) 🕧 🔗 ⏮️ FastAPI.
👆 💪 📌 Pydantic 🙆 ⏬ 🔛 `1.0.0` 👈 👷 👆 &amp; 🔛 `2.0.0`.
🖼:
```txt
pydantic>=1.2.0,<2.0.0
```

View File

@@ -0,0 +1,35 @@
# 🔢 🔗 &amp; 📄
**FastAPI** ✔️ 👑 👪 🕧 💗.
📤 📚 🏤, 📄, 🧰, &amp; 🏗, 🔗 **FastAPI**.
📥 ❌ 📇 👫.
!!! tip
🚥 👆 ✔️ 📄, 🏗, 🧰, ⚖️ 🕳 🔗 **FastAPI** 👈 🚫 📇 📥, ✍ <a href="https://github.com/tiangolo/fastapi/edit/master/docs/en/data/external_links.yml" class="external-link" target="_blank">🚲 📨 ❎ ⚫️</a>.
## 📄
{% 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 %}
* <a href="{{ item.link }}" class="external-link" target="_blank">{{ item.title }}</a> by <a href="{{ item.author_link }}" class="external-link" target="_blank">{{ item.author }}</a>.
{% endfor %}
{% endfor %}
{% endfor %}
## 🏗
⏪ 📂 🏗 ⏮️ ❔ `fastapi`:
<div class="github-topic-projects">
</div>

View File

@@ -0,0 +1,178 @@
# FastAPI 👫👫
FastAPI ✔️ 🎆 👪 👈 🙋 👫👫 ⚪️➡️ 🌐 🖥.
## 👼 - 🐛
🙋 ❗ 👶
👉 👤:
{% if people %}
<div class="user-list user-list-center">
{% for user in people.maintainers %}
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">❔: {{ user.answers }}</div><div class="count">🚲 📨: {{ user.prs }}</div></div>
{% endfor %}
</div>
{% endif %}
👤 👼 &amp; 🐛 **FastAPI**. 👆 💪 ✍ 🌅 🔃 👈 [ FastAPI - 🤚 - 🔗 ⏮️ 📕](help-fastapi.md#connect-with-the-author){.internal-link target=_blank}.
...✋️ 📥 👤 💚 🎦 👆 👪.
---
**FastAPI** 📨 📚 🐕‍🦺 ⚪️➡️ 👪. &amp; 👤 💚 🎦 👫 💰.
👫 👫👫 👈:
* [ 🎏 ⏮️ ❔ 📂](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank}.
* [✍ 🚲 📨](help-fastapi.md#create-a-pull-request){.internal-link target=_blank}.
* 📄 🚲 📨, [✴️ ⚠ ✍](contributing.md#translations){.internal-link target=_blank}.
👏 👫. 👶 👶
## 🌅 🦁 👩‍💻 🏁 🗓️
👫 👩‍💻 👈 ✔️ [🤝 🎏 🏆 ⏮️ ❔ 📂](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} ⏮️ 🏁 🗓️. 👶
{% if people %}
<div class="user-list user-list-center">
{% for user in people.last_month_active %}
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">❔ 📨: {{ user.count }}</div></div>
{% endfor %}
</div>
{% endif %}
## 🕴
📥 **FastAPI 🕴**. 👶
👫 👩‍💻 👈 ✔️ [ 🎏 🏆 ⏮️ ❔ 📂](help-fastapi.md#help-others-with-questions-in-github){.internal-link target=_blank} 🔘 *🌐 🕰*.
👫 ✔️ 🎦 🕴 🤝 📚 🎏. 👶
{% if people %}
<div class="user-list user-list-center">
{% for user in people.experts %}
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">❔ 📨: {{ user.count }}</div></div>
{% endfor %}
</div>
{% endif %}
## 🔝 👨‍🔬
📥 **🔝 👨‍🔬**. 👶
👉 👩‍💻 ✔️ [✍ 🏆 🚲 📨](help-fastapi.md#create-a-pull-request){.internal-link target=_blank} 👈 ✔️ *🔗*.
👫 ✔️ 📉 📟, 🧾, ✍, ♒️. 👶
{% if people %}
<div class="user-list user-list-center">
{% for user in people.top_contributors %}
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">🚲 📨: {{ user.count }}</div></div>
{% endfor %}
</div>
{% endif %}
📤 📚 🎏 👨‍🔬 (🌅 🌘 💯), 👆 💪 👀 👫 🌐 <a href="https://github.com/tiangolo/fastapi/graphs/contributors" class="external-link" target="_blank">FastAPI 📂 👨‍🔬 📃</a>. 👶
## 🔝 👨‍🔬
👫 👩‍💻 **🔝 👨‍🔬**. 👶 👶
### 📄 ✍
👤 🕴 💬 👩‍❤‍👨 🇪🇸 (&amp; 🚫 📶 👍 👶). , 👨‍🔬 🕐 👈 ✔️ [**🏋️ ✔ ✍**](contributing.md#translations){.internal-link target=_blank} 🧾. 🍵 👫, 📤 🚫🔜 🧾 📚 🎏 🇪🇸.
---
**🔝 👨‍🔬** 👶 👶 ✔️ 📄 🏆 🚲 📨 ⚪️➡️ 🎏, 🚚 🔆 📟, 🧾, &amp; ✴️, **✍**.
{% if people %}
<div class="user-list user-list-center">
{% for user in people.top_reviewers %}
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a> <div class="count">📄: {{ user.count }}</div></div>
{% endfor %}
</div>
{% endif %}
## 💰
👫 **💰**. 👶
👫 🔗 👇 👷 ⏮️ **FastAPI** (&amp; 🎏), ✴️ 🔘 <a href="https://github.com/sponsors/tiangolo" class="external-link" target="_blank">📂 💰</a>.
{% if sponsors %}
{% if sponsors.gold %}
### 🌟 💰
{% for sponsor in sponsors.gold -%}
<a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
{% endfor %}
{% endif %}
{% if sponsors.silver %}
### 🥇1st 💰
{% for sponsor in sponsors.silver -%}
<a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
{% endfor %}
{% endif %}
{% if sponsors.bronze %}
### 🥈2nd 💰
{% for sponsor in sponsors.bronze -%}
<a href="{{ sponsor.url }}" target="_blank" title="{{ sponsor.title }}"><img src="{{ sponsor.img }}" style="border-radius:15px"></a>
{% endfor %}
{% endif %}
{% endif %}
### 🎯 💰
{% if github_sponsors %}
{% for group in github_sponsors.sponsors %}
<div class="user-list user-list-center">
{% for user in group %}
{% if user.login not in sponsors_badge.logins %}
<div class="user"><a href="{{ user.url }}" target="_blank"><div class="avatar-wrapper"><img src="{{ user.avatarUrl }}"/></div><div class="title">@{{ user.login }}</div></a></div>
{% endif %}
{% endfor %}
</div>
{% endfor %}
{% endif %}
## 🔃 📊 - 📡
👑 🎯 👉 📃 🎦 🎯 👪 🎏.
✴️ ✅ 🎯 👈 🛎 🌘 ⭐, &amp; 📚 💼 🌅 😩, 💖 🤝 🎏 ⏮️ ❔ &amp; ⚖ 🚲 📨 ⏮️ ✍.
💽 ⚖ 🔠 🗓️, 👆 💪 ✍ <a href="https://github.com/tiangolo/fastapi/blob/master/.github/actions/people/app/main.py" class="external-link" target="_blank"> 📟 📥</a>.
📥 👤 🎦 💰 ⚪️➡️ 💰.
👤 🏦 ▶️️ 📊, 📄, ⚡, ♒️ (💼 🤷).

200
docs/em/docs/features.md Normal file
View File

@@ -0,0 +1,200 @@
# ⚒
## FastAPI ⚒
**FastAPI** 🤝 👆 📄:
### ⚓️ 🔛 📂 🐩
* <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank"><strong>🗄</strong></a> 🛠️ 🏗, ✅ 📄 <abbr title="also known as: endpoints, routes">➡</abbr> <abbr title="also known as HTTP methods, as POST, GET, PUT, DELETE">🛠️</abbr>, 🔢, 💪 📨, 💂‍♂, ♒️.
* 🏧 📊 🏷 🧾 ⏮️ <a href="https://json-schema.org/" class="external-link" target="_blank"><strong>🎻 🔗</strong></a> (🗄 ⚫️ 🧢 🔛 🎻 🔗).
* 🔧 🤭 👫 🐩, ⏮️ 😔 🔬. ↩️ 👎 🧽 🔛 🔝.
* 👉 ✔ ⚙️ 🏧 **👩‍💻 📟 ⚡** 📚 🇪🇸.
### 🏧 🩺
🎓 🛠️ 🧾 &amp; 🔬 🕸 👩‍💻 🔢. 🛠️ ⚓️ 🔛 🗄, 📤 💗 🎛, 2⃣ 🔌 🔢.
* <a href="https://github.com/swagger-api/swagger-ui" class="external-link" target="_blank"><strong>🦁 🎚</strong></a>, ⏮️ 🎓 🔬, 🤙 &amp; 💯 👆 🛠️ 🔗 ⚪️➡️ 🖥.
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
* 🎛 🛠️ 🧾 ⏮️ <a href="https://github.com/Rebilly/ReDoc" class="external-link" target="_blank"><strong>📄</strong></a>.
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
### 🏛 🐍
⚫️ 🌐 ⚓️ 🔛 🐩 **🐍 3⃣.6️⃣ 🆎** 📄 (👏 Pydantic). 🙅‍♂ 🆕 ❕ 💡. 🐩 🏛 🐍.
🚥 👆 💪 2⃣ ⏲ ↗️ ❔ ⚙️ 🐍 🆎 (🚥 👆 🚫 ⚙️ FastAPI), ✅ 📏 🔰: [🐍 🆎](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` ⛓:
🚶‍♀️ 🔑 &amp; 💲 `second_user_data` #⃣ 🔗 🔑-💲 ❌, 🌓: `User(id=4, name="Mary", joined="2018-11-30")`
### 👨‍🎨 🐕‍🦺
🌐 🛠️ 🏗 ⏩ &amp; 🏋️ ⚙️, 🌐 🚫 💯 🔛 💗 👨‍🎨 ⏭ ▶️ 🛠️, 🚚 🏆 🛠️ 💡.
🏁 🐍 👩‍💻 🔬 ⚫️ 🆑 <a href="https://www.jetbrains.com/research/python-developers-survey-2017/#tools-and-features" class="external-link" target="_blank">👈 🌅 ⚙️ ⚒ "✍"</a>.
🎂 **FastAPI** 🛠️ ⚓️ 😌 👈. ✍ 👷 🌐.
👆 🔜 🛎 💪 👟 🔙 🩺.
📥 ❔ 👆 👨‍🎨 💪 👆:
* <a href="https://code.visualstudio.com/" class="external-link" target="_blank">🎙 🎙 📟</a>:
![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
* <a href="https://www.jetbrains.com/pycharm/" class="external-link" target="_blank">🗒</a>:
![editor support](https://fastapi.tiangolo.com/img/pycharm-completion.png)
👆 🔜 🤚 🛠️ 📟 👆 5⃣📆 🤔 💪 ⏭. 🖼, `price` 🔑 🔘 🎻 💪 (👈 💪 ✔️ 🐦) 👈 👟 ⚪️➡️ 📨.
🙅‍♂ 🌖 ⌨ ❌ 🔑 📛, 👟 🔙 &amp; ➡ 🖖 🩺, ⚖️ 📜 🆙 &amp; 🔽 🔎 🚥 👆 😒 ⚙️ `username` ⚖️ `user_name`.
### 📏
⚫️ ✔️ 🤔 **🔢** 🌐, ⏮️ 📦 📳 🌐. 🌐 🔢 💪 👌-🎧 ⚫️❔ 👆 💪 &amp; 🔬 🛠️ 👆 💪.
✋️ 🔢, ⚫️ 🌐 **"👷"**.
### 🔬
* 🔬 🌅 (⚖️ 🌐 ❓) 🐍 **💽 🆎**, 🔌:
* 🎻 🎚 (`dict`).
* 🎻 🎻 (`list`) ⚖ 🏬 🆎.
* 🎻 (`str`) 🏑, 🔬 🕙 &amp; 👟 📐.
* 🔢 (`int`, `float`) ⏮️ 🕙 &amp; 👟 💲, ♒️.
* 🔬 🌅 😍 🆎, 💖:
* 📛.
* 📧.
* 🆔.
* ...&amp; 🎏.
🌐 🔬 🍵 👍-🏛 &amp; 🏋️ **Pydantic**.
### 💂‍♂ &amp; 🤝
💂‍♂ &amp; 🤝 🛠️. 🍵 🙆 ⚠ ⏮️ 💽 ⚖️ 📊 🏷.
🌐 💂‍♂ ⚖ 🔬 🗄, 🔌:
* 🇺🇸🔍 🔰.
* **Oauth2⃣** (⏮️ **🥙 🤝**). ✅ 🔰 🔛 [Oauth2⃣ ⏮️ 🥙](tutorial/security/oauth2-jwt.md){.internal-link target=_blank}.
* 🛠️ 🔑:
* 🎚.
* 🔢 🔢.
* 🍪, ♒️.
🌐 💂‍♂ ⚒ ⚪️➡️ 💃 (🔌 **🎉 🍪**).
🌐 🏗 ♻ 🧰 &amp; 🦲 👈 ⏩ 🛠️ ⏮️ 👆 ⚙️, 📊 🏪, 🔗 &amp; ☁ 💽, ♒️.
### 🔗 💉
FastAPI 🔌 📶 ⏩ ⚙️, ✋️ 📶 🏋️ <abbr title='also known as "components", "resources", "services", "providers"'><strong>🔗 💉</strong></abbr> ⚙️.
* 🔗 💪 ✔️ 🔗, 🏗 🔗 ⚖️ **"📊" 🔗**.
* 🌐 **🔁 🍵** 🛠️.
* 🌐 🔗 💪 🚚 💽 ⚪️➡️ 📨 &amp; **↔ ➡ 🛠️** ⚛ &amp; 🏧 🧾.
* **🏧 🔬** *➡ 🛠️* 🔢 🔬 🔗.
* 🐕‍🦺 🏗 👩‍💻 🤝 ⚙️, **💽 🔗**, ♒️.
* **🙅‍♂ ⚠** ⏮️ 💽, 🕸, ♒️. ✋️ ⏩ 🛠️ ⏮️ 🌐 👫.
### ♾ "🔌-🔌"
⚖️ 🎏 🌌, 🙅‍♂ 💪 👫, 🗄 &amp; ⚙️ 📟 👆 💪.
🙆 🛠️ 🏗 🙅 ⚙️ (⏮️ 🔗) 👈 👆 💪 ✍ "🔌-" 👆 🈸 2⃣ ⏸ 📟 ⚙️ 🎏 📊 &amp; ❕ ⚙️ 👆 *➡ 🛠️*.
### 💯
* 1⃣0⃣0⃣ 💯 <abbr title="The amount of code that is automatically tested">💯 💰</abbr>.
* 1⃣0⃣0⃣ 💯 <abbr title="Python type annotations, with this your editor and external tools can give you better support">🆎 ✍</abbr> 📟 🧢.
* ⚙️ 🏭 🈸.
## 💃 ⚒
**FastAPI** 🍕 🔗 ⏮️ (&amp; ⚓️ 🔛) <a href="https://www.starlette.io/" class="external-link" target="_blank"><strong>💃</strong></a>. , 🙆 🌖 💃 📟 👆 ✔️, 🔜 👷.
`FastAPI` 🤙 🎧-🎓 `Starlette`. , 🚥 👆 ⏪ 💭 ⚖️ ⚙️ 💃, 🌅 🛠️ 🔜 👷 🎏 🌌.
⏮️ **FastAPI** 👆 🤚 🌐 **💃**'Ⓜ ⚒ (FastAPI 💃 🔛 💊):
* 🤙 🎆 🎭. ⚫️ <a href="https://github.com/encode/starlette#performance" class="external-link" target="_blank">1⃣ ⏩ 🐍 🛠️ 💪, 🔛 🇷🇪 ⏮️ **✳** &amp; **🚶**</a>.
* ** *️⃣ ** 🐕‍🦺.
* -🛠️ 🖥 📋.
* 🕴 &amp; 🤫 🎉.
* 💯 👩‍💻 🏗 🔛 🇸🇲.
* **⚜**, 🗜, 🎻 📁, 🎏 📨.
* **🎉 &amp; 🍪** 🐕‍🦺.
* 1⃣0⃣0⃣ 💯 💯 💰.
* 1⃣0⃣0⃣ 💯 🆎 ✍ ✍.
## Pydantic ⚒
**FastAPI** 🍕 🔗 ⏮️ (&amp; ⚓️ 🔛) <a href="https://pydantic-docs.helpmanual.io" class="external-link" target="_blank"><strong>Pydantic</strong></a>. , 🙆 🌖 Pydantic 📟 👆 ✔️, 🔜 👷.
✅ 🔢 🗃 ⚓️ 🔛 Pydantic, <abbr title="Object-Relational Mapper">🐜</abbr>Ⓜ, <abbr title="Object-Document Mapper">🏭</abbr>Ⓜ 💽.
👉 ⛓ 👈 📚 💼 👆 💪 🚶‍♀️ 🎏 🎚 👆 🤚 ⚪️➡️ 📨 **🔗 💽**, 🌐 ✔ 🔁.
🎏 ✔ 🎏 🌌 🤭, 📚 💼 👆 💪 🚶‍♀️ 🎚 👆 🤚 ⚪️➡️ 💽 **🔗 👩‍💻**.
⏮️ **FastAPI** 👆 🤚 🌐 **Pydantic**'Ⓜ ⚒ (FastAPI ⚓️ 🔛 Pydantic 🌐 💽 🚚):
* **🙅‍♂ 🔠**:
* 🙅‍♂ 🆕 🔗 🔑 ◾-🇪🇸 💡.
* 🚥 👆 💭 🐍 🆎 👆 💭 ❔ ⚙️ Pydantic.
* 🤾 🎆 ⏮️ 👆 **<abbr title="Integrated Development Environment, similar to a code editor">💾</abbr>/<abbr title="A program that checks for code errors">🧶</abbr>/🧠**:
* ↩️ Pydantic 📊 📊 👐 🎓 👆 🔬; 🚘-🛠️, 🧽, ✍ &amp; 👆 🤔 🔜 🌐 👷 ☑ ⏮️ 👆 ✔ 💽.
* **⏩**:
* <a href="https://pydantic-docs.helpmanual.io/benchmarks/" class="external-link" target="_blank">📇</a> Pydantic ⏩ 🌘 🌐 🎏 💯 🗃.
***🏗 📊**:
* ⚙️ 🔗 Pydantic 🏷, 🐍 `typing`'Ⓜ `List` &amp; `Dict`, ♒️.
* &amp; 💳 ✔ 🏗 💽 🔗 🎯 &amp; 💪 🔬, ✅ &amp; 📄 🎻 🔗.
* 👆 💪 ✔️ 🙇 **🐦 🎻** 🎚 &amp; ✔️ 👫 🌐 ✔ &amp; ✍.
* **🏧**:
* Pydantic ✔ 🛃 📊 🆎 🔬 ⚖️ 👆 💪 ↔ 🔬 ⏮️ 👩‍🔬 🔛 🏷 🎀 ⏮️ 💳 👨‍🎨.
* 1⃣0⃣0⃣ 💯 💯 💰.

Some files were not shown because too many files have changed in this diff Show More