Compare commits

...

2225 Commits

Author SHA1 Message Date
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
Sebastián Ramírez
4d91f978d2 🔖 Release version 0.65.2 2021-06-09 10:17:27 +02:00
Sebastián Ramírez
aabe2c7d66 📝 Update release notes 2021-06-09 10:16:25 +02:00
Sebastián Ramírez
377234ad8e 🔒 Create Security Policy 2021-06-07 14:55:40 +02:00
github-actions
38b785813f 📝 Update release notes 2021-06-07 10:46:59 +00:00
Patrick Wang
fa7e3c996e 🐛 Check Content-Type request header before assuming JSON (#2118)
Co-authored-by: Patrick Wang <patrickkwang@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-06-07 12:46:18 +02:00
github-actions
90120dd6e8 📝 Update release notes 2021-06-07 08:53:24 +00:00
Sebastián Ramírez
36772548b7 🔧 Update sponsors badge, course bundle (#3340)
* 🔧 Update sponsors badge, course bundle

* 🍱 Update course bundle SVG sizes
2021-06-07 10:52:44 +02:00
github-actions
40bb0c5f36 📝 Update release notes 2021-05-26 09:26:47 +00:00
Sebastián Ramírez
60918d25a1 🔧 Add new gold sponsor Jina 🎉 (#3291) 2021-05-26 11:26:06 +02:00
github-actions
3afce2c4b8 📝 Update release notes 2021-05-25 15:06:28 +00:00
Sebastián Ramírez
9f6f25d54c 🔧 Add new banner sponsor badge for FastAPI courses bundle (#3288) 2021-05-25 17:05:39 +02:00
Sebastián Ramírez
d5b09cd958 🔧 Add new banner sponsor badge for FastAPI courses bundle (#3288) 2021-05-25 17:05:04 +02:00
github-actions
aece74982d 📝 Update release notes 2021-05-16 18:28:24 +00:00
Sebastián Ramírez
2b1e5b9f82 👷 Upgrade Issue Manager GitHub Action (#3236) 2021-05-16 20:27:45 +02:00
Sebastián Ramírez
43df5d05ed 🔖 Release FastAPI version 0.65.1 2021-05-11 23:19:14 +02:00
github-actions
eaa49ebd20 📝 Update release notes 2021-05-11 21:17:51 +00:00
Sebastián Ramírez
a6293397bc 📌 Upgrade pydantic pin, to handle security vulnerability CVE-2021-29510 (#3213) 2021-05-11 23:17:17 +02:00
Sebastián Ramírez
b890bd1dc5 🔖 Release version 0.65.0 2021-05-10 17:45:21 +02:00
github-actions
3819a11b5f 📝 Update release notes 2021-05-10 14:09:42 +00:00
Hannes Küttner
4aed0411e9 ⬆️ Upgrade Starlette to 0.14.2, including internal UJSONResponse migrated from Starlette (#2335) 2021-05-10 16:09:04 +02:00
github-actions
04ac466748 📝 Update release notes 2021-05-10 08:11:22 +00:00
Sebastián Ramírez
d75126a4ce 👷 Add GitHub Action cache to speed up CI installs (#3204) 2021-05-10 10:10:48 +02:00
github-actions
c654e8384b 📝 Update release notes 2021-05-10 07:47:11 +00:00
Sebastián Ramírez
7c9d0168ff ⬆️ Upgrade setup-python GitHub Action to v2 (#3203) 2021-05-10 09:46:32 +02:00
github-actions
e956ba4d4a 📝 Update release notes 2021-05-10 07:27:43 +00:00
neternefer
85b32f51ff 🌐 Initialize new language Polish for translations (#3170)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-05-10 09:27:07 +02:00
github-actions
08fabb7b2e 📝 Update release notes 2021-05-10 07:16:15 +00:00
Sebastián Ramírez
273b2cd646 🐛 Fix docs script to generate a new translation language with overrides boilerplate (#3202) 2021-05-10 09:15:39 +02:00
github-actions
de1a5125f8 📝 Update release notes 2021-05-08 17:51:32 +00:00
Sebastián Ramírez
da86791224 Add new Deta banner badge with new sponsorship tier 🙇 (#3194) 2021-05-08 19:50:56 +02:00
Sebastián Ramírez
c646eaa6bb ✏️ Fix typo/order in release notes 2021-05-07 14:25:21 +02:00
github-actions
bf44b428dd 📝 Update release notes 2021-05-07 12:19:57 +00:00
github-actions[bot]
c2907b189c 👥 Update FastAPI People (#3189)
Co-authored-by: github-actions <github-actions@github.com>
2021-05-07 14:19:19 +02:00
github-actions
75317d230b 📝 Update release notes 2021-05-07 12:05:45 +00:00
Sebastián Ramírez
e662654c49 🔊 Update FastAPI People to allow better debugging (#3188) 2021-05-07 14:04:54 +02:00
Sebastián Ramírez
2a67321130 🔖 Release version 0.64.0 2021-05-07 10:15:26 +02:00
Sebastián Ramírez
8d9d2c0d3f 📝 Update release notes 2021-05-07 10:14:21 +02:00
github-actions
dc6a78c357 📝 Update release notes 2021-05-06 15:48:23 +00:00
T
73d1def114 📝 Add link to article in Russian "FastAPI: знакомимся с фреймворком" (#2564) 2021-05-06 17:47:49 +02:00
github-actions
3dc74ba29f 📝 Update release notes 2021-05-06 15:42:53 +00:00
dompatmore
d9d6031db5 📝 Add external link to blog post "Authenticate Your FastAPI App with Auth0" (#2172)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-05-06 17:42:14 +02:00
Sebastián Ramírez
6135417789 📝 Update release notes 2021-05-06 17:32:04 +02:00
github-actions
6d138f218b 📝 Update release notes 2021-05-05 18:21:32 +00:00
Austin Orr
e10a4375f9 Add support for adding multiple examples in request bodies and path, query, cookie, and header params (#1267)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-05-05 20:20:56 +02:00
github-actions
3e32eb55f0 📝 Update release notes 2021-05-04 09:03:02 +00:00
NiJia Lin
b3f139c0d9 🌐 Fix Chinese translation of Tutorial - Query Parameters, remove obsolete content (#3051) 2021-05-04 11:02:19 +02:00
github-actions
3b4c692534 📝 Update release notes 2021-05-04 09:01:17 +00:00
Sam Courtemanche
05c859f324 🌐 Add French translation for Tutorial - Background Tasks (#3098)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-05-04 11:00:43 +02:00
github-actions
48a33b0453 📝 Update release notes 2021-05-04 08:49:43 +00:00
SueNaeunYang
70746a7bf0 🌐 Fix Korean translation for docs/ko/docs/index.md (#3159) 2021-05-04 10:49:07 +02:00
github-actions
69e3c6e3d3 📝 Update release notes 2021-05-04 08:38:41 +00:00
Spike
388e5c0c25 🌐 Add Korean translation for Tutorial - Query Parameters (#2390)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-05-04 10:38:02 +02:00
github-actions
61db5ebcc2 📝 Update release notes 2021-05-04 08:28:21 +00:00
JulianMaurin
23845979ea 🌐 Add French translation for FastAPI People (#2232)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-05-04 10:27:49 +02:00
github-actions
83f7a36d05 📝 Update release notes 2021-05-04 08:25:39 +00:00
Spike
462014e296 🌐 Add Korean translation for Tutorial - Path Parameters (#2355) 2021-05-04 10:24:58 +02:00
github-actions
5da5ae5554 📝 Update release notes 2021-05-04 08:20:03 +00:00
Jérôme Fink
f3a985cb81 🌐 Add French translation for Features (#2157)
Co-authored-by: Jérôme Fink <jerome.fink@unamur.be>
2021-05-04 10:19:24 +02:00
github-actions
22528373bb 📝 Update release notes 2021-04-07 07:04:13 +00:00
github-actions[bot]
ce0ec06e8a 👥 Update FastAPI People (#3031)
Co-authored-by: github-actions <github-actions@github.com>
2021-04-07 09:03:39 +02:00
github-actions
10397ddc30 📝 Update release notes 2021-03-27 17:52:30 +00:00
Shucai.wang
6f72a27632 🌐 Add Chinese translation for Tutorial - Debugging (#2737)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-03-27 18:51:51 +01:00
Sebastián Ramírez
2783667f80 📝 Update release notes 2021-03-27 18:50:39 +01:00
github-actions
d8c1d040d4 📝 Update release notes 2021-03-27 17:39:13 +00:00
Xie Wei
7f037f1bdc 🌐 Add Chinese translation for Tutorial - Security - OAuth2 with Password (and hashing), Bearer with JWT tokens (#2642)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-03-27 18:38:33 +01:00
github-actions
f31104585f 📝 Update release notes 2021-03-27 17:36:52 +00:00
mode
5934a75ddd 🌐 Add Korean translation for Tutorial - Header Parameters (#2589)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-03-27 18:36:09 +01:00
github-actions
650abf091b 📝 Update release notes 2021-03-27 17:31:54 +00:00
Shucai.wang
66f18e9282 🌐 Add Chinese translation for Tutorial - Metadata and Docs URLs (#2559) 2021-03-27 18:31:11 +01:00
github-actions
f044f13121 📝 Update release notes 2021-03-27 17:30:24 +00:00
Spike
0250cfa398 🌐 Add Korean translation for Tutorial - First Steps (#2323)
Co-authored-by: Dahun Jeong <gnsgnsek@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-03-27 18:29:45 +01:00
github-actions
f4ce2510f3 📝 Update release notes 2021-03-27 17:28:52 +00:00
Shucai.wang
8f0a604a37 🌐 Add Chinese translation for Tutorial - CORS (Cross-Origin Resource Sharing) (#2540)
Co-authored-by: Xie Wei <ampedee@gmail.com>
2021-03-27 18:28:07 +01:00
github-actions
0f4c2b6ee0 📝 Update release notes 2021-03-27 17:26:01 +00:00
lpdswing
368d314e11 🌐 Add Chinese translation for Tutorial - Middleware (#2334)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-03-27 18:25:21 +01:00
github-actions
4e79cb0be4 📝 Update release notes 2021-03-27 17:23:26 +00:00
Spike
973595b3cb 🌐 Add Korean translation for Tutorial - Intro (#2317)
Co-authored-by: Dahun Jeong <gnsgnsek@gmail.com>
2021-03-27 18:22:50 +01:00
github-actions
fa779017d2 📝 Update release notes 2021-03-27 16:55:48 +00:00
Sebastián Ramírez
b2e27de2fc 🔧 Update top banner, point to newsletter (#3003) 2021-03-27 17:55:12 +01:00
github-actions
31a7bfd227 📝 Update release notes 2021-03-27 16:46:10 +00:00
Sebastián Ramírez
47dde41c6c 🔧 Disable sponsor WeTransfer (#3002) 2021-03-27 17:45:32 +01:00
github-actions
413a86998e 📝 Update release notes 2021-03-27 16:36:52 +00:00
Sebastián Ramírez
36721d4362 📌 Pin SQLAlchemy range, as it doesn't use SemVer (#3001) 2021-03-27 17:36:07 +01:00
github-actions
c09e950bd2 📝 Update release notes 2021-03-01 19:02:33 +00:00
Sebastián Ramírez
4d208b2b90 🎨 Add newly required type annotations for mypy (#2882)
* ⬆️ Upgrade mypy

* 🎨 Add extra type annotations, now required by mypy
2021-03-01 20:01:50 +01:00
github-actions
071c6a17dd 📝 Update release notes 2021-03-01 18:33:53 +00:00
github-actions[bot]
4ab79c679b 👥 Update FastAPI People (#2880)
Co-authored-by: github-actions <github-actions@github.com>
2021-03-01 19:33:08 +01:00
github-actions
33be5fc8ba 📝 Update release notes 2021-02-07 18:27:26 +00:00
Davide Fiocco
a7a353e1f5 📝 Fix broken link to article: Machine learning model serving in Python using FastAPI and Streamlit (#2557) 2021-02-07 19:26:44 +01:00
github-actions
c153d9b83e 📝 Update release notes 2021-02-07 18:26:07 +00:00
vjanz
2875d88ccf 📝 Add FastAPI Medium Article: Deploy a dockerized FastAPI application to AWS (#2515)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-02-07 19:25:27 +01:00
github-actions
9e0cca828d 📝 Update release notes 2021-02-07 18:19:21 +00:00
johnthagen
5dc3ec4a65 ✏ Fix typo in Tutorial - Handling Errors (#2486) 2021-02-07 19:18:37 +01:00
github-actions
bda392cba6 📝 Update release notes 2021-02-07 18:16:26 +00:00
water_lift
f22137346a 🎨 Remove internal "type: ignore", now unnecessary (#2424) 2021-02-07 19:15:43 +01:00
github-actions
f108741a82 📝 Update release notes 2021-02-07 18:14:23 +00:00
Jürgen Gmach
8433e8efe2 ✏ Fix typo in Security OAuth2 scopes (#2407) 2021-02-07 19:13:41 +01:00
github-actions
e6a1a9e193 📝 Update release notes 2021-02-07 18:06:49 +00:00
kangni
bbb22813e6 ✏ Fix typo/clarify docs for SQL (Relational) Databases (#2393)
By way of code example, I think this is a typo. btw, the tutorial is very well written.
2021-02-07 19:06:08 +01:00
github-actions
f0f8e287ec 📝 Update release notes 2021-02-07 18:02:41 +00:00
Xie Wei
0af6cbe990 🌐 Add Chinese translation for Tutorial - Bigger Applications - Multiple Files (#2453)
Co-authored-by: Shucai.wang <blt23@126.com>
2021-02-07 19:02:00 +01:00
github-actions
9e9e068762 📝 Update release notes 2021-02-07 18:01:12 +00:00
Xie Wei
9fda0149da 🌐 Add Chinese translation for Tutorial - Security - Security Intro (#2443) 2021-02-07 19:00:14 +01:00
github-actions
95a713b3e2 📝 Update release notes 2021-02-07 17:59:55 +00:00
maoyibo
2da3d62d37 🌐 Add Chinese translation for Tutorial - Header Parameters (#2412)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-02-07 18:59:12 +01:00
github-actions
7dd2e92d7e 📝 Update release notes 2021-02-07 17:52:50 +00:00
maoyibo
6d06e13284 🌐 Add Chinese translation for Tutorial - Extra Data Types (#2410)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-02-07 18:52:09 +01:00
github-actions
a2199c545b 📝 Update release notes 2021-02-07 17:47:02 +00:00
T. Tokusumi
08cbc6c8ff 🌐 Add Japanese translation for Deployment - Docker (#2312)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sho Nakamura <sh0nk.developer@gmail.com>
2021-02-07 18:46:22 +01:00
github-actions
f730160037 📝 Update release notes 2021-02-07 17:45:09 +00:00
T. Tokusumi
20360c207e 🌐 Add Japanese translation for Deployment - Versions (#2310)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sho Nakamura <sh0nk.developer@gmail.com>
2021-02-07 18:44:28 +01:00
github-actions
568a54dff2 📝 Update release notes 2021-02-07 17:43:14 +00:00
Alicrazy
91cacc9c92 🌐 Add Chinese translation for Tutorial - Cookie Parameters (#2261)
Co-authored-by: lijun <lijun@duozhuayu.net>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-02-07 18:42:34 +01:00
github-actions
b3899333f4 📝 Update release notes 2021-02-07 17:41:26 +00:00
Amit Chaudhary
6b6a310e54 📝 Add external link to "FastAPI for Flask Users" (#2280) 2021-02-07 18:40:42 +01:00
github-actions
cb2dce03c0 📝 Update release notes 2021-02-07 17:38:52 +00:00
T. Tokusumi
7122687f25 🌐 Add Japanese translation for Tutorial - Static files (#2260)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sho Nakamura <sh0nk.developer@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-02-07 18:38:10 +01:00
github-actions
af6fcf1413 📝 Update release notes 2021-02-07 17:32:12 +00:00
T. Tokusumi
cd8b90a5a4 🌐 Add Japanese translation for Tutorial - Testing (#2259)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sho Nakamura <sh0nk.developer@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-02-07 18:31:30 +01:00
github-actions
c88fb2eef0 📝 Update release notes 2021-02-07 17:26:15 +00:00
T. Tokusumi
17781e3596 🌐 Add Japanese translation for Tutorial - Debugging (#2256)
Co-authored-by: Sho Nakamura <sh0nk.developer@gmail.com>
2021-02-07 18:25:31 +01:00
github-actions
a381642558 📝 Update release notes 2021-02-07 17:24:39 +00:00
T. Tokusumi
5828043b69 🌐 Add Japanese translation for Tutorial - Middleware (#2255)
Co-authored-by: Sho Nakamura <sh0nk.developer@gmail.com>
2021-02-07 18:23:55 +01:00
github-actions
909a81f88a 📝 Update release notes 2021-02-07 17:21:27 +00:00
T. Tokusumi
faec713e0d 🌐 Add Japanese translation for Concurrency and async / await (#2058)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sho Nakamura <sh0nk.developer@gmail.com>
2021-02-07 18:20:43 +01:00
github-actions
60addbcdd5 📝 Update release notes 2021-02-01 14:49:57 +00:00
github-actions[bot]
a27a1bc53c 👥 Update FastAPI People (#2739)
Co-authored-by: github-actions <github-actions@github.com>
2021-02-01 15:49:09 +01:00
github-actions
41f291524d 📝 Update release notes 2021-01-19 20:13:46 +00:00
Sebastián Ramírez
6b3bc7384e 🔧 Add new Gold Sponsor Talk Python 🎉 (#2673) 2021-01-19 21:12:58 +01:00
github-actions
561bbfb5d2 📝 Update release notes 2021-01-18 15:35:35 +00:00
Sebastián Ramírez
8ce1c81398 🔧 Add new Gold Sponsor vim.so 🎉 (#2669) 2021-01-18 16:34:46 +01:00
github-actions
cb40e27db2 📝 Update release notes 2021-01-09 21:24:44 +00:00
Sebastián Ramírez
f031973848 🔧 Add FastAPI user survey banner (#2623)
* 🔧 Add FastAPI user survey banner

* 🔧 Make FastAPI user survey banner open new tab
2021-01-09 22:24:03 +01:00
github-actions
307d37d85c 📝 Update release notes 2021-01-09 21:11:58 +00:00
Sebastián Ramírez
bf290fa5f0 🔧 Add new Bronze Sponsor(s) 🥉🎉 (#2622)
* 🔧 Update FastAPI People sponsors, include new Bronze Sponsor 🎉

* 📝 Update FastAPI People in Japanese
2021-01-09 22:11:15 +01:00
github-actions
26f313d524 📝 Update release notes 2021-01-09 20:55:21 +00:00
Sebastián Ramírez
73021d7261 📝 Update social links: add Discord, fix GitHub (#2621) 2021-01-09 21:54:38 +01:00
github-actions
f54fb88ad5 📝 Update release notes 2021-01-09 19:00:40 +00:00
Xie Wei
b3d2f47bc8 🌐 Add Chinese translation for Tutorial - Security - Simple OAuth2 with Password and Bearer (#2514)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-01-09 19:59:56 +01:00
github-actions
52f170b3fe 📝 Update release notes 2021-01-09 18:59:33 +00:00
T. Tokusumi
9442845ca5 🌐 Add Japanese translation for Deployment - Deta (#2314)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-01-09 19:58:52 +01:00
github-actions
fe31b0caae 📝 Update release notes 2021-01-09 18:53:47 +00:00
Xie Wei
d2ca3df033 🌐 Add Chinese translation for Tutorial - Security - Get Current User (#2474) 2021-01-09 19:53:05 +01:00
github-actions
838ea752b2 📝 Update release notes 2021-01-09 18:52:30 +00:00
T. Tokusumi
2b49b8c70a 🌐 Add Japanese translation for Deployment - Manually (#2313)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-01-09 19:51:42 +01:00
github-actions
05b024d61b 📝 Update release notes 2021-01-09 18:47:49 +00:00
T. Tokusumi
c7742e3c56 🌐 Add Japanese translation for Deployment - Intro (#2309)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-01-09 19:47:08 +01:00
github-actions
4f9104ce97 📝 Update release notes 2021-01-09 18:43:08 +00:00
T. Tokusumi
07a8f7b5b5 🌐 Add Japanese translation for FastAPI People (#2254)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
2021-01-09 19:42:24 +01:00
github-actions
f2a28f4b5b 📝 Update release notes 2021-01-09 18:41:10 +00:00
atsumi
5a4a61ca67 🌐 Add Japanese translation for Advanced - Path Operation Advanced Configuration (#2124)
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
2021-01-09 19:40:27 +01:00
github-actions
71ac76c3cd 📝 Update release notes 2021-01-09 18:39:11 +00:00
T. Tokusumi
68dca8f42d 🌐 Add Japanese translation for External Links (#2070)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2021-01-09 19:38:20 +01:00
github-actions
a38e6f4e2c 📝 Update release notes 2021-01-09 18:33:53 +00:00
SwftAlpc
ca26f2274c 🌐 Add Japanese translation for Tutorial - Body - Updates (#1956)
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
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: Sebastián Ramírez <tiangolo@gmail.com>
2021-01-09 19:33:07 +01:00
github-actions
8108cd89bb 📝 Update release notes 2021-01-09 18:28:54 +00:00
SwftAlpc
8560151090 🌐 Add Japanese translation for Tutorial - Form Data (#1943)
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>
2021-01-09 19:28:15 +01:00
github-actions
91805cdf03 📝 Update release notes 2021-01-09 18:20:10 +00:00
SwftAlpc
48cba16578 🌐 Add Japanese translation for Tutorial - Cookie Parameters (#1933)
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>
2021-01-09 19:19:26 +01:00
github-actions
7098e3b150 📝 Update release notes 2021-01-09 16:58:08 +00:00
Sebastián Ramírez
a7cc25eb11 🔧 Update FastAPI People GitHub Sponsors order (#2620) 2021-01-09 17:57:27 +01:00
github-actions
d2eb4a71ee 📝 Update release notes 2021-01-05 21:04:05 +00:00
Sebastián Ramírez
54eeb3161f 🔧 Update InvestSuite sponsor data (#2608) 2021-01-05 22:03:24 +01:00
github-actions
4fabcfa3ab 📝 Update release notes 2021-01-01 20:15:01 +00:00
github-actions[bot]
5c29daadcc 👥 Update FastAPI People (#2590)
Co-authored-by: github-actions <github-actions@github.com>
2021-01-01 21:14:17 +01:00
Sebastián Ramírez
5614b94ccc 📝 Update release notes 2020-12-20 20:18:06 +01:00
Sebastián Ramírez
e170c86412 🔖 Release version 0.63.0 2020-12-20 20:16:12 +01:00
github-actions
180bdf31ac 📝 Update release notes 2020-12-20 19:13:21 +00:00
Sebastián Ramírez
1e58a3e44c ⬆️ Upgrade Uvicorn when installing fastapi[all] to the latest version including uvloop (#2548)
* ⬆️ Upgrade Uvicorn when installing fastapi[all] to the latest version, including uvloop

* ⬆️ Relax Uvicorn version range to the minimum supported

in case anyone depends older versions somehow installed with FastAPI extras
2020-12-20 20:12:39 +01:00
Sebastián Ramírez
dfe3f614ed 📝 Update release notes 2020-12-20 19:57:11 +01:00
github-actions
97c747fe54 📝 Update release notes 2020-12-20 18:50:42 +00:00
Sebastián Ramírez
fdb6c9ccc5 Improve type annotations, add support for mypy --strict, internally and for external packages (#2547) 2020-12-20 19:50:00 +01:00
github-actions
4fdcdf341c 📝 Update release notes 2020-12-19 20:31:01 +00:00
Sebastián Ramírez
e2a6341c60 📝 Update Uvicorn installation instructions to use uvicorn[standard] (includes uvloop) (#2543) 2020-12-19 21:30:18 +01:00
github-actions
7046d80a23 📝 Update release notes 2020-12-19 19:54:43 +00:00
Sebastián Ramírez
9f89399f5e 🌐 Add docs lang selector widget (#2542)
*  Add language selector widget

* 🔧 Update script to re-generate MkDocs configs, including langs widget

* 🔧 Update languages MkDocs configs, with lang selector widget
2020-12-19 20:54:02 +01:00
github-actions
ed0fe9f369 📝 Update release notes 2020-12-19 18:55:37 +00:00
Sebastián Ramírez
6e9b771abf 🐛 Fix docs overrides directory for translations (#2541)
* 🙈 Add .gitignore files to keep overrides directories for translations to fix serving live locally during translations

* ♻️ Refactor docs scripts to handle language overrides (newsletter notification)
2020-12-19 19:54:54 +01:00
github-actions
4a93562a3d 📝 Update release notes 2020-12-19 18:17:19 +00:00
Xie Wei
3f478b7733 🌐 Add Chinese translation for Tutorial - Response Status Code (#2442)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-12-19 19:16:37 +01:00
github-actions
c660d96dce 📝 Update release notes 2020-12-19 18:06:59 +00:00
Sebastián Ramírez
6de9f5890d Remove Typer as a docs building dependency (covered by typer-cli) to fix pip resolver conflicts (#2539) 2020-12-19 19:06:19 +01:00
github-actions
a16ecf2f91 📝 Update release notes 2020-12-19 14:06:30 +00:00
vjanz
7a2c5526d4 🌐 Start translation of the documentation for the Albanian language (#2516) 2020-12-19 15:05:49 +01:00
github-actions
d6b5bc9401 📝 Update release notes 2020-12-13 15:34:30 +00:00
Sebastián Ramírez
e6f8aa8756 Add newsletter: FastAPI and friends (#2509)
*  Add newsletter: FastAPI and friends

* 🔧 Update MkDocs config for announcement

* 🔧 Update generation script to include overrides for announcements
2020-12-13 16:33:46 +01:00
github-actions
f0a14a9ab6 📝 Update release notes 2020-12-12 21:28:29 +00:00
Sebastián Ramírez
c3dbf4ef7c Add new Gold Sponsor: InvestSuite 🎉 (#2508) 2020-12-12 22:27:46 +01:00
github-actions
52dd5924d7 📝 Update release notes 2020-12-06 08:36:00 +00:00
Sebastián Ramírez
a960c42178 🔧 Add issue template configs (#2476)
🔧 Add issue template configs
2020-12-06 09:35:21 +01:00
github-actions
436b023fe4 📝 Update release notes 2020-12-03 17:38:21 +00:00
Xie Wei
f1759297c7 🌐 Add Chinese translation for Tutorial - Extra Models (#2416)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-12-03 18:36:46 +01:00
github-actions
f1ca8da6e1 📝 Update release notes 2020-12-03 17:28:44 +00:00
Xie Wei
478f157013 🌐 Add Chinese translation for Tutorial - Response Model (#2414)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-12-03 18:27:58 +01:00
github-actions
5c8b41abf2 📝 Update release notes 2020-12-03 17:08:59 +00:00
maoyibo
4236c99b7f 🌐 Add Chinese translation for Tutorial - Schema Extra Example (#2411) 2020-12-03 18:08:11 +01:00
github-actions
1a816fd6a0 📝 Update release notes 2020-12-03 17:06:04 +00:00
hard_coder
02b7d988ae 🌐 Add Korean translation for Index (#2192) 2020-12-03 18:05:19 +01:00
github-actions
1b70a1cbf6 📝 Update release notes 2020-12-03 17:01:38 +00:00
atsumi
259c55f7cd 🌐 Add Japanese translation for Advanced User Guide - Additional Status Codes (#2145)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
2020-12-03 18:00:54 +01:00
github-actions
6a05f1774e 📝 Update release notes 2020-12-03 16:58:32 +00:00
Sebastián Ramírez
6189aacd0f 📝 Update title for Deta tutorial (#2466) 2020-12-03 17:57:50 +01:00
github-actions
9e6b069c09 📝 Update release notes 2020-12-02 07:00:39 +00:00
github-actions[bot]
6ffc8a547f 👥 Update FastAPI People (#2454)
Co-authored-by: github-actions <github-actions@github.com>
2020-12-01 19:12:45 +01:00
Sebastián Ramírez
51e920e2fc 🔖 Release version 0.62.0 2020-11-29 19:36:38 +01:00
Sebastián Ramírez
c27b9dcf9d 📝 Update release notes, add breaking changes details 2020-11-29 19:35:10 +01:00
Sebastián Ramírez
c7e137c6e0 📝 Update release notes 2020-11-29 19:17:35 +01:00
github-actions
7e4d7fe895 📝 Update release notes 2020-11-29 18:04:51 +00:00
Sebastián Ramírez
2c57ea57bf 🔧 Update TestDriven link to course in sponsors (#2435) 2020-11-29 19:04:27 +01:00
Sebastián Ramírez
be7d15ce3a 📝 Update release notes 2020-11-29 18:55:48 +01:00
github-actions
afc2bb0801 📝 Update release notes 2020-11-29 17:32:46 +00:00
Sebastián Ramírez
313bbe802f Add support for shared/top-level parameters (dependencies, tags, etc) (#2434)
*  Add Default and DefaultPlaceholder data structures

to handle defaults and overrides

*  Add utils to get values by priority handling DefaultPlaceholders

*  Add support for top-level parameters in FastAPI, APIRouter, include_router

including: prefix, tags, dependencies, deprecated, include_in_schema, responses, default_response_class, callbacks

* ♻️ Update openapi utils to handle DefaultPlaceholder for response_class

* 📝 Update bigger-application example code to use top-level params

and showcase them in APIRouter, FastAPI, include_router

* 📝 Update docs for Bigger Applications, include diagrams, top-level params

* 🔥 Simplify code and docs for callbacks as default_response_class is no longer required

* 📝 Add docs for top-level dependencies, in FastAPI()

* 📝 Add docs reference to top-level dependencies in docs for decorator

*  Update/increase tests for Bigger Applications including shared parameters

*  Add tests for top-level dependencies in FastAPI()

*  Add tests for internal DefaultPlaceholder

*  Update/increase tests for callbacks with top-level parameters

*  Add LOTS of tests covering branches and cases for shared parameters

in top-level FastAPI, path operations, include_router, APIRouter, its path operations, nested include_router, nested APIRouter, and its path operations

* 🎨 Format/reorder parameters for consistency in FastAPI, APIRouter, include_router
2020-11-29 18:32:18 +01:00
github-actions
d550738fa2 📝 Update release notes 2020-11-25 17:48:13 +00:00
atsumi
cc99e23e82 🌐 Add Japanese translation for Advanced - Custom Response (#2193)
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-25 18:47:45 +01:00
github-actions
dbdcf86a11 📝 Update release notes 2020-11-25 17:46:45 +00:00
Spaceack
2434980968 🌐 Add Chinese translation for Benchmarks (#2119) 2020-11-25 18:35:39 +01:00
github-actions
ee27f7790f 📝 Update release notes 2020-11-25 17:35:19 +00:00
Xie Wei
d2cc2627ba 🌐 Add Chinese translation for Tutorial - Body - Nested Models (#1609)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-25 18:34:50 +01:00
github-actions
f6a285c13c 📝 Update release notes 2020-11-25 17:28:00 +00:00
Ikkyu
8af0b136b1 🌐 Add Chinese translation for Advanced - Custom Response (#1459)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-25 18:27:34 +01:00
github-actions
159a61d2b0 📝 Update release notes 2020-11-25 17:23:01 +00:00
Ikkyu
94fe5495fa 🌐 Add Chinese translation for Advanced - Return a Response Directly (#1452)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-25 18:22:34 +01:00
github-actions
8cc3ac1329 📝 Update release notes 2020-11-25 17:16:53 +00:00
Ikkyu
6b49f67d11 🌐 Add Chinese translation for Advanced - Additional Status Codes (#1451)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-25 18:16:20 +01:00
github-actions
9972b76efa 📝 Update release notes 2020-11-25 17:12:26 +00:00
Ikkyu
410da16a14 🌐 Add Chinese translation for Advanced - Path Operation Advanced Configuration (#1447)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-25 18:11:59 +01:00
github-actions
8997f96540 📝 Update release notes 2020-11-25 17:07:41 +00:00
Ikkyu
b8331b13d7 🌐 Add Chinese translation for Advanced User Guide - Intro (#1445)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-25 18:07:17 +01:00
github-actions
7a3c244c07 📝 Update release notes 2020-11-25 16:40:33 +00:00
Sebastián Ramírez
7a692d2c7b 🍱 Update sponsor logos (#2418) 2020-11-25 17:40:07 +01:00
github-actions
b53c443a06 📝 Update release notes 2020-11-10 19:52:19 +00:00
Sebastián Ramírez
7d7289aeb8 💚 Fix disabling install of Material for MkDocs Insiders in forks, strike 1 (#2340) 2020-11-10 20:51:56 +01:00
github-actions
24b638faf6 📝 Update release notes 2020-11-10 19:38:22 +00:00
Sebastián Ramírez
2561a17225 🐛 Fix disabling Material for MkDocs Insiders install in forks (#2339) 2020-11-10 20:37:55 +01:00
github-actions
d8cfa8ac87 📝 Update release notes 2020-11-10 19:25:07 +00:00
Sebastián Ramírez
76083559f0 Add silver sponsor WeTransfer (#2338) 2020-11-10 20:24:42 +01:00
github-actions
df56655361 📝 Update release notes 2020-11-08 17:27:00 +00:00
Louis Guitton
2e67f2fa6d 📝 Add FastAPI monitoring blog post to External Links (#2324)
https://github.com/tiangolo/fastapi/issues/1828#issuecomment-723541832
2020-11-08 18:26:34 +01:00
github-actions
ac073b2f5f 📝 Update release notes 2020-11-08 11:43:23 +00:00
Sebastián Ramírez
4bcdbc5673 Set up and enable Material for MkDocs Insiders for the docs (#2325)
* ⬆️ Upgrade Material for MkDocs

* ⬆️ Install Material for MkDocs Insiders on CI

* 🔧 Update MkDocs configs to use Material for MkDocs Insiders

*  Use the lightbulb because it looks nice 💡

* 💚 Fix GitHub Action workflow syntax for building docs

* 🐛 Fix GitHub Actions workflow syntax, strike one 
2020-11-08 12:42:55 +01:00
github-actions
97adeca0a4 📝 Update release notes 2020-11-07 20:48:48 +00:00
Sebastián Ramírez
ac99792762 Add Discord chat (#2322)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2020-11-07 21:48:25 +01:00
github-actions
d01e0a10d8 📝 Update release notes 2020-11-07 18:55:35 +00:00
Sebastián Ramírez
de0f466ef8 ✏️ Fix typo in Deta tutorial (#2320) 2020-11-07 19:55:12 +01:00
Sebastián Ramírez
77f7447ee8 📝 Update release notes 2020-11-06 00:14:52 +01:00
github-actions
48827eb7fc 📝 Update release notes 2020-11-05 23:13:28 +00:00
Sebastián Ramírez
5786d2ef78 📝 Fix image links for sponsors (#2304) 2020-11-06 00:13:04 +01:00
Sebastián Ramírez
166088775a 🔖 Release version 0.61.2 2020-11-06 00:04:32 +01:00
Sebastián Ramírez
1052914c20 📝 Update release notes 2020-11-06 00:03:52 +01:00
github-actions
7bdc86b6b4 📝 Update release notes 2020-11-05 22:53:41 +00:00
Camila Gutierrez
733218f199 ✏️ Fix typo in Tutorial - Path Parameters (#2231) 2020-11-05 23:53:10 +01:00
github-actions
3fb6d2982f 📝 Update release notes 2020-11-05 22:52:49 +00:00
David Dobrinskiy
b323726d86 ✏ Fix a stylistic error in docs (#2206) 2020-11-05 23:52:17 +01:00
github-actions
2db2381b68 📝 Update release notes 2020-11-05 22:51:01 +00:00
atsumi
d31648c82e 🌐 Add Japanese translation for Advanced Tutorial - Response Directly (#2191)
* Add Japanese translation for Advanced - response-directly

* Apply suggestions from code review

Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>

Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-05 23:50:38 +01:00
github-actions
e6c2343691 📝 Update release notes 2020-11-05 22:45:29 +00:00
谭九鼎
ab0379ee52 ✏ Fix capitalizaiton typo in docs (#2204) 2020-11-05 23:44:56 +01:00
github-actions
790fa217f7 📝 Update release notes 2020-11-05 22:42:49 +00:00
Ammar Asmro
b892b5e028 ✏ Fix typo in docs (#2179) 2020-11-05 23:42:07 +01:00
github-actions
39eedb31f7 📝 Update release notes 2020-11-05 22:39:33 +00:00
谭九鼎
8355832c7c 📝 Update/fix links in docs to use HTTPS (#2165)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-05 23:39:09 +01:00
github-actions
5821ea8a69 📝 Update release notes 2020-11-05 22:34:08 +00:00
nukopy
3dbdc74366 ✏ Fix typos and add rewording in docs (#2159)
* docs: fix typo in chapter "Request Body" in "Tutorial - User Guide"

* docs: modify a sentence in chapter "Query Parameters and String Validations" in "Tutorial - User Guide"

* docs: fix two grammatical mistakes in chapter "Path Parameters and Numeric Validations" in "Tutorial - User Guide"
2020-11-05 23:33:06 +01:00
github-actions
939acef803 📝 Update release notes 2020-11-05 22:31:20 +00:00
nukopy
22a5960d36 📝 Fix code consistency in examples for Tutorial - User Guide - Path Parameters (#2158) 2020-11-05 23:30:09 +01:00
github-actions
8c5efe0b4b 📝 Update release notes 2020-11-05 22:29:07 +00:00
Teofilo Zosa
730ded2870 📝 Fix renamed parameter content_type typo (#2135) 2020-11-05 23:26:28 +01:00
github-actions
1a000d7e5f 📝 Update release notes 2020-11-05 22:24:33 +00:00
Taki Komiyama
104ee630fc 📝 Add Japanese translation for Tutorial - Security - First Steps (#2153)
Co-authored-by: atsumi <atsumi.tatsuya@gmail.com>
Co-authored-by: T. Tokusumi <41147016+tokusumi@users.noreply.github.com>
2020-11-05 23:24:05 +01:00
github-actions
ea69c373ac 📝 Update release notes 2020-11-05 22:21:54 +00:00
Teofilo Zosa
9118749128 ✏ Fix minor typos in docs (#2122) 2020-11-05 23:20:55 +01:00
github-actions
87ad6a46e8 📝 Update release notes 2020-11-05 22:14:40 +00:00
Adrian
75c64b6e4c ✏ Fix typos in docs and source examples (#2102)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-05 23:14:17 +01:00
github-actions
ccd3b97f03 📝 Update release notes 2020-11-05 22:03:04 +00:00
Nutchanon Ninyawee
074d39fa17 ✏ Fix incorrect Celery URLs in docs (#2100) 2020-11-05 23:02:07 +01:00
github-actions
f1419322b3 📝 Update release notes 2020-11-05 21:58:33 +00:00
John Riebold
b8e6d18385 📌 Relax Swagger UI version pin (#2089) 2020-11-05 22:57:16 +01:00
github-actions
82a1300257 📝 Update release notes 2020-11-05 21:56:17 +00:00
Aaron Christianson
13d9de4a49 📝 Simplify intro to Python Types, all currently supported Python versions include type hints 🎉 (#2085) 2020-11-05 22:53:44 +01:00
github-actions
f931dd0717 📝 Update release notes 2020-11-05 21:44:18 +00:00
Sebastián Ramírez
24d2226326 Fix tags's declare (#2054) 2020-11-05 22:43:28 +01:00
github-actions
0c895f1eaf 📝 Update release notes 2020-11-05 21:42:54 +00:00
hitrust
c041c52d91 📝 Fix example code with sets in Tutorial - Body - Nested Models 2 (#2053) 2020-11-05 22:41:45 +01:00
github-actions
cc9e6b3484 📝 Update release notes 2020-11-05 21:39:59 +00:00
hitrust
dfcc6bc154 📝 Fix example code with sets in Tutorial - Body - Nested Models (#2052) 2020-11-05 22:38:59 +01:00
github-actions
7e708f7411 📝 Update release notes 2020-11-05 21:32:20 +00:00
Alejo Carballude
e09646441d ✏ Fix typo in Benchmarks (#1995) 2020-11-05 22:31:38 +01:00
github-actions
1631f981af 📝 Update release notes 2020-11-05 21:22:25 +00:00
Yurii Karabas
4ce18167e7 🐛 Fix bug overriding custom HTTPException and RequestValidationError from exception_handlers (#1924) 2020-11-05 22:21:40 +01:00
github-actions
a676899557 📝 Update release notes 2020-11-05 21:10:35 +00:00
Marcelo Trylesinski
b299792ebf ✏️ Fix typo on dependencies utils and cleanup unused variable (#1912) 2020-11-05 22:09:17 +01:00
github-actions
9fcec3abe9 📝 Update release notes 2020-11-05 21:05:15 +00:00
Daniel Murrell
5df00f3ec4 📝 Add note in CORS tutorial about allow_origins with ["*"] and allow_credentials (#1895) 2020-11-05 22:03:45 +01:00
github-actions
20ba6e8b97 📝 Update release notes 2020-11-05 20:51:04 +00:00
Sebastián Ramírez
a42c690496 📝 Add deployment to Deta, the first gold sponsor 🎉 (#2303)
* 📝 Add docs for sponsors

* 📝 Add docs for deploying on Deta

* 🍱 Add Deta docs screenshots

* ♻️ Refactor and separate deployment docs

* 📝 Update internal docs links to Deployment

* 📝 Update links in Deta tutorial

* 🍱 Update sponsors images

* 🔧 Use sponsors data from YAML

* 📝 Update sponsors in languages docs

*  Update docs generation scripts

*  Update README.md testing

* 📝 Update main README

* 🔧 Update fastapi-people action handling individual sponsors

* ✏️ Fix typos in Deta tutorial
2020-11-05 21:50:37 +01:00
github-actions
bed0f065fa 📝 Update release notes 2020-11-01 21:54:32 +00:00
SwftAlpc
76632fcf24 🌐 Add Japanese translation for Tutorial - Query Parameters and String Validations (#1901)
Co-authored-by: atsumi <atsumi.tatsuya@gmail.com>
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>
2020-11-01 22:54:05 +01:00
github-actions
32a010394f 📝 Update release notes 2020-11-01 21:40:13 +00:00
github-actions[bot]
8d572faa24 👥 Update FastAPI People (#2282)
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-11-01 22:39:51 +01:00
github-actions
f495d98fae 📝 Update release notes 2020-10-25 18:48:12 +00:00
Camila Gutierrez
3702cef08d ✏️ Fix uppercase in Tutorial - Query Parameters (#2245) 2020-10-25 19:47:46 +01:00
github-actions
9474706ec2 📝 Update release notes 2020-10-25 18:46:59 +00:00
Sebastián Ramírez
e1755f4fa6 🔥 Cleanup after upgrade for Docs Previews GitHub Action (#2248)
* 🔧 Upload docs artifacts even on push to avoid breaking Preview Docs

* 🔥 Remove replaced GitHub Action get-artifact

* 🔥 Remove GitHub Action Watch Docs Previews, replaced with Preview Docs

* 🔥 Remove commented backup configs in Preview Docs GitHub Action

* 🔥 Remove no longer needed utils scripts
2020-10-25 19:46:32 +01:00
github-actions
c75c13c3b0 📝 Update release notes 2020-10-25 18:25:55 +00:00
Sebastián Ramírez
8673e1c127 📝 Add articles to External Links (#2247) 2020-10-25 19:25:31 +01:00
github-actions
360868fe25 📝 Update release notes 2020-10-25 18:12:21 +00:00
Sebastián Ramírez
b46b3f00bf 🐛 Fix unzip docs preview in CI (#2246) 2020-10-25 19:12:00 +01:00
github-actions
c6e950dc9c 📝 Update release notes 2020-10-25 17:54:58 +00:00
Sebastián Ramírez
4e74d40736 Add instant docs deploy previews for PRs from forks (#2244)
* 🔥 Disable action Watch Docs Previews

* 🔧 Use predefined name for docs artifacts for previews

*  Add new GitHub Action Comment Docs Preview in PR

* 🔧 Refactor GitHub Action Preview Docs to work as workflow_run using new action to extract where to comment
2020-10-25 18:54:36 +01:00
github-actions
612d114f3a 📝 Update release notes 2020-10-25 11:59:34 +00:00
Sebastián Ramírez
f88ffd1a0b ️ Build docs for languages in parallel in subprocesses to speed up CI (#2242) 2020-10-25 12:59:13 +01:00
github-actions
cdf0f8a933 📝 Update release notes 2020-10-24 11:33:24 +00:00
Sebastián Ramírez
8650dee4bc 🐛 Fix docs order generation for partial translations (#2238) 2020-10-24 13:32:59 +02:00
github-actions
dca9cc3ec5 📝 Update release notes 2020-10-18 20:19:45 +00:00
github-actions[bot]
d6f37b2138 👥 Update FastAPI People (#2202)
Co-authored-by: github-actions <github-actions@github.com>
2020-10-18 22:19:01 +02:00
github-actions
5a13f78078 📝 Update release notes 2020-10-18 20:16:53 +00:00
Sebastián Ramírez
d625963cc5 ♻️ Update FastAPI People GitHub Action to send the PR as github-actions (#2201) 2020-10-18 22:16:12 +02:00
github-actions
142710a0f3 📝 Update release notes 2020-10-18 20:05:19 +00:00
Sebastián Ramírez
47fcacd4d6 🔧 Update FastAPI People GitHub Action config, run monthly (#2199) 2020-10-18 22:04:32 +02:00
github-actions
00104c9259 📝 Update release notes 2020-10-18 19:57:42 +00:00
Sebastián Ramírez
8386e61f17 🐛 Fix FastAPI People GitHub Action Docker dependency, strike 1 (#2198) 2020-10-18 21:57:02 +02:00
github-actions
9b7125f66b 📝 Update release notes 2020-10-18 19:52:30 +00:00
Sebastián Ramírez
68dc9bd5ac 🐛 Fix FastAPI People GitHub Action Docker dependencies (#2197) 2020-10-18 21:51:51 +02:00
github-actions
7a02d862aa 📝 Update release notes 2020-10-18 19:45:51 +00:00
Sebastián Ramírez
479e87e467 🐛 Fix FastAPI People GitHub Action when there's nothing to change (#2196) 2020-10-18 21:45:10 +02:00
github-actions
1ea24e1813 📝 Update release notes 2020-10-18 19:36:23 +00:00
Sebastián Ramírez
492c0924c4 👥 Add new section FastAPI People (#2195)
* 👥 Update FastAPI People

*  Add first version of FastAPI People GitHub action code

* 🐳 Add Docker and configs for the FastAPI People GitHub Action

* 👷 Add GitHub Action workflow for FastAPI People

* 📝 Add FastAPI People to docs

* 💄 Add custom CSSs for FastAPI People
2020-10-18 21:35:42 +02:00
github-actions
048355f01d 📝 Update release notes 2020-10-18 07:05:30 +00:00
Fabio Serrao
fe889f38e8 🌐 Add Portuguese translation for External Links (#1443)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-10-18 09:04:47 +02:00
github-actions
1dd2bc7675 📝 Update release notes 2020-10-18 06:03:03 +00:00
T. Tokusumi
91ffa0ed27 🌐 Add Japanese translation for Tutorial - CORS (#2125)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: atsumi <atsumi.tatsuya@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-10-18 08:02:19 +02:00
github-actions
6ab0f89858 📝 Update release notes 2020-10-18 05:57:45 +00:00
Taki Komiyama
bfc9733660 🌐 Add Japanese translation for Contributing (#2067)
Co-authored-by: atsumi <atsumi.tatsuya@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-10-18 07:57:05 +02:00
github-actions
9c00618710 📝 Update release notes 2020-10-18 05:48:25 +00:00
T. Tokusumi
beedd199e8 🌐 Add Japanese translation for Project Generation (#2050)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-10-18 07:47:45 +02:00
github-actions
ae580deaea 📝 Update release notes 2020-10-18 05:38:53 +00:00
atsumi
e1231eeef1 🌐 Add Japanese translation for Alternatives (#2043)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-10-18 07:38:09 +02:00
github-actions
8a1ebb38e2 📝 Update release notes 2020-10-18 05:30:50 +00:00
Juan Sebastian Avila Rodriguez
e9413f2711 ✏ Fix typo in Spanish tutorial index (#2020) 2020-10-18 07:28:44 +02:00
github-actions
7434d2bec7 📝 Update release notes 2020-10-18 05:26:55 +00:00
Taki Komiyama
f2c565d8e4 🌐 Add Japanese translation for History Design and Future (#2002)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-10-18 07:26:14 +02:00
github-actions
cb55d7cdde 📝 Update release notes 2020-10-17 18:44:24 +00:00
Taki Komiyama
d513680005 🌐 Add Japanese translation for Benchmarks (#1992)
Co-authored-by: atsumi <atsumi.tatsuya@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-10-17 20:43:43 +02:00
github-actions
a5ee4d93d2 📝 Update release notes 2020-10-17 13:56:21 +00:00
SwftAlpc
3a2d4434ce 🌐 Add Japanese translation for Tutorial - Header Parameters (#1935)
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>
2020-10-17 15:55:39 +02:00
github-actions
d1dfc812f1 📝 Update release notes 2020-10-17 13:46:12 +00:00
Sebastián Ramírez
0b76b675db ⬆️ Upgrade GitHub Action Latest Changes (#2190) 2020-10-17 15:45:33 +02:00
github-actions
5a776fbff5 📝 Update release notes 2020-10-17 13:40:03 +00:00
Sebastián Ramírez
7667605520 ⬆️ Upgrade GitHub Action Label Approved (#2189) 2020-10-17 15:39:24 +02:00
github-actions
642762564d 📝 Update release notes 2020-10-17 10:43:35 +00:00
Jéssica Paz
78ead585f8 🌐 Add Portuguese translation for Tutorial - First Steps (#1861)
Co-authored-by: deniscapeto <deniscapeto@gmail.com>
2020-10-17 12:41:44 +02:00
github-actions
48bf243050 📝 Update release notes 2020-10-17 06:43:16 +00:00
Sebastián Ramírez
0e920e6f02 🌐 Add Portuguese translation for Python Types (#1796)
* Portuguese translation python-types

* Change 'dicas de tipo' to 'type hints'
2020-10-17 08:40:31 +02:00
github-actions
afac22dfd2 📝 Update release notes 2020-10-17 06:39:20 +00:00
T. Tokusumi
2836e10e2d 🌐 Add Japanese translation for Help FastAPI (#1692)
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
Co-authored-by: Taki Komiyama <39375566+komtaki@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-10-17 08:38:37 +02:00
github-actions
aa62d9212f 📝 Update release notes 2020-10-17 06:32:39 +00:00
T. Tokusumi
620bffc2b4 🌐 Add Japanese translation for Tutorial - Body (#1683)
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>
2020-10-17 08:31:55 +02:00
github-actions
b56cf6c08f 📝 Update release notes 2020-10-17 06:24:33 +00:00
T. Tokusumi
cead6ba887 🌐 Add Japanese translation for Tutorial - Query Params (#1674)
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>
2020-10-17 08:23:51 +02:00
github-actions
23772f3c49 📝 Update release notes 2020-10-17 06:15:44 +00:00
T. Tokusumi
45304562a6 🌐 Add Japanese translation for tutorial/path-params.md (#1671)
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>
2020-10-17 08:15:05 +02:00
github-actions
3d767008df 📝 Update release notes 2020-10-17 06:09:43 +00:00
T. Tokusumi
5c6811c4ef Add Japanese translation for tutorial/first-steps.md (#1658)
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>
2020-10-17 08:09:01 +02:00
github-actions
25e1a2602d 📝 Update release notes 2020-10-17 06:03:36 +00:00
T. Tokusumi
b6272a36af 🌐 Add Japanese translation for tutorial/index.md (#1656)
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>
2020-10-17 08:02:56 +02:00
github-actions
db91255ede 📝 Update release notes 2020-10-17 05:51:31 +00:00
Fabio Serrao
ab52e1c7e4 🌐 Add translation to Portuguese for Project Generation (#1602)
* Portuguese translation project-generation

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update docs/pt/docs/project-generation.md

* ✏ Fix typo in docs/pt/docs/project-generation.md

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-10-17 07:50:32 +02:00
github-actions
4924d08e7e 📝 Update release notes 2020-10-16 20:35:50 +00:00
Sebastián Ramírez
a7c65271ac 🔧 Update GitHub Action Label Approved, run at 12:00 (#2185) 2020-10-16 22:35:07 +02:00
github-actions
030f1f2ae2 📝 Update release notes 2020-10-16 20:09:35 +00:00
T. Tokusumi
74f13e522b 🌐 Add Japanese translation for Features (#1625)
Co-authored-by: ryusuke.miyaji <bluce826@gmail.com>
Co-authored-by: ryuckel <36391432+ryuckel@users.noreply.github.com>
2020-10-16 22:08:18 +02:00
github-actions
a4f88f74f2 📝 Update release notes 2020-10-16 20:04:38 +00:00
Sebastián Ramírez
3826129b16 👷 Upgrade GitHub Action Latest Changes (#2184) 2020-10-16 22:04:12 +02:00
Sebastián Ramírez
636f06cd6b 📝 Update release notes 2020-10-15 07:26:26 +02:00
hard_coder
c8365bd339 🌐 Initialize new language Korean for translations (#2018) 2020-10-15 07:21:41 +02:00
Sebastián Ramírez
df38e53723 📝 Update release notes 2020-10-11 17:04:21 +02:00
Fabio Serrao
c606407929 🌐 Add Portuguese translation of Deployment (#1374) 2020-10-11 12:46:20 +02:00
github-actions
f59f85d755 📝 Update release notes 2020-10-11 10:41:42 +00:00
Sebastián Ramírez
42bb15de22 👷 Set GitHub Action Label Approved to run daily, not every minute (#2163) 2020-10-11 12:41:16 +02:00
Sebastián Ramírez
e96b002599 📝 Update release notes 2020-10-11 12:06:07 +02:00
github-actions
75b83ce3aa 📝 Update release notes 2020-10-11 10:04:35 +00:00
Sebastián Ramírez
ad5aa33864 🔥 Remove pr-approvals GitHub Action as it's not compatible with forks. Use the new one (#2162)
as it is not compatible with forks
2020-10-11 12:04:04 +02:00
Sebastián Ramírez
952cd736ac 👷 Add GitHub Action Label Approved (#2161) 2020-10-11 11:53:25 +02:00
Sebastián Ramírez
026039cae2 📝 Update release notes 2020-10-11 11:51:49 +02:00
Sebastián Ramírez
e2609dff95 👷 Add GitHub Action Latest Changes (#2160) 2020-10-11 11:50:04 +02:00
hitrust
8486b41349 Fix tags's declare 2020-09-15 14:40:49 +08:00
Sebastián Ramírez
e77ea63577 🔖 Release version 0.61.1 2020-08-29 16:30:50 +02:00
Sebastián Ramírez
097df92c1c 📝 Update release notes 2020-08-29 16:06:32 +02:00
Brock Friedrich
be669059fb 🎨 Simplify docs hl_lines ranges and standardize 2 spaces between each range (#1863) 2020-08-29 16:02:58 +02:00
Sebastián Ramírez
dfdd371c52 📝 Update release notes 2020-08-29 15:38:44 +02:00
ryuckel
e1e8627168 🌐 Add Japanese translation for index.md (#1571) 2020-08-29 15:34:08 +02:00
Sebastián Ramírez
0916c1c3ef 📝 Update release notes 2020-08-29 14:32:08 +02:00
Facundo Maero
11656f7bd5 ✏ Fix typo in nosql-databases.md (#1980)
Co-authored-by: Facundo Maero <facundo.maero@deepvisionai.com>
2020-08-29 14:30:23 +02:00
Sebastián Ramírez
483d092af8 📝 Update release notes 2020-08-29 14:29:00 +02:00
JulianMaurin
60aa63b68a 🌐 Initialize translations for French (#1975)
Co-authored-by: JulianMaurin <julian.maurin.perso@pm.me>
2020-08-29 14:27:34 +02:00
Sebastián Ramírez
eb547bd4fd 📝 Update release notes 2020-08-29 14:24:24 +02:00
Sebastián Ramírez
0dfde6e284 🐛 Fix issues introduced by removing sqlalchemy safeguard in jsonable_encoder (#1987) 2020-08-29 14:21:00 +02:00
Sebastián Ramírez
2d7038e03e 📝 Update release notes 2020-08-29 11:47:13 +02:00
Yağızcan Değirmenci
4f0a3a9e4d 🌐 Initialize Turkish translations (#1905) 2020-08-29 11:43:29 +02:00
Izabela Guerreiro
1701930c86 Change 'dicas de tipo' to 'type hints' 2020-08-11 10:23:23 -03:00
Sebastián Ramírez
a6897963d5 🔖 Release version 0.61.0 2020-08-09 22:36:47 +02:00
Sebastián Ramírez
c14803e3fa 📝 Update release notes 2020-08-09 22:34:50 +02:00
Sebastián Ramírez
cdba8481c2 🔥 Remove old/unused parameter sqlalchemy_safe from jsonable_encoder (#1864) 2020-08-09 22:32:59 +02:00
Sebastián Ramírez
64ca596a11 📝 Update release notes 2020-08-09 22:19:46 +02:00
Sebastián Ramírez
e1758d107e ⬆ Require Pydantic > 1.0 (#1862)
* 🔥 Remove support for Pydantic < 1.0

* 🔥 Remove deprecated skip_defaults from jsonable_encoder and set default for exclude to None, as in Pydantic

* ♻️ Set default of response_model_exclude=None as in Pydantic

* ⬆️ Require Pydantic >=1.0.0 in requirements
2020-08-09 22:17:08 +02:00
Sebastián Ramírez
3390182fc9 📝 Update release notes 2020-08-09 17:04:35 +02:00
Sebastián Ramírez
912a43ee3d 📝 Add link to TestDriven.io course in docs (#1860) 2020-08-09 17:02:51 +02:00
Sebastián Ramírez
4020304945 📝 Update release notes 2020-08-09 16:43:07 +02:00
Elliana May
0a2fc78fea ✏️ Update docs to remove gender-specific references (#1824)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-09 16:35:44 +02:00
Sebastián Ramírez
b91acfb457 📝 Update release notes 2020-08-09 15:58:58 +02:00
Nik
b9a0179a03 Add support for injecting HTTPConnection (#1827) 2020-08-09 15:56:41 +02:00
Rupsi Kaushik
5ed48ccdc8 Export WebSocketDisconnect and add example handling disconnections to docs (#1822)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-09 15:52:19 +02:00
Sebastián Ramírez
f32d67c8b9 📝 Update release notes 2020-08-09 13:12:09 +02:00
manlix
0752c7242d 🔊 Fix empty log message in docs example about raised exceptions (#1815) 2020-08-09 13:10:33 +02:00
Sebastián Ramírez
be855c696b 📝 Update release notes 2020-08-09 12:56:09 +02:00
Nima Mashhadi M. Reza
da9b5201c4 🔧 Add Flake8 linting (#1774)
Co-authored-by: nimashadix <nimashadix@pop-os.localdomain>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-09 12:54:05 +02:00
Sebastián Ramírez
4daa6ef4e4 📝 Update release notes 2020-08-09 11:08:29 +02:00
Sebastián Ramírez
4ad7c55618 💚 Disable Gitter notification as it's currently broken (#1853)
...no idea why yet. 😔
2020-08-08 20:43:31 +02:00
Sebastián Ramírez
79e08a2541 🔖 Release version 0.60.2 2020-08-08 20:23:16 +02:00
Sebastián Ramírez
1c9c80ba93 📝 Update release notes 2020-08-08 20:21:03 +02:00
Yağızcan Değirmenci
25cb05c876 ✏ Fix documentation typo in Query Parameters and String Validations (#1832) 2020-08-08 20:19:14 +02:00
Sebastián Ramírez
694fbab074 📝 Update release notes 2020-08-08 20:07:03 +02:00
Felix Böhm
2fd28434dd 📝 Add documentation about async tests (pytest-asyncio and httpx) (#1619)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-08 20:01:18 +02:00
Sebastián Ramírez
d15556b152 📝 Update release notes 2020-08-08 09:20:37 +02:00
Sebastián Ramírez
38d8bab770 Raise early when using form data without installing python-multipart (#1851)
* Check if Form exists and multipart is in virtual environment

* Remove unused import

* Move BodyFieldInfo check to separate helper function

* Fix type UploadFile to File for BodyFieldInfo check

* Working solution. Kind of nasty though.

* Use better method of determing if correct package imported

* Use better method of determing if correct package imported

* Add raising exceptions, update error messages

* Check if Form exists and multipart is in virtual environment

* Move BodyFieldInfo check to separate helper function

* Fix type UploadFile to File for BodyFieldInfo check

* Use better method of determing if correct package imported

* Add raising exceptions, update error messages
* Removed unused import, added comments

Co-authored-by: Christopher Nguyen <chrisngyn99@gmail.com>

* Updated what kind of exception will be thrown

* Add type annotations

Adds annotations to is_form_data

* Fix import order

* Add basic tests

* Fixed Travis tests

* Replace logging with fastapi logger

* Change AttributeError to ImportError to fix exception handling

* Fixing tests

* Catch ModuleNotFoundError first

Fix code coverage

* Update fastapi/dependencies/utils.py

Remove error spaces when printing

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Update fastapi/dependencies/utils.py

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Removed spaces in error printing

* ♻️ Refactor form data detection

*  Update/increase tests for incorrect multipart install

* 🔥 Remove deprecated Travis (moved to GitHub Actions)

Co-authored-by: yk396 <yk396@cornell.edu>
Co-authored-by: Christopher Nguyen <chrisngyn99@gmail.com>
Co-authored-by: Kai Chen <kaichen120@gmail.com>
Co-authored-by: Chris N <hello@chris-nguyen.me>
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2020-08-08 09:14:10 +02:00
Sebastián Ramírez
52f0f8657e 📝 Update release notes 2020-08-03 19:28:49 +02:00
Sebastián Ramírez
aedf5c895a 👷 Re-enable Gitter releases bot (#1831) 2020-08-03 19:28:02 +02:00
Sebastián Ramírez
117f9e4abe 📝 Update release notes 2020-08-03 18:38:27 +02:00
s2s
604fea9fc1 📝 Add link in sql-databases.md tutorial to async-sql-databases.md in advanced section. (#1813)
* Add link in sql-databases.md tutorial section to async-sql-databases.md in advanced section.

* 🎨 Update note format

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-03 18:37:02 +02:00
Sebastián Ramírez
994bfd4591 📝 Update release notes 2020-08-03 18:27:03 +02:00
Eduard Iskandarov
02722923b1 ✏ Fix documentation typo in behind a proxy tutorial (#1807) 2020-08-03 18:25:01 +02:00
Sebastián Ramírez
d63a93429b 📝 Update release notes 2020-08-03 18:14:15 +02:00
Izabela Guerreiro
b93e216dc7 ✏ Fix typo in portuguese docs (#1795) 2020-08-03 18:12:30 +02:00
Sebastián Ramírez
95a29b6e67 📝 Update release notes 2020-08-03 18:05:05 +02:00
Sebastián Ramírez
272f01a153 🌐 Add Ukrainian language setup, without index translation (#1830) 2020-08-03 18:04:05 +02:00
Sebastián Ramírez
1a345ae7fc 📝 Update release notes 2020-08-03 17:41:50 +02:00
Marcelo Trylesinski
c5c138b8eb 📝 Update external links (#1786)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-03 17:39:48 +02:00
Sebastián Ramírez
da20e33414 📝 Update release notes 2020-08-03 17:26:12 +02:00
Henry Betts
7fbe3737bc 🐛 Fix encoding a Pydantic model that inherits from another with json_encoders (#1769) 2020-08-03 17:24:29 +02:00
Sebastián Ramírez
f63cec9c95 📝 Update release notes 2020-08-03 15:32:03 +02:00
Nima Mashhadi M. Reza
3063ad83ec Simplify and improve jsonable_encoder (#1754)
Co-authored-by: nimashadix <nimashadix@pop-os.localdomain>
2020-08-03 15:30:23 +02:00
Sebastián Ramírez
78680e5bee 📝 Update relase notes 2020-08-03 15:19:33 +02:00
Yurii Karabas
55b9faeb48 ♻ Simplify code syntax in several places (#1753)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-03 15:16:51 +02:00
Sebastián Ramírez
72645dfeab 📝 Update release notes 2020-08-03 14:30:25 +02:00
Nima Mashhadi M. Reza
3223de5598 🎨 Add typing.Optional to variables that accept None as value (#1731)
Co-authored-by: nimashadix <nimashadix@pop-os.localdomain>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-03 14:29:07 +02:00
Sebastián Ramírez
1afa4e8e75 📝 Update release notes 2020-08-03 13:50:22 +02:00
नवुले पवन कुमार राव
6fd3736da2 📝 Add article: Deploy FastAPI on Azure App Service (#1726) 2020-08-03 13:48:30 +02:00
Sebastián Ramírez
7e043e5e6f 📝 Update release notes 2020-08-03 10:46:33 +02:00
Smart
d1585c42b9 📝 Add external link to starlette docs for WebSocket testing (#1717)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-03 10:45:22 +02:00
Sebastián Ramírez
fc494e3527 📝 Update release notes 2020-08-03 10:34:05 +02:00
Bloodielie
b344cc9415 ♻ Refactor and merge for loops in dependant creation (#1714)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-03 10:32:06 +02:00
Sebastián Ramírez
38b71a9298 📝 Update release notes 2020-08-03 09:55:21 +02:00
Francesco Frassinelli
769ee73240 📝 Add HTML media type to template docs (#1690)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-03 09:53:56 +02:00
Sebastián Ramírez
1df2f14c64 📝 Update release notes 2020-08-03 09:28:03 +02:00
Nils Lindemann
eab9a0e139 ✏ Fix typos and rewording in docs for security (#1678)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-03 09:27:02 +02:00
Sebastián Ramírez
b86ac6739a 📝 Update release notes 2020-08-03 09:13:17 +02:00
Nils Lindemann
9840d9e59d ✏ Fix typos in docs for dependencies (#1675)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-08-03 09:12:07 +02:00
Sebastián Ramírez
0ec52157df 📝 Update release notes 2020-08-03 08:46:50 +02:00
Bar Harel
f1c5330b65 🐛 Fix app.extra type annotation (#1659)
Co-authored-by: bar.harel <bar.harel@biocatch.com>
2020-08-03 08:43:04 +02:00
Sebastián Ramírez
306ec8de04 📝 Update release notes 2020-08-03 08:35:05 +02:00
Adrien Cacciaguerra
6d7c9893d4 ⬆️ Bump mkdocs-material (#1789) 2020-08-03 08:33:43 +02:00
Sebastián Ramírez
6264709054 📝 Update release notes 2020-08-03 08:11:00 +02:00
Sebastián Ramírez
76c2077f47 👷 Update docs previews, remove commit comments (#1826)
as previews use the latest commit from master
2020-08-03 08:09:58 +02:00
Izabela Guerreiro
9cc4428de3 Portuguese translation python-types 2020-07-26 23:00:28 -03:00
Sebastián Ramírez
a63b1efc29 📝 Update release notes 2020-07-22 10:29:49 +02:00
Sebastián Ramírez
9863c3fca8 🐛 Update GitHub action context var for Gitter bot (#1766) 2020-07-22 10:28:27 +02:00
Sebastián Ramírez
6fb97f44cf 📝 Update release notes 2020-07-22 08:47:48 +02:00
Sebastián Ramírez
f64c448329 🔖 Release version 0.60.1 2020-07-22 08:44:44 +02:00
Sebastián Ramírez
df6cbc5ec6 📝 Update release notes 2020-07-22 08:44:13 +02:00
Sebastián Ramírez
0f0af751e4 🔊 Add debugging logs for GitHub actions to introspect GitHub hidden context (#1764) 2020-07-22 08:43:26 +02:00
Sebastián Ramírez
6c9dca55bc 📝 Update release notes 2020-07-22 08:32:22 +02:00
Adrien Cacciaguerra
d71e807401 💄 Use OS preference theme for docs (#1760) 2020-07-22 08:30:12 +02:00
Sebastián Ramírez
7df9ddfe4e 📝 Update release notes 2020-07-22 08:28:31 +02:00
James Alford-Golojuch
4170659359 ⬆ Updates Starlette to version 0.13.6 (#1759)
Co-authored-by: jalfordgolojuch <jalfordgolojuch@activecampaign.com>
2020-07-22 08:25:32 +02:00
Sebastián Ramírez
2940a7fdfa 📝 Update release notes 2020-07-22 08:23:36 +02:00
Sebastián Ramírez
dadd6650ed 📌 Pin Swagger UI temporarily 2020-07-22 08:19:26 +02:00
Sebastián Ramírez
c5a21354af 📝 Update release notes 2020-07-21 23:10:52 +02:00
Sebastián Ramírez
8bafe2a482 🚀 GitHub Actions update, use commit from PR, not pre-merge (#1761)
* 🔥 Remove deploy badge that won't show correctly until next release

after the fixes to the Gitter bot

* 🐛 Fix GitHub Action to upload docs artifacts with commit from PR, not pre-merge

* ♻️ Run zip docs and artifact upload only on PRs
2020-07-21 23:08:14 +02:00
Sebastián Ramírez
42f1716b48 📝 Update release notes 2020-07-20 18:57:01 +02:00
Sebastián Ramírez
6ab2841dbb ♻ Update GitHub actions (#1746)
* 🐛 Fix Gitter notification, use development gitter room until next release

* 🔥 Remove trigger docs preview step from build-docs workflow

as it requires a more privileged token, so it's now triggered by the preview docs watcher

* 🔊 Dump context when building to allow debugging how to refactor the Gitter bot
2020-07-20 18:56:13 +02:00
Sebastián Ramírez
0f54657377 🔖 Release version 0.60.0 2020-07-20 18:26:56 +02:00
Sebastián Ramírez
79e5b36551 📝 Update release notes (#1745)
* 📝 Update release notes

* 📝 Update release notes
2020-07-20 18:22:29 +02:00
Sebastián Ramírez
074868d77e Run watch docs previews every hour 2020-07-20 17:55:02 +02:00
Sebastián Ramírez
3dd16a9458 Fetch artifacts only once in preview docs GitHub action 2020-07-20 17:48:43 +02:00
Sebastián Ramírez
62c23ab5fa 🔒 Use personal access token to trigger docs previews 2020-07-20 17:45:28 +02:00
Sebastián Ramírez
11c05beece 🔊 Add more logging to Watch Preview when artifact is not found 2020-07-20 17:13:27 +02:00
Sebastián Ramírez
7b3ef43127 🐛 Fix Watch Preview Docs GitHub Action, strike 2 2020-07-20 16:59:09 +02:00
Sebastián Ramírez
e0080e5f75 🐛 Fix Watch Previews action 2020-07-20 16:47:48 +02:00
Sebastián Ramírez
e1ba54bd12 🔧 Update Watch Docs Previews GitHub action 2020-07-20 16:35:26 +02:00
Sebastián Ramírez
7032dfb4f1 Add GitHub Action to watch for missing preview docs (#1740)
* 📝 Update release notes

* 🔊 Make curl verbose when triggering docs preview

* 🔧 Update GitHub Actions circus to use commit hash

*  Add PR docs preview watcher
2020-07-20 16:33:17 +02:00
Sebastián Ramírez
14e7f7c1f4 ⬆ Upgrade Deploy to Netlify action 2020-07-19 22:27:32 +02:00
Sebastián Ramírez
9ed6f1e419 🐛 Fix custom GitHub action 2020-07-19 22:22:25 +02:00
Sebastián Ramírez
b268c39758 Add internal GitHub action to deploy docs previews (#1739)
* 📝 Update release notes

*  Add internal GitHub action to pull docs artifact

* 🙈 Add archive.zip to gitignore
2020-07-19 22:11:28 +02:00
Sebastián Ramírez
4dd386b807 🚀 Preview docs for external PRs (#1738)
* 🍱 Save docs zip when building docs

* 🙈 Add docs.zip artifact to .gitignore

* 🚀 Update deploy artifact name

* ♻️ Upload artifact directory

*  Add WIP trigger docs preview

* ♻️ Update trigger docs preview

* 👷 Update env vars for docs preview

* 👷 Update PR extraction

* 👷 Try to show GitHub event

* 💚 Try to see if GitHub context templates is causing the problem

* 💚 Try to debug context GitHub event

* 🔊 Debug GitHub event context

* 👷 Update debugging action

* 👷 Update debug

* 👷 Update Action

* ♻️ Update script to trigger docs preview

* ️ Try to use Zip again to improve speed

* 🔧 Update zip scripts

*  Add preview docs on event

* 🚀 Trigger deploy preview on PRs

* 🐛 Fix trigger script env vars
2020-07-19 20:49:52 +02:00
Sebastián Ramírez
b7251f1654 📝 Update release notes 2020-07-19 14:25:28 +02:00
Sebastián Ramírez
780d3e65ad Add XML coverage report for GitHub Actions (#1737) 2020-07-19 14:24:24 +02:00
Sebastián Ramírez
cc8cac200f 📝 Update release notes 2020-07-19 14:10:51 +02:00
Sebastián Ramírez
e7be5c8ac5 💄 Update badges, remove Travis (#1736)
* 💄 Update badges

* 🔥 Remove Travis
2020-07-19 14:09:55 +02:00
Sebastián Ramírez
8f52864899 📝 Update release notes 2020-07-19 14:04:45 +02:00
Sebastián Ramírez
47a630721a 👷 Add GitHub Actions, move from Travis (#1735) 2020-07-19 14:03:38 +02:00
Sebastián Ramírez
10ae6de111 📝 Update release notes 2020-07-19 12:19:39 +02:00
JAYATI SHRIVASTAVA
2b47f3e56b Add support for adding OpenAPI schema for GET requests with a body (#1626)
* add test for get request body's openapi schema

* 📝 Update docs note for GET requests with body

*  Update test for GET request with body, test it receives the body

* 🔇 Temporary type ignore while it's handled in Pydantic

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-07-19 12:17:50 +02:00
Sebastián Ramírez
d60dd1b60e 🔖 Release version 0.59.0 2020-07-10 20:41:35 +02:00
Sebastián Ramírez
2822f7ca64 📝 Update release notes 2020-07-10 20:32:16 +02:00
tomarv2
ff6afeaf78 ✏ Fix docstring typo for oauth2 utils (#1621) 2020-07-10 20:31:15 +02:00
Sebastián Ramírez
74852d406c 📝 Update release notes 2020-07-10 20:26:29 +02:00
Brian Mboya
921642dc7b 📝 Update JWT docs to use python-jose (#1610)
* 📝 Update JWT docs with python-jose

* 📝 Update format and use python-jose in docs

*  Add Python-jose to dependencies

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-07-10 20:24:38 +02:00
Sebastián Ramírez
5c01d44ee9 📝 Update release notes 2020-07-10 19:46:36 +02:00
Sebastián Ramírez
135704dcc8 🐛 Re-enable search bar after adding markdown-data plugin (#1703) 2020-07-10 19:45:47 +02:00
Sebastián Ramírez
88793bb6c2 📝 Update release notes 2020-07-10 19:34:22 +02:00
Rupsi Kaushik
70a51b3aff Auto-generate OpenAPI servers from root_path (#1596)
* root_path included in servers object instead of path prefix

* ♻️ Refactor implementation of auto-including root_path in OpenAPI servers

* 📝 Update docs and examples for Behind a Proxy, including servers

* 📝 Update Extending OpenAPI as openapi_prefix is no longer needed

*  Add extra tests for root_path in servers and root_path_in_servers=False

* 🍱 Update security docs images with relative token URL

* 📝 Update security docs with relative token URL

* 📝 Update example sources with relative token URLs

*  Update tests with relative tokens

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-07-10 19:28:18 +02:00
Sebastián Ramírez
340a582be7 📝 Update release notes 2020-07-10 14:48:42 +02:00
Sebastián Ramírez
5f66b5466f ✏️ Fix external links typo/link (#1702) 2020-07-10 14:47:56 +02:00
Sebastián Ramírez
d2169ee567 📝 Update release notes 2020-07-10 14:35:28 +02:00
Sebastián Ramírez
a5c03ba1b7 External links in docs with data file (#1701)
*  Add mkdocs-markdownextradata-plugin for docs

* 🔧 Update MkDocs config file(s) to include external data

*  Add external links data file

* 📝 Use external data file in External Links

* ♻️ Update data files for langs

The cost is some duplication 😔, these files are updated by the script, but to be able to serve locally they have to be duplicated

*  Update docs script to copy data files

* 🔥 Remove needed duplication of data files for live docs in translations
2020-07-10 14:31:44 +02:00
Sebastián Ramírez
e4ea6426dc 📝 Update release notes 2020-07-10 12:24:03 +02:00
Davide Fiocco
8bf7cd1dc6 📝 Fix link to edit External Links, add additional link (#1669)
Added a link to the correct link to editing the en docs, plus an additional example (of mine!) which got some buzz on social media:
https://twitter.com/monodavide/status/1276913357388382212
https://madewithml.com/projects/1649/model-serving-using-fastapi-and-streamlit/
2020-07-10 12:21:46 +02:00
Sebastián Ramírez
92feb3ade7 📝 Update release notes 2020-07-10 11:18:28 +02:00
Katherine Bancroft
d0e739d8f2 📝 Add note in docs on order in Pydantic Unions (#1591)
* Add note on order in Unions

* Add an example of Union order

Co-authored-by: kbanc <katherine.bancoft@gmail.com>
2020-07-10 11:16:46 +02:00
Sebastián Ramírez
4efa6bd75e 📝 Update release notes 2020-07-10 11:09:43 +02:00
Sebastián Ramírez
600f15faa0 ✔ Improve support for tests in editor (#1699)
* ♻️ Remove required extra steps to test in editor

* 🎨 Format lint script

* 📝 Remove obsolete extra steps required to test in editor from docs

* 🐛 Fix coverage
2020-07-10 11:08:19 +02:00
Sebastián Ramírez
250fa519f9 📝 Update release notes 2020-07-10 00:16:35 +02:00
Sebastián Ramírez
3c6dafcc8e 📌 Pin dependencies (#1697)
* 📌 Pin dependencies

* 🐛 Fix config in pyproject.toml
2020-07-10 00:15:39 +02:00
Sebastián Ramírez
8447000eee 📝 Update release notes 2020-07-09 20:09:38 +02:00
Brian Mboya
fe453f80ed ⬆ Upgrade isort to version 5.x.x (#1670)
* Update isort script to match changes in the new release, isort v5.0.2

* Downgrade isort to version v4.3.21

* Add an alternative flag to --recursive in isort v5.0.2

* Add isort config file

* 🚚 Import from docs_src for tests

* 🎨 Format dependencies.utils

* 🎨 Remove isort combine_as_imports, keep black profile

* 🔧 Update isort config, use pyproject.toml, Black profile

* 🔧 Update format scripts to use explicit directories to format

otherwise it would try to format venv env directories, I have several with different Python versions

* 🎨 Format NoSQL tutorial after re-sorting imports

* 🎨 Fix format for __init__.py

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-07-09 20:06:12 +02:00
Sebastián Ramírez
3ff504f03f 🔖 Release version 0.58.1 2020-06-28 23:48:30 +02:00
Sebastián Ramírez
eea9ab6106 📝 Update release notes 2020-06-28 23:43:30 +02:00
Sebastián Ramírez
e9e07c41bb 🎨 Add format, finishing period 2020-06-28 23:42:32 +02:00
Eyitayo Ogunbiyi
17a5e18f46 📝 Add link to all valid pydantic data types (#1612) 2020-06-28 23:40:45 +02:00
Sebastián Ramírez
9148bd8b6f 📝 Update release notes 2020-06-28 23:38:49 +02:00
Dmytro Petruk
39766d0f96 🐛 Fix link in warning logs (#1611)
Co-authored-by: Dmytro Petruk <petruk@ebu.ch>
2020-06-28 23:37:42 +02:00
Sebastián Ramírez
2d9bca56b2 📝 Update release notes 2020-06-28 23:35:21 +02:00
molto
f158d95ce9 📝 Fix bad link in docs (#1603)
Co-authored-by: lookyun <lookyun0504@outlook.com>
2020-06-28 23:34:28 +02:00
Sebastián Ramírez
7a4164ef60 📝 Update release notes 2020-06-28 23:30:22 +02:00
Brian Mboya
f3730a79af 🙈 Add vim temporary files to gitignore (#1590)
Co-authored-by: asheux <brianashiundu000@gmail.com>
2020-06-28 23:28:35 +02:00
Sebastián Ramírez
42eff23a79 📝 Update release notes 2020-06-28 23:27:40 +02:00
Andreas Schlapbach
25bc33350d ✏ Fix typo in sub-applications (#1578) 2020-06-28 23:26:35 +02:00
Sebastián Ramírez
b84d082005 📝 Update release notes 2020-06-28 20:21:38 +02:00
Sebastián Ramírez
1f01ce9615 📝 Use Optional in docs (#1644)
* Updated .py files with Optional tag (up to body_nested_models)

* Update optionals

* docs_src/ all updates, few I was unsure of

* Updated markdown files with Optional param

* es: Add Optional typing to index.md

* Last of markdown files updated with Optional param

* Update highlight lines

* it: Add Optional typings

* README.md: Update with Optional typings

* Update more highlight increments

* Update highlights

* schema-extra-example.md: Update highlights

* updating highlighting on website to reflect .py changes

* Update highlighting for query-params & response-directly

* Address PR comments

* Get rid of unnecessary comment

*  Revert Optional in Chinese docs as it probably also requires changes in text

* 🎨 Apply format

*  Revert modified example

* ♻️ Simplify example in docs

* 📝 Update OpenAPI callback example to use Optional

*  Add Optional types to tests

* 📝 Update docs about query params, default to using Optional

* 🎨 Update code examples line highlighting

* 📝 Update nested models docs to use "type parameters" instead of "subtypes"

* 📝 Add notes about FastAPI usage of None

including:

= None

and

= Query(None)

and clarify relationship with Optional[str]

* 📝 Add note about response_model_by_alias

* ♻️ Simplify query param list example

* 🔥 Remove test for removed example

*  Update test for updated example

Co-authored-by: Christopher Nguyen <chrisngyn99@gmail.com>
Co-authored-by: yk396 <yk396@cornell.edu>
Co-authored-by: Kai Chen <kaichen120@gmail.com>
2020-06-28 20:13:30 +02:00
Sebastián Ramírez
352c5f5ecc 📝 Update release notes 2020-06-28 13:59:20 +02:00
Sebastián Ramírez
e5594e860f Update response_model_by_alias (#1642)
* Make openapi models honor response_model_by_alias

* Add test for response_model_by_alias working with openapi models

*  Revert changes

*  Update and extend tests for response_model_by_alias

*  Revert test name change

* 📌 Pin Pytest and Pytest-Cov

Co-authored-by: Martin Zaťko <martin.zatko@kiwi.com>
2020-06-28 13:58:21 +02:00
Sebastián Ramírez
50926faead 📝 Update release notes 2020-06-27 20:32:34 +02:00
Sebastián Ramírez
a303afc0e5 📝 Update release notes 2020-06-27 20:32:34 +02:00
Sebastián Ramírez
12607e85e3 📝 Update release notes 2020-06-27 20:32:34 +02:00
Xie Wei
38fd363e89 🌐 Add chinese translation for body-fields.md (#1569)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-27 20:29:41 +02:00
Xie Wei
7f62cfd231 🌐 Update Chinese translation for index.md (#1564)
* keep up-to-date with main version

* fix 2 ignored quotes
2020-06-27 20:24:10 +02:00
Xie Wei
c5168bd036 🌐 Add Chinese translation for body-multiple-params.md (#1532)
* add chinese translation for body-multiple-params.md

* improve translations

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-27 20:18:10 +02:00
Sebastián Ramírez
be472c5215 📝 Update release notes 2020-06-27 20:13:07 +02:00
Xie Wei
adac38ecea Add Chinese translation for path-params-numeric-validations.md (#1506)
* add chinese translation for path-params-numeric-validations.md

* improve translations
2020-06-27 20:10:32 +02:00
Sebastián Ramírez
c8b634226e 📝 Update release notes 2020-06-27 20:00:21 +02:00
Sebastián Ramírez
ca4cf7cc70 Add GitHub action to label approved PRs (#1638) 2020-06-27 19:59:10 +02:00
Sebastián Ramírez
b87072bc12 🔖 Release version 0.58.0 2020-06-15 13:18:36 +02:00
Sebastián Ramírez
04e2bfafbc 📝 Update release notes 2020-06-15 13:13:53 +02:00
Sebastián Ramírez
181a32236a Deep merge OpenAPI responses (#1577)
* override successful response

*  Add deep_dict_udpate

*  Merge additional responses with generated responses

* 🍱 Update docs screenshot

Co-authored-by: rkbeatss <rkaus053@uottawa.ca>
2020-06-15 13:12:12 +02:00
Sebastián Ramírez
1f54a8e0a1 📝 Update release notes 2020-06-15 12:42:48 +02:00
Andrew
d63475bb7d 📝 Mention in docs that subapps don't fire events (#1554)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-14 18:25:10 +02:00
Sebastián Ramírez
5a3c5f1523 📝 Update release notes 2020-06-14 18:12:51 +02:00
Andrew
12bc9285f7 🐛 Fix body validation error response, remove variable name when it is not embedded (#1553) 2020-06-14 18:07:39 +02:00
Sebastián Ramírez
31df2ea940 📝 Update release notes 2020-06-14 17:56:12 +02:00
Sebastián Ramírez
50b90dd6a4 📝 Update release notes 2020-06-14 17:55:13 +02:00
Andrew
7dd881334d 🐛 Fix testing security scopes when using dependency overrides (#1549)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-14 17:54:46 +02:00
Vinny Do
530fc8ff3f 🐛 Fix JSON Schema "not" keyword (#1548) 2020-06-14 15:46:49 +02:00
Sebastián Ramírez
ef460b4d23 📝 Update release notes 2020-06-14 15:40:18 +02:00
mikaello
b591de2ace Add support for OpenAPI servers metadata (#1547)
* feat: add servers option for OpenAPI

Closes #872

*  Use dicts for OpenAPI servers

* ♻️ Update OpenAPI Server model to support relative URLs

*  Add tests for OpenAPI servers

* ♻️ Re-order parameter location of servers for OpenAPI

* 🎨 Format code

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-14 15:38:29 +02:00
Sebastián Ramírez
34c857b7cb 🔖 Release version 0.57.0 2020-06-13 23:13:25 +02:00
Sebastián Ramírez
c78bc0c82d 📝 Update release notes 2020-06-13 23:08:20 +02:00
JAYATI SHRIVASTAVA
194446e51a 🔥 Remove broken external link (#1565) 2020-06-13 23:07:11 +02:00
Sebastián Ramírez
777e2151e6 📝 Update release notes 2020-06-13 22:55:30 +02:00
Sebastián Ramírez
5ce5bdba0b 📝 Update release notes 2020-06-13 22:52:59 +02:00
Chih Sean Hsu
e4300769ac 📝 Update tutorial for WebSockets with dependencies (#1540)
* fix websockets/tutorial002.py

* fix tutorial002 in ws to correspond with test case

* reformat websocket tutorial002

* fix websocket tutorial002 coverage

* 📝 Update example for WebSockets with Depends

*  Update and refactor tests for WebSockets with dependencies

* 👷 Trigger Travis, as it's not reporting to Codecov

*  Update WebSocket tests to raise coverage

Co-authored-by: Chih Sean Hsu <Sean@Sean-Mac.local>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 22:51:34 +02:00
retnikt
c6dd627bdd Add support for Python's http.HTTPStatus in status_code (#1534)
* Normalise IntEnums to ints for route status codes

Closes #1349

* add tests for status code enum support

* add docs for status code enum support

* add endpoint test for enum status code

* 📝 Update note about http.HTTPStatus

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 19:40:10 +02:00
Sebastián Ramírez
6576f724bb 📝 Update release notes 2020-06-13 19:22:08 +02:00
Sebastián Ramírez
91a6736d0e 📝 Update release notes 2020-06-13 19:20:48 +02:00
Patrick Wang
8fb755703d When using Pydantic models with __root__ use the internal value in jsonable_encoder (#1524) 2020-06-13 19:20:11 +02:00
Yankee
748bedd37c 📝 Updated docs for path-params (#1521)
* Added response example; URL for quick access; typo fixes

* Added line breaks for readability

* Fix typo on redoc url

* 📝 Update format, links, rewordings

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 19:14:23 +02:00
Sebastián Ramírez
bf58788f29 📝 Update release notes 2020-06-13 18:54:47 +02:00
Yankee
5f78ba4a31 📝 Update docs for first-steps, links, rewordings (#1518)
* ✏️ Typo/readability fixes for first-steps documentation

* 📝 Update link and small rewordings

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 18:53:31 +02:00
Sebastián Ramírez
db9f827263 📝 Update release notes 2020-06-13 18:18:27 +02:00
TiewKH
dd9e94cf21 Enable showCommonExtensions and showExtensions in SwaggerUI (#1466)
* Set showExtensions and showCommonExtensions to true

* Clean up comma

Co-authored-by: tiewkeehui <keehuitiew@airasia.com>
2020-06-13 18:16:34 +02:00
Sebastián Ramírez
e482d74241 📝 Update release notes 2020-06-13 18:13:06 +02:00
Richard Hoekstra
bd2acbcabb Export OAuth2PasswordRequestFormStrict from security (#1462)
* Update __init__.py

Fixes an import error:     

from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestFormStrict
ImportError: cannot import name 'OAuth2PasswordRequestFormStrict'

* Simplify import of OAuth2PasswordRequestFormStrict

* Simplify import of OAuth2PasswordRequestFormStrict
2020-06-13 18:08:08 +02:00
Sebastián Ramírez
f913d469a8 📝 Update release notes 2020-06-13 18:05:22 +02:00
Roman Tezikov
66cb266641 📝 Add docs for default_response_class (#1455)
*  Add docs to default_response_class

*  create a tip

*  fixing the tip

* 🚑 grammar

* 📝 Update docs for default response class

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 18:02:45 +02:00
Sebastián Ramírez
74954894c5 📝 Update release notes 2020-06-13 15:26:42 +02:00
William Hayes
ceedfccde0 📝 Document additional parameters for response_model (#1427)
* Documented additional parameters

These are included in a recent PR (https://github.com/tiangolo/fastapi/pull/1166) but not in the docs yet.
* response_model_exclude_none
* response_model_exclude_defaults

* 📝 Update note about response_model_exclude_defaults and response_model_exclude_none

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 15:23:29 +02:00
Sebastián Ramírez
2ee0eedf23 📝 Update release notes 2020-06-13 15:08:10 +02:00
Koudai Aono
c0f3019764 📝 Add PyCharm Pydantic plugin to docs (#1420)
* add pydantic pycharm plugin in document

* 📝 Update PyCharm Pydantic plugin note

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 15:05:59 +02:00
Sebastián Ramírez
dd6d0cb23c 📝 Update release notes 2020-06-13 14:51:21 +02:00
Chen Rotem Levy
fe15620df3 🎨 Update and clarify testing function name (#1395)
test_create_existing_token -> test_create_existing_item
2020-06-13 14:50:14 +02:00
Sebastián Ramírez
6af857f206 📝 Update release notes 2020-06-13 14:47:03 +02:00
obataku
7ce756f9dd 🐛 Fix duplicated headers set by indirect dependencies (#1386)
* Added test for repeating cookies in response headers

* update `response` headers, status code to match `sub_response` in `solve_dependencies` only if necessary; fix formatting of scottsmith2gmail's test

* restore code coverage, remove dead code from `solve_dependencies`

Co-authored-by: Scott Smith <scott.smith.2@gmail.com>
2020-06-13 14:44:51 +02:00
Sebastián Ramírez
c0b1fddb31 📝 Update release notes 2020-06-13 14:39:58 +02:00
Nick Rushton
9aea85a84e ⬆ Upgrade Starlette dependency to 0.13.4 (#1361) 2020-06-13 14:38:08 +02:00
Sebastián Ramírez
fddd1c12de 📝 Update release notes 2020-06-13 14:36:27 +02:00
Aviram Hassan
b13a4baf32 Add better JSON decode error handling, improve feedback for client after invalid JSON requests (#1354)
* Request body error, raise RequestValidationError instead of HTTPException in case JSON decode failure

* add missing test case for body general exception
2020-06-13 14:33:27 +02:00
Sebastián Ramírez
5ffa18f10f 📝 Update release notes 2020-06-13 14:06:12 +02:00
Sebastián Ramírez
828915baf5 📝 Update Tags metadata title 2020-06-13 14:02:58 +02:00
Thomas Maschler
a071ddf3cd Add support for tag metadata in OpenAPI (#1348)
* Allow to add OpenAPI tag descriptions

* fix type hint

* fix type hint 2

* refactor test to assure 100% coverage

* 📝 Update tags metadata example

* 📝 Update docs for tags metadata

*  Move tags metadata test to tutorial subdir

* 🎨 Update format in applications

* 🍱 Update docs UI image based on new example

* 🎨 Apply formatting after solving conflicts

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 13:58:06 +02:00
Sebastián Ramírez
3651b8a30f 📝 Update release notes 2020-06-13 12:27:00 +02:00
Sebastián Ramírez
0d73b9ff1c 🔧 Add basic setup for Russian translations (#1566) 2020-06-13 12:26:15 +02:00
Sebastián Ramírez
43235cf236 📝 Update release notes 2020-06-13 09:47:36 +02:00
Xie Wei
269a155583 🔥 Remove obsolete Chinese articles after translations (#1510) 2020-06-13 09:45:48 +02:00
Sebastián Ramírez
12433d51dd 📝 Update release notes 2020-06-13 01:25:29 +02:00
Rupsi Kaushik
3699e17212 Implement __repr__ methods for path parameters to simplify debugging (#1560)
* repr description added to Depends class

* repr description added to Security subclass

* get rid of __repr__ in security since it will inherit from super

* make code format consistent with rest

* add desc for rest of the classes

* Update fastapi/params.py

remove trailing whitespace

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>

* Implement __repr__

* fix formatting

* formatting again

* ran formatting

* added basic testing

* basic tests added to rest of the classes

* added more test coverage and simplified test file

Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
Co-authored-by: Jayati Shrivastava <gaurijove@gmail.com>
2020-06-13 01:22:30 +02:00
Sebastián Ramírez
8231fbede4 🔖 Release version 0.56.1 2020-06-13 01:17:06 +02:00
Sebastián Ramírez
50bc14b835 📝 Update release notes 2020-06-13 01:14:58 +02:00
Kai Chen
4310c89c83 📝 Add link to Advanced User Guide: response status code (#1512) 2020-06-13 01:12:59 +02:00
Sebastián Ramírez
d39dd06a22 📝 Update release notes 2020-06-13 00:57:34 +02:00
kota matsuoka
a0ab47e89e 🎨 Remove unused f-string (#1526) 2020-06-13 00:56:00 +02:00
Sebastián Ramírez
5cbcb9a965 📝 Update release notes 2020-06-13 00:55:30 +02:00
Xie Wei
801ceaec80 🌐 Add Chinese translation for query-params-str-validations.md (#1500)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 00:53:00 +02:00
Sebastián Ramírez
c7334ae9f8 📝 Update release notes 2020-06-13 00:50:22 +02:00
Xie Wei
d737599a2c 🌐 Add Chinese translation for body.md (#1492)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 00:47:50 +02:00
Sebastián Ramírez
d2d72a8e4a 📝 Update release notes 2020-06-13 00:43:07 +02:00
Xie Wei
7895c12fa1 🌐 Add Chinese translation for help-fastapi.md (#1465)
* add chinese translation for help-fastapi.md

* improve translations

Co-authored-by: Waynerv <wei.xie@woqutech.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 00:40:05 +02:00
Sebastián Ramírez
5f6a14c413 📝 Update release notes 2020-06-13 00:29:43 +02:00
Xie Wei
2b4e88fa98 🌐 Add Chinese translation for query-params.md (#1454)
Co-authored-by: Waynerv <wei.xie@woqutech.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 00:26:40 +02:00
Sebastián Ramírez
11723bca27 📝 Update release notes 2020-06-13 00:21:53 +02:00
Xie Wei
b49517a64f 🌐 Add Chinese translation for contributing.md (#1460)
Co-authored-by: Waynerv <wei.xie@woqutech.com>
2020-06-13 00:18:57 +02:00
Sebastián Ramírez
f910e0c96c 📝 Update release notes 2020-06-13 00:18:20 +02:00
Xie Wei
c1ba2a3127 🌐 Add Chinese translation for path-params.md (#1453)
* add chinese translation for path-params.md

* improve translations

* improve translations

Co-authored-by: Waynerv <wei.xie@woqutech.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-13 00:14:58 +02:00
Sebastián Ramírez
28396173c7 📝 Update release notes 2020-06-13 00:09:41 +02:00
Kabir Khan
69974b792e 📝 Add cookiecutter-spacy-fastapi to docs (#1390) 2020-06-13 00:06:53 +02:00
Sebastián Ramírez
352412a3cb 📝 Update release notes 2020-06-12 23:46:05 +02:00
yaegassy
745ab48d65 📝 Add docs in Python Types for Optional (#1377)
* docs: Fix pydantic example in python-types.md

* 📝 Update Python Types Intro to include Optional

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-12 23:44:23 +02:00
Sebastián Ramírez
4a5cda0d77 📝 Update release notes 2020-06-12 23:00:09 +02:00
Micah Rosales
b90bf2da9e 🐛 Fix callable class generator dependencies (#1365)
* Fix callable class generator dependencies

* workaround to support asynccontextmanager backfill for pre python3.7

Co-authored-by: Micah Rosales <mrosales@users.noreply.github.com>
2020-06-12 22:57:59 +02:00
Sebastián Ramírez
a552cbdf59 📝 Update release notes 2020-06-12 22:47:37 +02:00
Dylan Anthony
2351fb5623 🔇 Remove error log when parsing malformed JSON body as it's a client error (#1351) 2020-06-12 22:44:40 +02:00
Sebastián Ramírez
807522c616 📝 Update release notes 2020-06-12 22:42:40 +02:00
Xie Wei
81a529c251 🌐 Translate doc first steps to Chinese (#1323)
* WIP:add Chinese translation for first steps doc

* add Chinese translation for first steps doc

* improve translations

Co-authored-by: Waynerv <wei.xie@woqutech.com>
2020-06-12 22:39:26 +02:00
Sebastián Ramírez
7efc15aeef 📝 Update release notes 2020-06-12 22:37:34 +02:00
Nik
d66d8379c0 🐛 Fix OpenAPI generation when using callbacks with routers including Pydantic models (#1322)
* drop model class from additional responses when generating openapi

* ♻️ Copy response to be mutated early in get_openapi_path

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-12 22:35:59 +02:00
Sebastián Ramírez
5a00467951 📝 Update release notes 2020-06-12 22:01:22 +02:00
Kazantcev Andrey
434d32b891 Optimize regexp pattern in get_path_param_names (#1243) 2020-06-12 21:59:32 +02:00
Sebastián Ramírez
535247ffc4 📝 Update release notes 2020-06-12 21:43:17 +02:00
Pankaj Giri
7e2518350a 📝 Remove *, from functions where it's not needed #1234 (#1239)
* Fix for - [FEATURE] Remove *, where it's not needed #1234

* 🔥 Remove unnecessary arg *,

* 🎨 Update docs format highlight lines

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-12 21:41:44 +02:00
Sebastián Ramírez
1b2a7546af 📝 Update release notes 2020-06-12 18:58:15 +02:00
Cesare De Cal
2d9bb64047 🌐 Generated new translation directory to support Italian docs (#1557)
* Generated new translation directory to support Italian docs

* ⬆️ Upgrade/pin pytest to >= 5.4.3

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-12 18:53:52 +02:00
Sebastián Ramírez
072c2bc7f9 🔖 Release version 0.56.0 2020-06-12 00:22:17 +02:00
Sebastián Ramírez
da7826b0eb 📝 Update release notes 2020-06-12 00:05:17 +02:00
Ingmar Steen
2f478eeca6 Add support for ASGI root_path for openapi docs (#1199)
* Use ASGI root_path when it is provided and openapi_prefix is empty.

* Strip trailing slashes from root_path.

* Please mypy.

* Fix extending openapi test.

* 📝 Add docs and tutorial for using root_path behind a proxy

* ♻️ Refactor application root_path logic, use root_path, deprecate openapi_prefix

*  Add tests for Behind a Proxy with root_path

* ♻️ Refactor test

* 📝 Update/add docs for Sub-applications and Behind a Proxy

* 📝 Update Extending OpenAPI with openapi_prefix parameter

*  Add test for deprecated openapi_prefix

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-06-11 23:53:19 +02:00
Sebastián Ramírez
543ef7753a 📝 Update release notes 2020-06-07 22:02:36 +02:00
Sebastián Ramírez
88a887329e 📝 Update help and issue templates (#1531)
* 📝 Update help docs: Gitter, issues, links

also fix Gitter tab padding

* 📝 Update new GitHub issue templates

* 📝 Add note about extra help required for new issues
2020-06-07 22:00:15 +02:00
Sebastián Ramírez
8cfe254400 📝 Update release notes 2020-06-05 17:35:39 +02:00
Sebastián Ramírez
bfd46e562b 🔧 Update issue-manager GitHub action (#1520) 2020-06-05 17:34:43 +02:00
Sebastián Ramírez
a0e4d38bea 📝 Update release notes 2020-05-24 08:48:52 +02:00
Sebastián Ramírez
b0414b9929 📝 Add new links (#1467)
* 📝 Update opinions including Netflix and add format

* 📝 Add new external links

* 📝 Update README
2020-05-24 08:48:09 +02:00
Sebastián Ramírez
3b4413f9f5 📝 Update release notes 2020-05-24 07:47:19 +02:00
Xie Wei
374cdf29a9 🌐 Add Chinese translation for docs/python-types.md (#1197)
* Add Chinese tranlation for docs/python-types.md

* improve translation
2020-05-24 07:43:26 +02:00
Sebastián Ramírez
8d844bc5cf 🔖 Release version 0.55.1 2020-05-23 18:59:14 +02:00
Sebastián Ramírez
1092261ae1 📝 Update release notes 2020-05-23 18:59:14 +02:00
Sebastián Ramírez
5984233223 🐛 Fix Enum handling with their own schema definitions (#1463)
* 🐛 Fix extra support for enum with its own schema

*  Fix/update test for enum with its own schema

* 🐛 Fix type declarations

* 🔧 Update format and lint scripts to support locally installed Pydantic and Starlette

* 🐛 Add temporary type ignores while enum schemas are merged
2020-05-23 18:56:18 +02:00
Sebastián Ramírez
98bb9f13da 🔖 Release version 0.55.0 2020-05-23 16:06:32 +02:00
Sebastián Ramírez
d375dc6ebe 📝 Update release notes 2020-05-23 16:06:32 +02:00
Sebastián Ramírez
ee335bca82 Add test to support Enums with their own re-usable schema (#1461) 2020-05-23 16:04:25 +02:00
Sebastián Ramírez
601d8eb809 📝 Update release notes 2020-05-17 16:04:35 +02:00
Sebastián Ramírez
b99f350a18 📝 Add links to GitHub sponsors 💸 (#1425)
* 📝 Add links to GitHub sponsors

* ✏ Update link to sponsors
2020-05-17 16:03:53 +02:00
Sebastián Ramírez
c1b0e796c6 📝 Update release notes 2020-05-17 13:51:46 +02:00
retnikt
d9e65147c7 ✏ Fix minor erratum in Question issue template (#1344) 2020-05-17 13:50:42 +02:00
Sebastián Ramírez
6001513c4f 📝 Update release notes 2020-05-17 13:50:05 +02:00
Stavros Korokithakis
3fa033d8d5 📝 Add warning about storing user passwords (#1336) 2020-05-17 13:48:05 +02:00
Sebastián Ramírez
59f7e66ac3 📝 Update release notes 2020-05-17 13:41:12 +02:00
Chen Rotem Levy
08e8dfccbe ✏️ Fix typo in [en] tutorial: exception handeling (#1326)
* Fix typo

* ✏️ Fix typo

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-17 13:40:55 +02:00
Sebastián Ramírez
fc70a2f36f 📝 Update release notes 2020-05-17 13:36:04 +02:00
Fabio Serrao
f5c5dbb739 🌐 Add Portuguese translation for alternatives.md (#1325)
* Portuguese translation for alternatives.md

* 🔥 Remove file not yet translated

* ✏️ Add small format and wording changes

* 🔧 Update Portuguese MkDocs

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-17 13:32:44 +02:00
Sebastián Ramírez
ca939fabf7 📝 Update release notes 2020-05-17 12:59:17 +02:00
Xie Wei
cc3d795bea ✏ Fix 2 typos in docs (#1324) 2020-05-17 12:56:57 +02:00
Sebastián Ramírez
7fc1bac54b 📝 Update release notes 2020-05-17 12:50:00 +02:00
Sebastián Ramírez
27367df90c 📝 Update release notes 2020-05-17 12:49:02 +02:00
Derek Bekoe
f93861e321 📝 Update cors.md - CORS max_age 600 (#1301)
Update max_age documentation from 60 to the actual default value of 600.
https://github.com/encode/starlette/blob/master/starlette/middleware/cors.py#L23

Related PR https://github.com/encode/starlette/pull/909
2020-05-17 12:48:02 +02:00
Fabio Serrao
30e56ec835 🌐 Add Portuguese translation for index.md (#1300)
* Portuguese Translation for index.md

* ✏️ Update * for consistency with recent changes

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-17 12:46:22 +02:00
Sebastián Ramírez
48ccef9ad2 📝 Update release notes 2020-05-17 12:38:10 +02:00
Chris Allnutt
b79e002635 ✏ Re-word and clarify docs for extra info in body-fields (#1299)
* Fixed Typo in [EN] tutorial: body-fields
- remove duplicate of examples text

* ✏️ Re-word and clarify extra info docs

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-17 12:37:15 +02:00
Sebastián Ramírez
1fa28b7cb6 📝 Update release notes 2020-05-17 12:30:00 +02:00
Sebastián Ramírez
22f7eae3f2 ✏️ Make sure the * in the README is consistent in the docs (#1424) 2020-05-17 12:28:37 +02:00
Sebastián Ramírez
ae93773465 📝 Update release notes 2020-05-17 12:15:58 +02:00
Sebastián Ramírez
0f387553d1 📝 Update release notes 2020-05-17 12:15:08 +02:00
Beau Barker
d53a253c8d 📝 Update location of get_db in SQL docs (#1293) 2020-05-17 12:14:14 +02:00
Sebastián Ramírez
f8f0a6e462 ✏️ Fix typos in async docs (#1423) 2020-05-17 12:11:17 +02:00
Sebastián Ramírez
f7eea768f6 🔖 Release 0.54.2 2020-05-16 21:00:28 +02:00
Sebastián Ramírez
53d316f706 📝 Update release notes 2020-05-16 20:56:58 +02:00
Alvaro Pernas
741de7f927 🌐 Add Spanish translation for Concurrency and async / await (#1290)
* final touches to async section ES translation

* minor fixes

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* Update docs/es/docs/async.md

Co-Authored-By: Camila Gutierrez <mariacamilagl@users.noreply.github.com>

* 📝 Update async/await docs in EN with emojis

* 📝 Update wording, format, and emojis for async/await in ES

* 🔧 Add async.md to MkDocs for Spanish

Co-authored-by: Camila Gutierrez <mariacamilagl@users.noreply.github.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-16 20:53:40 +02:00
Sebastián Ramírez
16b3669adf 📝 Update release notes 2020-05-16 18:03:17 +02:00
Donghui Wang
c5807fdaa4 🔥 Remove vote link (#1289)
remove 'Vote to include FastAPI in awesome-python', because the PR was closed
2020-05-16 18:02:05 +02:00
Sebastián Ramírez
897b7d1b99 📝 Update release notes 2020-05-16 17:47:26 +02:00
Sebastián Ramírez
409264960e Allow disabling docs UIs by disabling OpenAPI (#1421)
*  Allow disabling docs UIs by disabling openapi_url

* 📝 Add docs for disabling OpenAPI and docs in prod or other environments

*  Add tests for disabling OpenAPI and docs
2020-05-16 17:45:12 +02:00
Sebastián Ramírez
cfb72eec5a 📝 Update release notes 2020-05-16 15:41:21 +02:00
Fabio Serrao
778822bd9a 🌐 Add Portuguese translation for benchmarks (#1274)
* Translation benchmarks

* Update docs/pt/docs/benchmarks.md

Co-Authored-By: Marcos Monteiro <marcosmmb90@gmail.com>

* Update docs/pt/docs/benchmarks.md

Co-Authored-By: Marcos Monteiro <marcosmmb90@gmail.com>

* Update docs/pt/docs/benchmarks.md

Co-Authored-By: Marcos Monteiro <marcosmmb90@gmail.com>

* Update docs/pt/docs/benchmarks.md

Co-Authored-By: Marcos Monteiro <marcosmmb90@gmail.com>

* Update docs/pt/docs/benchmarks.md

Co-Authored-By: Marcos Monteiro <marcosmmb90@gmail.com>

* Update docs/pt/docs/benchmarks.md

Co-Authored-By: Marcos Monteiro <marcosmmb90@gmail.com>

* Update docs/pt/docs/benchmarks.md

Co-Authored-By: Marcos Monteiro <marcosmmb90@gmail.com>

* Update docs/pt/docs/benchmarks.md

Co-Authored-By: Marcos Monteiro <marcosmmb90@gmail.com>

* Update docs/pt/docs/benchmarks.md

Co-Authored-By: Marcos Monteiro <marcosmmb90@gmail.com>

* 🔧 Include benchmark translation in MkDocs for Portuguese

Co-authored-by: Marcos Monteiro <marcosmmb90@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-16 15:37:57 +02:00
Sebastián Ramírez
cfd2c3017f 📝 Update release notes 2020-05-16 15:31:21 +02:00
Marcos Monteiro
caed37a08f 🌐 Add Portuguese translation for the tutorial/index page (#1259)
* Translate tutorial/index.md to Portuguese

* ✏️ Update capitalization

* 🔧 Update docs section title in Portuguese

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-16 15:28:26 +02:00
Sebastián Ramírez
4c1b54e209 📝 Update release notes 2020-05-16 15:18:18 +02:00
Sebastián Ramírez
e4f0947821 Allow Unicode in MkDocs for translations instead of escaped chars (#1419) 2020-05-16 15:17:24 +02:00
Sebastián Ramírez
22e858f65c 📝 Update release notes 2020-05-16 15:01:10 +02:00
Juan Funez
046d6b7fa0 🌐 Add Spanish translation for advanced/index.md (#1250)
* spanish translation for advanced/index.md

* Ajustes sugeridos

* ✏️ Capitalize docs title

* 🔧 Add config to MkDocs for spanish

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-16 14:58:00 +02:00
Sebastián Ramírez
89f36371b9 📝 Update release notes 2020-05-16 14:48:56 +02:00
Marcos Monteiro
406b3ac805 🌐 Add Portuguese translation for the history-design-future page (#1249)
* Translate history-design-future.md to Portuguese

* Update docs/pt/docs/history-design-future.md

Co-Authored-By: Cássio Botaro <cassiobotaro@gmail.com>

* 📝 Capitalize title

Co-authored-by: Cássio Botaro <cassiobotaro@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-16 14:46:49 +02:00
Sebastián Ramírez
f71ba8885e 📝 Update release notes 2020-05-16 14:39:54 +02:00
Marcos Monteiro
121e87b3e0 🌐 Add Portuguese translation for Features (#1248)
* Translate features.md file to Portuguese

* Changes word of features.md translation to Portuguese

* Fixing typos and bad wording

Thanks @Serrones for the kind review
2020-05-16 14:37:17 +02:00
Sebastián Ramírez
2d013b8340 📝 Update release notes 2020-05-16 13:06:28 +02:00
Sebastián Ramírez
761e5ff01d 🐛 Fix Spanish MkDocs title 2020-05-16 13:05:21 +02:00
MartinEliasQ
9812684178 🌐 Add Spanish translation for the tutorial-user-guide index page (#1244)
* Spanish translation for the tutorial-user-guide index page

* Improve some parts of the text in terms of writing

* Change the wording to keep the documentation consistent.

* 📝 Add small wording and consistency changes

* 🎨 Apply the same consistency changes to EN 🤷

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-16 13:02:20 +02:00
Sebastián Ramírez
f7a87cd6ba 📝 Update release notes 2020-05-16 12:47:44 +02:00
Ikkyu
f67bc3ffe8 🌐 Add Chinese translations for docs: deployment.md (#1203)
* Add new language of docs: zh

* Add deployment.md Chinese trans

* add "or"

* rm index.md

* updates Chinese translations of deployement.md

* update translations of deployment.md

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-16 12:45:04 +02:00
Sebastián Ramírez
dff644abe0 📝 Update release notes 2020-05-16 12:38:13 +02:00
Xie Wei
fc7b4ab880 🌐 Add Chinese translation for tutorial intro doc (#1202)
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-16 12:32:31 +02:00
Sebastián Ramírez
1d0f909ca5 📝 Update release notes 2020-05-16 12:21:06 +02:00
Dustyposa
a0cdbe449b 🌐 Add translation of features.md to Chinese (#1192)
* translation features.md to Chinese

* update review data

* :DOCS: update with review

* 🔥 Remove double link in build mkdocs.yml for other languages

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-05-16 12:18:04 +02:00
Sebastián Ramírez
44bd64d797 📝 Update release notes 2020-05-16 12:04:32 +02:00
Xie Wei
bfa78db458 🌐 Add Chinese translation for index docs (#1191)
* Add Chinese tranlation for docs/index.md

* Fix syntax issue

* Update resource address of zh docs

* Optimize typography in zh docs

* improve translations

Co-authored-by: Waynerv <wei.xie@woqutech.com>
2020-05-16 11:58:10 +02:00
Sebastián Ramírez
4e77737a3f 📝 Update release notes 2020-04-18 17:57:50 +02:00
Sebastián Ramírez
d03c197c80 📝 Update project generation docs (#1287) 2020-04-18 17:56:35 +02:00
Sebastián Ramírez
06e42a4e5d 📝 Update release notes 2020-04-11 19:22:35 +02:00
Camila Gutierrez
bd1e85a8d3 📝 Add Spanish translation for the Python Types Intro page (#1237)
* Spanish translation Python Types Intro page

* 📝 Fix tuple docs in Types intro

* ✏️ Fix typos and wording nitpicks

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-04-11 19:20:32 +02:00
Sebastián Ramírez
506d5dce39 📝 Update release notes 2020-04-11 18:49:52 +02:00
Camila Gutierrez
a7b4c73663 📝 Add Spanish translation for the Features page (#1220)
* Spanish translation for the Features page

* ✏️ Fix small typos and wording nitpicks

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-04-11 18:46:46 +02:00
Sebastián Ramírez
d4f3ca1c1b 🔖 Release 0.54.1 2020-04-08 07:51:26 +02:00
Sebastián Ramírez
471d703611 📝 Update release notes 2020-04-08 07:50:30 +02:00
Sebastián Ramírez
a46bbc54cd Update database setup for tests (#1226)
* 🗃️ Update database setup for tests

*  Add pragmas and update db handling for tests
2020-04-08 07:41:53 +02:00
Sebastián Ramírez
a4405bbed2 📝 Update release notes 2020-04-08 06:39:40 +02:00
Samuel Colvin
e9b189e9f2 Improve test debugging (#1222) 2020-04-08 06:37:38 +02:00
Sebastián Ramírez
483bce3ae1 ⬆️ Upgrade to MkDocs Material 5 and update docs scripts (#1225)
* ⬆️ Upgrade mkdocs.yml configs for MkDocs Material 5

*  Update docs.py to always update mkdocs.yml

* 🌐 Update mkdocs.yml for translations

* 🔧 Update MkDocs config

*  Add tabs for alternative options

* ⬆️ Update termynal setup with new CSS classes

* 🔧 Sync / Update mkdocs.yml for languages
2020-04-08 06:25:01 +02:00
Sebastián Ramírez
7372f6ba11 🔖 Release version 0.54.0 2020-04-05 16:50:16 +02:00
Sebastián Ramírez
8d92557e53 📝 Update relase notes 2020-04-05 16:47:33 +02:00
Mickey Pashov
c56342bf79 ✏️ Fix minor grammatical mistakes in the async docs (#1188)
* Fix minor grammatical mistakes in the async docs.

* ✏️ Update wording and clarify with emojis

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-04-05 16:46:22 +02:00
Harsha Laxman
07e094fd50 📝 Add note about Alembic in project generator in SQL docs (#1183)
* Update sql-databases alembic docs

Was helpful to refer to the full-stack project when integrating alembic into my own project

* 📝 Update Alembic note in docs

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-04-05 15:15:39 +02:00
Sebastián Ramírez
1cc30de32f 📝 Update release notes 2020-04-05 15:07:00 +02:00
voegtlel
3397d4d69a Implement response_model_exclude_defaults and response_model_exclude_none (#1166)
* Implemented response_model_exclude_defaults and response_model_exclude_none to be compatible pydantic options.

* 🚚 Rename and invert include_none to exclude_none to keep in sync with Pydantic

Co-authored-by: Lukas Voegtle <lukas.voegtle@sick.de>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-04-05 15:04:46 +02:00
Sebastián Ramírez
766157bfb4 📝 Update release notes 2020-04-05 13:57:45 +02:00
duganchen
d96223460b 📝 Add an example of setting up a test database (#1144)
* Add an example of setting up a test database.

* 📝 Add/update docs for testing a DB with dependency overrides

* 🔧 Update test script, remove line removing test file as it is removed during testing

*  Update testing coverage pragma

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-04-05 13:53:09 +02:00
Sebastián Ramírez
fd99dfc95b 📝 Update release notes 2020-04-04 22:38:17 +02:00
Sebastián Ramírez
10fb7ace04 📝 Update contributing guidelines to review translation PRs (#1215) 2020-04-04 22:36:10 +02:00
Sebastián Ramírez
a1a19b103c 📝 Update release notes 2020-04-04 22:16:12 +02:00
Sebastián Ramírez
5c111caf40 📝 Update release notes 2020-04-04 22:14:55 +02:00
Gao Chao
651ee5e4d2 🎨 Update log style in main page, for GitHub Markdown compatibility (#1200)
* Update README.md

fix string format

* 🎨 Update log style in main page, for GitHub Markdown compatibility

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-04-04 22:13:55 +02:00
Cássio Botaro
c398ac87d9 🙈 Add Python venv "env" to gitignore (#1212) 2020-04-04 22:03:17 +02:00
Cássio Botaro
0a77c613b0 🌐 Add new language on docs: pt (#1210) 2020-04-04 22:01:19 +02:00
Sebastián Ramírez
70bc469373 📝 Update release notes 2020-04-04 21:39:52 +02:00
Sebastián Ramírez
b76334f544 📝 Settings using lru_cache (#1214)
*  Update settings examples to use lru_cache

* 📝 Update docs for Settings, using @lru_cache

* 🎨 Update lru_cache colors to show difference in stored values
2020-04-04 21:39:15 +02:00
Sebastián Ramírez
14b467db06 📝 Update release notes 2020-04-02 07:03:00 +02:00
Camila Gutierrez
3a0c22ce7d 🌐 Translate index to Spanish (#1201) 2020-04-02 07:00:50 +02:00
Sebastián Ramírez
3b7e4e0544 📝 Update release notes 2020-04-02 06:59:19 +02:00
alexmitelman
d4d5b21b2e 📝 Add documentation about settings and env vars (#1118)
* Add doc and example for env var config

* Syntax highlight for .env file

* Add test for configuration docs

* 📝 Update settings docs, add more examples

*  Add tests for settings

* 🚚 Rename "Application Configuration" to "Metadata and Docs URLs"

to disambiguate between that and settings

* 🔥 Remove replaced example file

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-04-02 06:55:20 +02:00
Sebastián Ramírez
6e1cd45a46 🔖 Release version 0.53.2 2020-03-30 21:49:50 +02:00
Sebastián Ramírez
b86d130eb6 📝 Update release notes 2020-03-30 21:47:11 +02:00
Toan Vuong
90afc72e64 🐛 Fix automatic embedding with dependencies and sub-dependencies (#1079)
* Handle automatic embedding with Depends

* 🐛 Fix body embeds for sub-dependencies and simplify implementation

*  Add/update tests for body embeds in dependencies

* 👷 Trigger Travis

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-03-30 21:44:43 +02:00
Sebastián Ramírez
042c697b6b 📝 Update release notes 2020-03-30 20:49:24 +02:00
amitlissack
02441ff031 🐛 Fix dependency overrides in WebSockets (#1122)
* add tests to test_ws_router to test dependencies and dependency overrides.

* supply dependency_overrides_provider to APIWebSocketRoute upon creation
2020-03-30 20:45:05 +02:00
Sebastián Ramírez
210af1fd3d 📝 Update release notes 2020-03-30 20:42:46 +02:00
Sebastián Ramírez
06eaa32bf0 🔧 Update docs script to make sure languages are always sorted (#1189) 2020-03-30 20:41:50 +02:00
Sebastián Ramírez
4f88a5fddb 📝 Update release notes 2020-03-30 20:26:07 +02:00
Ikkyu
eb6be1d725 💬 Add new language of docs: zh (#1187) 2020-03-30 20:14:58 +02:00
Sebastián Ramírez
1d99681fd4 📝 Update release notes 2020-03-30 12:01:30 +02:00
Sebastián Ramírez
618be44023 🔧 Add .env to git, to simplify VS Code development 2020-03-30 12:00:55 +02:00
Sebastián Ramírez
544afaff97 📝 Add docs for adding example to schema (#1185) 2020-03-30 11:58:48 +02:00
Sebastián Ramírez
e6b3b994be 🔖 Release version 0.53.1 2020-03-29 22:08:54 +02:00
Sebastián Ramírez
67f148ff83 📝 Update release notes 2020-03-29 22:06:02 +02:00
Sebastián Ramírez
6c34600599 🐛 Fix include docs example file (#1182) 2020-03-29 22:05:24 +02:00
John Paton
016a4b7491 📝 Add documentation of example kwarg of Field (#1106)
* Add documentation of example kwarg of Field

* 📝 Update info about schema examples

* 🚚 Move example file to new directory

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-03-29 21:43:31 +02:00
Sebastián Ramírez
be21b74ad5 📝 Update release notes 2020-03-29 19:28:53 +02:00
voegtlel
0f152b4e97 🐛 Check already cloned fields in create_cloned_field to support recursive models (#1164)
* FIX: #894
Include recursion check for create_cloned_field.
Added test for recursive model.

* ♻️ Refactor and format create_cloned_field()

Co-authored-by: Lukas Voegtle <lukas.voegtle@sick.de>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-03-29 19:26:29 +02:00
Sebastián Ramírez
0d165d1efa 📝 Update release notes 2020-03-29 18:52:33 +02:00
YangQuan
9d54215a3a 📝 Add example of Pycharm in tutorial/debugging.md (#1096)
* add example of pycharm in tutorial/debugging.md

* 📝 Update PyCharm debug instructions and screenshot

* 🚚 Move image to new location in docs

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-03-29 18:50:29 +02:00
Sebastián Ramírez
8ab916baed 📝 Update release notes 2020-03-29 17:53:49 +02:00
Paul-Louis NECH
c83c50b27d ✏️ Fix typo (#1148) 2020-03-29 17:51:58 +02:00
Sebastián Ramírez
c2ad214a84 📝 Update release notes 2020-03-29 17:05:03 +02:00
Sebastián Ramírez
459f0e11e5 🏁 Update Windows development environment and tests (#1179)
* 🏁 Fix ./scripts/docs.py encoding for Windows

* 🔥 Remove ujson from tests as it prevents Windows development

It's still tested by Starlette anyway

* 📝 Update development instructions for Windows

* 🎨 Update format for WSGIMiddleware example

*  Update tests to run on Windows
2020-03-29 17:04:04 +02:00
Sebastián Ramírez
56e43ba204 🔖 Release version 0.53.0 2020-03-27 17:56:41 +01:00
Sebastián Ramírez
10485cad5a 📝 Update release notes 2020-03-27 17:52:33 +01:00
Sebastián Ramírez
53a7798e58 🎨 Update badge for coverage (#1175)
from shields.io, as Codecov's one shows coverage for the last PR from a fork at master
2020-03-27 17:51:58 +01:00
Sebastián Ramírez
372ed58677 📝 Update release notes 2020-03-27 17:33:51 +01:00
Michael Oliver
3f8bfd62b7 Add orjson to pip install fastapi[all] (#1161) 2020-03-27 17:32:35 +01:00
Sebastián Ramírez
02a6fcad98 📝 Update release notes 2020-03-27 17:29:11 +01:00
Ari Bajo
651ced68bf 🐛 Fix GZipMiddleware code block linking to TrustedHostMiddleware in docs (#1138) 2020-03-27 17:27:57 +01:00
Sebastián Ramírez
670b64360d 📝 Update release notes 2020-03-27 17:20:01 +01:00
adg-mh
1f53fef70a ✏️ Update doc string with correct class name (#1126) 2020-03-27 17:18:23 +01:00
Sebastián Ramírez
d1f067dc5b 📝 Update release notes 2020-03-27 17:16:45 +01:00
Tomoya Yoshioka
15241b53a8 📝 Clarify function name in example (#1121) 2020-03-27 17:15:26 +01:00
Sebastián Ramírez
38fd8a674b 📝 Update release notes 2020-03-27 17:04:25 +01:00
Ben
bd37d8d04f 📝 Add new external link (#1112)
* Added new external link

I added an article in which I briefly explain how to build an Apache Kafka producer / consumer with FastAPI and aiokafka.

* 📝 Update format

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-03-27 17:02:18 +01:00
Sebastián Ramírez
bc99ad0ad1 📝 Update release notes 2020-03-27 16:21:28 +01:00
juhovh-aiven
aea04ee32e 🐛 Fix exclude_unset and aliases in response model validation (#1074)
* Fix exclude_unset and aliases in response model validation.

*  Use by_alias from param 🤷

Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-03-27 16:19:17 +01:00
Sebastián Ramírez
869c7389e2 📝 Update release notes 2020-03-27 15:34:16 +01:00
Aakash Nand
2738df3801 Add Gitter chat to docs (#1061)
* implemented chat feature using sidecar from starlette docs

* 🔥 Use external Gitter sidecar JS

*  Re-implement Gitter chat after multi-lang

* 🔥 Remove moved file

Co-authored-by: Aakash Nand <aakashnand@nttv6.jp>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
2020-03-27 15:32:15 +01:00
Sebastián Ramírez
433d7862ea 📝 Update release notes 2020-03-27 10:21:40 +01:00
Sebastián Ramírez
7625e1e386 📝 Update and simplify translations docs (#1171) 2020-03-27 10:20:39 +01:00
Sebastián Ramírez
53e773a2e1 📝 Update release notes 2020-03-26 22:24:36 +01:00
Camila Gutierrez
c13b54ad0e 🏁 Change docs address to localhost for Windows (#1169) 2020-03-26 22:22:34 +01:00
Sebastián Ramírez
71c2abb41d 📝 Update release notes 2020-03-26 20:13:03 +01:00
Sebastián Ramírez
6205935323 Add support for docs translations (#1168)
* 🌐 Refactor file structure to support internationalization

*  Update tests changed after i18n

* 🔀 Merge Typer style from master

* 🔧 Update MkConfig with Typer-styles

* 🎨 Format mkdocs.yml with cannonical form

* 🎨 Format mkdocs.yml

* 🔧 Update MkDocs config

*  Add docs translation scripts dependencies

*  Add Typer scripts to handle translations

*  Add missing translation snippet to include

*  Update contributing docs, add docs for translations

* 🙈 Add docs_build to gitignore

* 🔧 Update scripts with new locations and docs scripts

* 👷 Update docs deploy action with translations

* 📝 Add note about languages not supported in the theme

*  Add first translation, for Spanish
2020-03-26 20:09:53 +01:00
Sebastián Ramírez
5fd5b6e72d 📝 Update release notes 2020-03-24 20:39:47 +01:00
Sebastián Ramírez
faf88cea0b 🎨 Update terminal examples and Typer note (#1139)
* 🎨 Update terminal examples with Termynal

* 🍱 Add Termynal scripts and styles from Typer for terminal examples
2020-03-19 14:39:29 +01:00
Sebastián Ramírez
025b38df40 🔖 Release version 0.52.0 2020-03-01 22:34:38 +01:00
Sebastián Ramírez
ac60cba75f 📝 Update release notes 2020-03-01 22:33:11 +01:00
Sebastián Ramírez
94ee932351 Add ORJSONResponse (#1065)
*  Add ORJSONResponse

* 📝 Add tutorial using ORJSONResponse

*  Add test for ORJSONResponse

* 📝 Update index.md
2020-03-01 22:30:58 +01:00
Sebastián Ramírez
cf760d6802 🔖 Release version 0.51.0 2020-03-01 22:02:51 +01:00
Sebastián Ramírez
c65fdc4bed 📝 Update release notes 2020-03-01 21:58:36 +01:00
Sebastián Ramírez
0ac9b3ee5c Re-export utils from Starlette (#1064)
*  Re-export main features used from Starlette to simplify developer's code

* ♻️ Refactor Starlette exports

* ♻️ Refactor tutorial examples to use re-exported utils from Starlette

* 📝 Add examples for all middlewares

* 📝 Add new docs for middlewares

* 📝 Add examples for custom responses

* 📝 Extend docs for custom responses

* 📝 Update docs and add notes explaining re-exports from Starlette everywhere

* 🍱 Update screenshot for HTTP status

* 🔧 Update MkDocs config with new content

* ♻️ Refactor tests to use re-exported utils from Starlette

*  Re-export WebSocketDisconnect from Starlette for tests

*  Add extra tests for extra re-exported middleware

*  Add tests for re-exported responses from Starlette

*  Add docs about mounting WSGI apps

*  Add Flask as a dependency to test WSGIMiddleware

*  Test WSGIMiddleware example
2020-03-01 21:49:20 +01:00
Sebastián Ramírez
f2bd2c44e2 🔖 Release version 0.50.0 2020-02-29 21:49:09 +01:00
Sebastián Ramírez
f0beab1778 📝 Update release notes 2020-02-29 21:48:11 +01:00
Sebastián Ramírez
95f2dc065e 📝 Add link to the Release Notes from the section about pinning versions for deployment (#1058) 2020-02-29 21:47:46 +01:00
Sebastián Ramírez
4e8080f290 📌 Upgrade Starlette version (#1057) 2020-02-29 21:28:23 +01:00
Sebastián Ramírez
fbbed6fe81 📝 Update release notes 2020-02-29 19:22:08 +01:00
Sebastián Ramírez
2d5a5d0d9e 📝 Add docs about pinning versions for deployment (#1056) 2020-02-29 19:20:18 +01:00
Sebastián Ramírez
d4ddf4e62a 🔖 Release 0.49.2 2020-02-29 18:19:52 +01:00
Sebastián Ramírez
cb25dab986 📝 Update release notes 2020-02-29 18:01:40 +01:00
Sebastián Ramírez
7aa1628336 📝 Update release notes 2020-02-29 18:00:57 +01:00
sattosan
1dbd3d7aa7 ✏️ Fix broken links in release notes (#1052) 2020-02-29 18:00:40 +01:00
sattosan
24e73e01c7 ✏️ Fix typo in release notes (#1051) 2020-02-29 17:56:41 +01:00
Patrick McKenna
e26f94018c ♻️ Refactor serialize_response parameter name (#1031) 2020-02-29 17:33:02 +01:00
sm-Fifteen
1ce67887b9 ♻️ Refactor function calling a path operation function to simplify profiling (#1027) 2020-02-29 17:28:30 +01:00
Sebastián Ramírez
8e0200607f 📝 Update release notes 2020-02-29 17:16:00 +01:00
sm-Fifteen
bd407ca705 Add testing dependencies #1026 2020-02-29 14:23:41 +01:00
Sebastián Ramírez
48b5ef1681 📝 Update release notes 2020-02-29 14:06:45 +01:00
Patrick McKenna
afad59dfbb 🐛 Admit valid types for Pydantic fields as responses models (#1017) 2020-02-29 14:04:35 +01:00
Sebastián Ramírez
0f9be1d2e7 📝 Update release notes 2020-02-29 13:16:20 +01:00
Vegard Stikbakke
48c2406495 🎨 Fix markdown code section rendering error in SQL tutorial (#1015) 2020-02-29 12:40:09 +01:00
Sebastián Ramírez
9958d93120 🔖 Release 0.49.1 2020-02-28 22:48:03 +01:00
Sebastián Ramírez
b63512cd92 📝 Update release notes 2020-02-28 22:46:55 +01:00
merowinger92
74c4d1c1db 🐛 Fix declaring a single parameter per name (#994) 2020-02-28 22:36:30 +01:00
Sebastián Ramírez
7ccd81f706 🚀 Update Netlify deploy action (#1047) 2020-02-28 17:27:43 +01:00
Taneli Hukkinen
1da8d3f1e6 🔧 Move all mypy configurations to configuration file (#987) 2020-02-27 21:03:03 +01:00
Camila Gutierrez
92016da962 💚 Do not deploy preview to Netlify on external PRs while GitHub actions are solved (#1046) 2020-02-27 20:59:26 +01:00
Sebastián Ramírez
9c3c9b6e78 🔖 Release version 0.49.0 2020-02-16 21:11:28 +01:00
Sebastián Ramírez
687871e46a 📝 Update release notes 2020-02-16 21:08:58 +01:00
Patrick McKenna
3c1803897f 🐛 Fix path encoding (#978) 2020-02-16 21:06:41 +01:00
T. Tokusumi
1c3289f115 📝 Add link: JP articles related to fastapi (#974) 2020-02-16 21:00:42 +01:00
Taras Sotnikov
35d41adc7b 📝 Fix broken link in docs (#949) 2020-02-16 20:57:29 +01:00
Sebastián Ramírez
9a3dd91030 📝 Update release notes 2020-02-16 20:55:07 +01:00
Sebastián Ramírez
017eae63b1 📝 Update release notes 2020-02-16 20:53:50 +01:00
Nikita Kolesov
8af4454251 ✏️ Fix typo (#941) 2020-02-16 20:51:18 +01:00
Sebastián Ramírez
adf252768c 📝 Update docs for dependencies with yield (#986) 2020-02-16 20:49:12 +01:00
Sebastián Ramírez
3705bdefd5 📝 Update release notes 2020-02-16 19:48:52 +01:00
Sebastián Ramírez
25e94d6344 Add mermaid.js support in Markdown fenced blocks for diagrams (#985) 2020-02-16 19:48:20 +01:00
Sebastián Ramírez
26c345b766 📝 Update release notes 2020-02-15 13:26:01 +01:00
Sebastián Ramírez
9ce50b4684 👷 Add GitHub actions to deploy to Netlify (#983) 2020-02-15 13:24:34 +01:00
Sebastián Ramírez
66954c7ded 📝 Update release notes 2020-02-12 21:37:05 +01:00
Sebastián Ramírez
e0c3519b94 Allow callables (as functools.partial) in path operations (#977) 2020-02-12 21:36:14 +01:00
Sebastián Ramírez
d91b2b3ee8 🔖 Release version 0.48.0 2020-02-04 05:43:07 +01:00
Sebastián Ramírez
1623b26855 📝 Update release notes 2020-02-04 05:42:12 +01:00
Sebastián Ramírez
9573130630 Lint first in tests, to error out faster (#948) 2020-02-04 05:41:42 +01:00
Sebastián Ramírez
2e0a102565 🔇 Log email-validator not installed only when used (#946) 2020-02-04 05:31:01 +01:00
Sebastián Ramírez
636ce6b3f7 📝 Update Peewee docs, simplify with double dependency with yield (#947) 2020-02-04 05:28:19 +01:00
नवुले पवन कुमार राव
1fd1e8733a 📝 Add link: Create and Deploy FastAPI app to Heroku (#942) 2020-02-04 05:25:00 +01:00
raphaelauv
44b45caf65 📝 Update Sanic description as it is now ASGI too 🎉 (#932) 2020-02-04 05:14:07 +01:00
Maciej Marzęta
e6da96fbb7 ✏️ Fix typos (#920) 2020-02-04 05:04:32 +01:00
David Montague
c425509d57 🐛 Fix body parsing (#918) 2020-02-04 05:01:59 +01:00
adursun
d8451f75a4 ✏️ Fix typo (#916) 2020-02-04 04:57:18 +01:00
李冬冬
a448bd63bd 🐛 Allow Any type for enums in OpenAPI (#906) 2020-02-04 04:37:47 +01:00
Ben
27fb2b358c 📝 Add article to external links (#901) 2020-02-04 04:25:52 +01:00
Timothée Mazzucotelli
68723d5291 📝 Add note about Body parameters without Pydantic (#900) 2020-02-04 04:17:20 +01:00
Andy Smith
70bdade23b 🐛 Fix Pydantic field clone logic with validators (#899) 2020-02-04 04:03:51 +01:00
linchiwei123
4f964939a1 🐛 Fix middleware docs link (#893) 2020-02-04 03:27:10 +01:00
Sebastián Ramírez
55afb70b37 📝 Update release notes 2020-01-18 19:08:24 +01:00
Sebastián Ramírez
b307d38897 ♻️ Update default API title from "Fast API" to "FastAPI" for consistency (#890) 2020-01-18 19:07:42 +01:00
Sebastián Ramírez
a085898309 🔖 Release version 0.47.1 2020-01-18 18:06:47 +01:00
Sebastián Ramírez
3b40c557ce 📝 Update release notes 2020-01-18 18:06:20 +01:00
Sebastián Ramírez
75a07f24bf 🔒 Fix clone field implementation to handle sub-models in response_model (#889) 2020-01-18 18:03:51 +01:00
Sebastián Ramírez
7cea84b74c 🐛 Fix FastAPI serialization of Pydantic ORM mode blocking the event loop (#888) 2020-01-18 17:32:57 +01:00
Sebastián Ramírez
3a5158a784 🔖 Release version 0.47.0 2020-01-18 17:14:59 +01:00
Sebastián Ramírez
bd581c5337 📝 Update release notes 2020-01-18 17:14:03 +01:00
Sebastián Ramírez
22982287ff 📝 Refactor docs, "Tutorial - User Guide" and "Advanced User Guide" (#887) 2020-01-18 16:21:54 +01:00
Sebastián Ramírez
a41a729682 🎨 Tweak external links, Markdown format, typos (#881) 2020-01-17 16:24:05 +01:00
Pavel Isaev
174e7b1730 🔒 Check both username and password in security tutorial (#865) 2020-01-17 12:49:54 +01:00
Nik
874d24181e 🐛 Fix validating form params declared with classes (list, tuple, set, etc) (#856) 2020-01-17 12:45:55 +01:00
Aviram Hassan
5db99a27cf add body to RequestValidationError for easier debugging (#853) 2020-01-17 12:37:44 +01:00
Sebastián Ramírez
180b842a1e 📝 Add external links, dynamic GitHub topic projects, and formatting (#850) 2020-01-17 10:46:44 +01:00
Sebastián Ramírez
3f53deebc9 🐛 Fix Peewee contextvars handling in docs (#879) 2020-01-17 09:59:38 +01:00
Sebastián Ramírez
e5d7878856 Use venv with Flit for local development, instead of requiring Flit and Pipenv (#877) 2020-01-17 09:51:03 +01:00
Sebastián Ramírez
3eca945bd1 📝 Udpate release notes 2020-01-12 20:43:46 +01:00
Zachary Wasserman
ba9c9a3f78 🔒 Update HTTP Basic Auth docs fixing timing attacks (#807) 2020-01-12 20:38:39 +01:00
Sebastián Ramírez
a9673f145a 🔖 Release version 0.46.0 2020-01-08 23:28:03 +01:00
Sebastián Ramírez
aa28784f6b 📝 Update release notes 2020-01-08 23:26:15 +01:00
Sebastián Ramírez
7b3319ddab ✏️ Tweak typos and configs (#837) 2020-01-08 23:25:29 +01:00
Sebastián Ramírez
6a20078259 📝 Update release notes 2020-01-08 23:03:08 +01:00
wxq0309
d0ab909544 📝 Add link to Chinese FastAPI posts (#810) 2020-01-08 23:01:58 +01:00
Sebastián Ramírez
13da029dca 📝 Update release notes 2020-01-08 22:51:55 +01:00
Jesse P. Johnson
91fe90e8e6 Implement OAuth2 authorization_code integration (#797) 2020-01-08 22:47:19 +01:00
Sebastián Ramírez
a0c8f93231 📝 Update release notes 2020-01-08 22:35:33 +01:00
Christoph Deil
cad6a6e0c1 📝 Highlight all new lines in docs example upgrade (#795) 2020-01-08 22:34:14 +01:00
Sebastián Ramírez
fd5ba77b83 📝 Update release notes 2020-01-08 22:23:54 +01:00
James Kaplan
cb1410426e 🐛 Fix callback handling in sub-routers (#792) 2020-01-08 22:22:14 +01:00
Sebastián Ramírez
7b31e52766 📝 Update release notes 2020-01-08 22:02:32 +01:00
Ken Kinder
4151616681 ✏️ Fix typos (#784) 2020-01-08 22:01:22 +01:00
Sebastián Ramírez
462e24e864 📝 Update release notes 2020-01-08 22:00:44 +01:00
Xucong ZHAN
9f9ed7a6bd 📝 Add four JP articles to external links (#783) 2020-01-08 21:58:33 +01:00
Sebastián Ramírez
b6ea9ea2ca 📝 Update release notes 2020-01-08 21:53:14 +01:00
Roald Storm
b85b2e3942 Add support for subtypes of main types in jsonable_encoder 2020-01-08 21:50:21 +01:00
Sebastián Ramírez
08fc2a41ca 📝 Update release notes 2020-01-08 19:16:57 +01:00
Dustyposa
8d3dcbcd1b fix type UrlStr -> HttpUrl (#832) 2020-01-08 00:08:43 -08:00
Justin DuJardin
861ed37c97 📝 update twitter compose tweet links (#813)
The links to post @tiangolo were not working
2019-12-30 15:22:11 -07:00
Sebastián Ramírez
7a445402d4 📝 Update release notes 2019-12-13 11:32:17 +01:00
Sebastián Ramírez
04c8502cc7 📝 Add docs for correctly using Peewee (#789) 2019-12-13 11:29:18 +01:00
Sebastián Ramírez
c7c69586ae 🔖 Release version 0.45.0 2019-12-11 18:05:19 +01:00
Sebastián Ramírez
4e09feda9e 📝 Update release notes 2019-12-11 18:02:53 +01:00
Ben Dayan
73260971b5 Add support for OpenAPI Callbacks (#722) 2019-12-11 17:58:00 +01:00
Sebastián Ramírez
b36bfff56e 📝 Update release notes 2019-12-09 20:04:04 +01:00
Sebastián Ramírez
83d04df8a6 🔊 Refactor logging (#781) 2019-12-09 20:02:44 +01:00
Sebastián Ramírez
7bc78c5fd3 📝 Update release notes 2019-12-09 19:15:37 +01:00
prostomarkeloff
ae8fa3aacd 📝 Add article about FastAPI to external links (#766) 2019-12-09 19:13:28 +01:00
Sebastián Ramírez
08bc120771 📝 Update release notes 2019-12-09 19:01:40 +01:00
Sebastián Ramírez
a39efb029f 💬 Rephrase handling-errors to remove gender while keeping readability (#780) 2019-12-09 18:59:29 +01:00
Sebastián Ramírez
58ca98285f 📝 Update release notes 2019-12-09 18:43:09 +01:00
prostomarkeloff
3f5f81bbdc 📝 Change 'Schema' to 'Field' in docs (#746) 2019-12-09 14:48:54 +01:00
Sebastián Ramírez
90236c8135 🔖 Release version 0.44.1 2019-12-05 00:17:04 +01:00
Sebastián Ramírez
c200bc2240 📝 Update release notes 2019-11-29 09:02:21 +01:00
Sebastián Ramírez
e9861cd918 🍱 Add GitHub social preview assets to git (#752) 2019-11-29 08:52:03 +01:00
Sebastián Ramírez
202fa11d50 📝 Update release notes 2019-11-29 08:30:10 +01:00
Sebastián Ramírez
4b6e09296c 🔧 Update PyPI trove classifiers (#751) 2019-11-29 08:29:37 +01:00
Sebastián Ramírez
9bd0d6fa96 👷 Enable full Travis for Python 3.8 (#750) 2019-11-29 07:45:09 +01:00
Sebastián Ramírez
35510a5ea7 📝 Update the "new issue" templates (#749)
* 🔧 Update the "new issue" templates

* 💚 Trigger Travis CI after Travis migration
2019-11-29 07:35:25 +01:00
Sebastián Ramírez
c1788a25c7 📝 Update release notes 2019-11-29 07:04:01 +01:00
dmontagu
19c77e35bd 🐛 Fix issue with exotic pydantic error serialization (#748) 2019-11-29 07:02:10 +01:00
Sebastián Ramírez
cc4c13e4ae 🔖 Release 0.44.0, with support for Pydantic v1 and above! 🎉 2019-11-27 22:16:29 +01:00
Sebastián Ramírez
4f3764faa9 📝 Update release notes 2019-11-27 22:14:36 +01:00
Sebastián Ramírez
c27ad0dc26 💚 Make GitHub action Issue Manager run once every night 2019-11-27 22:14:01 +01:00
Sebastián Ramírez
6d0caf7522 👷 Add GitHub action Issue Manager (#742) 2019-11-27 21:43:56 +01:00
Sebastián Ramírez
06df32e84c 📝 Update release notes 2019-11-27 21:29:14 +01:00
bundabrg
28c089c029 ✏️ Fix typos in docs (#734) 2019-11-27 21:27:56 +01:00
Sebastián Ramírez
44b26bb64c 📝 Update release notes 2019-11-27 21:25:09 +01:00
Stéphane Wirtel
e04bae2286 🐛 Fix the usage of custom_encoder for jsonable_encoder #714 (#715) 2019-11-27 21:23:23 +01:00
Sebastián Ramírez
23f5940e8b 📝 Update release notes 2019-11-27 21:08:37 +01:00
OcasoProtal
4915cf0561 🐛 Fix XML example (#710) 2019-11-27 21:06:50 +01:00
Sebastián Ramírez
a1c9eff041 📝 Update release notes 2019-11-27 21:05:39 +01:00
Nicolas Marier
57cb3f3089 📝 Fix typos and wording in deployment docs (#700) 2019-11-27 21:03:41 +01:00
Sebastián Ramírez
bd6b3b07c5 📝 Update release notes 2019-11-27 21:01:56 +01:00
Nicolas Marier
3cf8b86dc1 📝 Clarify docs for APIRouter dependencies (#698) 2019-11-27 21:00:34 +01:00
Sebastián Ramírez
55165f292a 📝 Update release notes 2019-11-27 20:53:00 +01:00
François Voron
f3ddc7bdeb 🐛 Allow async class methods as dependencies (#681) 2019-11-27 20:51:30 +01:00
Sebastián Ramírez
4356cc9588 📝 Update release notes 2019-11-27 20:45:49 +01:00
euri10
cd9e87e60e 📝 Add FastAPI cheatsheet to links (#671) 2019-11-27 20:43:23 +01:00
Sebastián Ramírez
4834d87dcd 📝 Update release notes 2019-11-27 20:40:26 +01:00
Forest Monsen
7781cc0936 ✏️ Fix protocol separator typo (#647) 2019-11-27 20:37:19 +01:00
Sebastián Ramírez
23459d4a35 📝 Update release notes 2019-11-27 20:36:37 +01:00
dmontagu
ab2b86fe2c Add support for Pydantic v1 and above 🎉 (#646)
* Make compatible with pydantic v1

* Remove unused import

* Remove unused ignores

* Update pydantic version

* Fix minor formatting issue

*  Revert removing iterate_in_threadpool

*  Add backwards compatibility with Pydantic 0.32.2

with deprecation warnings

*  Update tests to not break when using Pydantic < 1.0.0

* 📝 Update docs for Pydantic version 1.0.0

* 📌 Update Pydantic range version to support from 0.32.2

* 🎨 Format test imports

*  Add support for Pydantic < 1.2 for populate_validators

*  Add backwards compatibility for Pydantic < 1.2.0 with required fields

* 📌 Relax requirement for Pydantic to < 2.0.0 🎉 🚀

* 💚 Update pragma coverage for older Pydantic versions
2019-11-27 20:32:02 +01:00
Sebastián Ramírez
90a5796b94 🔖 Release 0.43.0 2019-11-24 18:56:11 +01:00
Sebastián Ramírez
bb8a630fc3 📝 Update release notes 2019-11-24 15:12:56 +01:00
Nicolas Delaby
f5a503afae 📝 Replace guys by developers when a group of people is targeted (#645)
Just to make sure we include everyone, disregarding their gender.
2019-11-24 15:09:45 +01:00
Sebastián Ramírez
49fba853c2 📝 Update release notes 2019-11-24 15:06:31 +01:00
Steven Kalt
bac2f587b7 📝 Document overriding operationId for all path operations using their function names (#642) 2019-11-24 15:00:51 +01:00
Sebastián Ramírez
e1fd6785aa 📝 Update release notes 2019-11-24 14:25:51 +01:00
James Addison
4e50f53459 🐛 Fixing validator-caused incorrect output key order (#637) 2019-11-24 14:23:33 +01:00
Sebastián Ramírez
933d4327fb 📝 Update release notes 2019-11-24 14:18:03 +01:00
Daniel Brotsky
c7902dd23a Generate correct OpenAPI docs for responses with no content (#621) 2019-11-24 14:15:39 +01:00
Sebastián Ramírez
c5f5e63810 📝 Update release notes 2019-11-23 23:00:52 +01:00
Nico Stapelbroek
c3cc077fa9 📝 Remove $ sign from bash codeblocs in markdown (#613) 2019-11-23 22:59:15 +01:00
Sebastián Ramírez
c6f98c009f 📝 Update release notes 2019-11-23 22:57:47 +01:00
Sebastián Ramírez
e4206772cb 📝 Update release notes 2019-11-23 22:54:06 +01:00
svalouch
723ef07ccf 📝 Add documentation for self-serving static Swagger UI (#112) (#557) 2019-11-23 22:50:58 +01:00
François Voron
8609beb9ab 🚨 Fix black linting (#682) 2019-11-23 22:43:43 +01:00
Sebastián Ramírez
65536cbf63 🔖 Release version 0.42.0: Answer to the Ultimate Question of Life, the Universe, and Everything 2019-10-09 13:16:45 -05:00
Sebastián Ramírez
0192eab557 📝 Update release notes 2019-10-09 13:13:04 -05:00
Sebastián Ramírez
3f9f4a0f8f Add dependencies with yield (used as context managers) (#595)
*  Add development/testing dependencies for Python 3.6

*  Add concurrency submodule with contextmanager_in_threadpool

*  Add AsyncExitStack to ASGI scope in FastAPI app call

*  Use async stack for contextmanager-able dependencies

including running in threadpool sync dependencies

*  Add tests for contextmanager dependencies

including internal raise checks when exceptions should be handled and when not

*  Add test for fake asynccontextmanager raiser

* 🐛 Fix mypy errors and coverage

* 🔇 Remove development logs and prints

*  Add tests for sub-contextmanagers, background tasks, and sync functions

* 🐛 Fix mypy errors for Python 3.7

* 💬 Fix error texts for clarity

* 📝 Add docs for dependencies with yield

*  Update SQL with SQLAlchemy tutorial to use dependencies with yield

and add an alternative with a middleware (from the old tutorial)

*  Update SQL tests to remove DB file during the same tests

*  Add tests for example with middleware

as a copy from the tests with dependencies with yield, removing the DB in the tests

* ✏️ Fix typos with suggestions from code review

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>
2019-10-09 13:01:58 -05:00
Sebastián Ramírez
380e3731a8 📝 Update release notes 2019-10-09 12:48:01 -05:00
Samuel Colvin
d6d99b86cb 🐛 Fix sitemap.xml in website, fix #597 (#598) 2019-10-09 12:45:44 -05:00
Sebastián Ramírez
5592fa0f6f 🔖 Release version 0.41.0 2019-10-07 06:44:07 -05:00
Sebastián Ramírez
b65be5d496 📝 Update release notes 2019-10-05 13:19:10 -05:00
Sebastián Ramírez
6c7da43e51 ⬆️ Upgrade Starlette to 0.12.9 and add State (#593) 2019-10-05 13:17:15 -05:00
Sebastián Ramírez
dfec2d7644 📝 Update release notes 2019-10-04 20:21:53 -05:00
dmontagu
8c3ef76139 Add better support for request body access/manipulation with custom classes (#589) 2019-10-04 19:23:34 -05:00
Sebastián Ramírez
7a504a721c 📝 Update release notes 2019-10-04 16:36:54 -05:00
dmontagu
dd963511d6 🐛 Fix preserving route_class when calling include_router (#538) 2019-10-04 16:35:20 -05:00
Sebastián Ramírez
fdb6d43e10 🔖 Release 0.40.0 2019-10-04 15:38:03 -05:00
Sebastián Ramírez
a7c718e968 📝 Update release notes 2019-10-04 15:35:09 -05:00
sliptonic
f4d753620b 📝 Add notes about installing python-multipart for forms (#574) 2019-10-04 15:33:42 -05:00
Sebastián Ramírez
fadfe4c586 📝 Update release notes 2019-10-04 15:11:04 -05:00
dmontagu
5fd83c5fa4 Sort schemas alphabetically (#554)
Modify openapi spec generation to include schemas in alphabetical order.
2019-10-04 15:08:41 -05:00
Sebastián Ramírez
14daaf409f 📝 Update release notes 2019-10-04 15:07:22 -05:00
svalouch
c7dc26b760 Allow docstrings to be truncated before being used for OpenAPI (#556) 2019-10-04 15:02:40 -05:00
Sebastián Ramírez
f5ccb3c35d 📝 Update release notes 2019-10-03 19:37:23 -05:00
Trim21
4cea311e6e 🐛 Fix doctype in docs (#537) 2019-10-03 19:35:44 -05:00
Sebastián Ramírez
f8718072a0 📝 Update release notes 2019-10-03 19:10:34 -05:00
tsouvarev
3dbbecdd16 🐛 Fix setting 4XX overriding default 422 validation errors(#517) 2019-10-03 19:08:29 -05:00
Sebastián Ramírez
6d5530ec1c 📝 Update release notes 2019-10-03 19:04:41 -05:00
prostomarkeloff
0761f11d1a ✏️ Fix typo in HTTP Basic auth tutorial (#514) 2019-10-03 19:01:41 -05:00
Sebastián Ramírez
f2e7ef7056 📝 Update release notes 2019-10-03 19:00:13 -05:00
Fedor Ignatov
d5d9a20937 📝 Fix incorrect example in docs - first steps (#511) 2019-10-03 18:57:49 -05:00
Sebastián Ramírez
96f092179f 📝 Update release notes 2019-10-03 18:43:15 -05:00
Zamir Amir
8505b716af Add support for setting Swagger UI initOAuth configs (clientId, appName) (#499) 2019-10-03 18:41:04 -05:00
Sebastián Ramírez
78272ac1f3 🔖 Release 0.39.0 2019-09-29 17:17:44 -05:00
Sebastián Ramírez
f1bee9a271 📝 Update release notes 2019-09-29 17:09:37 -05:00
jonathanunderwood
b20b2218cd Allow defaults in path parameters (and don't use them) (#450) (#464)
This allows using parameters that can have defaults (e.g. `None`) that can be used as query parameters.

But can also be used in routers with that include those parameters as part of the path.
2019-09-29 17:03:16 -05:00
Sebastián Ramírez
b9cf69cd42 📝 Update release notes 2019-09-29 16:50:00 -05:00
toppk
f803c77515 Add support for specifying a default_response_class (#467) 2019-09-29 16:47:35 -05:00
Sebastián Ramírez
0c67022048 📝 Update release notes 2019-09-29 16:24:52 -05:00
dmontagu
d8fe307d61 Add support for strings and __future__ type annotations (#451)
* Add support for strings and __future__ annotations

* Add comments indicating reason for string annotations

* Fix ignores (including removing some unused ignores)
2019-09-29 16:19:09 -05:00
Sebastián Ramírez
580cf8f4e2 🔖 Release 0.38.1 2019-09-01 07:56:37 -05:00
Sebastián Ramírez
af390af77c 📝 Update release notes 2019-09-01 07:53:20 -05:00
Kamal Gill
4642f63a1e 🐛 Use proper import for Request -- fixes #492 (#493) 2019-09-01 07:51:42 -05:00
Sebastián Ramírez
203e10596f 🔖 Release version 0.38.0.Support for Pydantic 0.32.2 and Starlette 0.12.8 2019-08-30 20:40:50 -05:00
Sebastián Ramírez
5a2278d09a 📝 Update release notes 2019-08-30 20:37:39 -05:00
Sebastián Ramírez
47a8387a04 📝 Add recent articles and opinions (#490) 2019-08-30 20:35:34 -05:00
Sebastián Ramírez
27ca0c9dca 📝 Update release notes 2019-08-30 19:47:17 -05:00
dmontagu
9418d78de6 ⬆️ Upgrade Starlette support range to include 0.12.8 (#477) 2019-08-30 19:45:01 -05:00
Sebastián Ramírez
4b74aef429 📝 Update release notes 2019-08-30 19:34:34 -05:00
dmontagu
fc7d123347 ⬆️ Upgrade support to Pydantic version 0.32.2 (breaking change) (#463) 2019-08-30 19:30:03 -05:00
Sebastián Ramírez
53da56146e 🔖 Release version 0.37.0 2019-08-30 19:10:43 -05:00
Sebastián Ramírez
3799b9027e 📝 Update release notes 2019-08-30 19:09:12 -05:00
dmontagu
c70f3f1198 Add support for custom route class (#468) 2019-08-30 19:05:59 -05:00
Sebastián Ramírez
58dddc5e4f 📝 Update release notes 2019-08-30 19:02:29 -05:00
b1-luettje
c90c4fb6c1 Allow disabling Google fonts in ReDoc (#481) 2019-08-30 19:00:55 -05:00
Sebastián Ramírez
5b3df28f0c 📝 Update release notes 2019-08-30 18:59:08 -05:00
dmontagu
6c6bdb6233 🔒 Ensure skip_defaults doesn't cause extra fields to be serialized (#485) 2019-08-30 18:56:14 -05:00
Sebastián Ramírez
f156f45193 📝 Update release notes 2019-08-30 18:37:42 -05:00
Aliaksei Urbanski
f24d744a3b Enable tests for Python 3.8-dev (#465) 2019-08-30 18:34:49 -05:00
Sebastián Ramírez
937b462cdd 📝 Update release notes 2019-08-30 18:15:08 -05:00
dconathan
3025a368c6 Add support and tests for Pydantic dataclasses in response_model (#454) 2019-08-30 18:12:15 -05:00
Sebastián Ramírez
c218e0d560 📝 Update release notes 2019-08-30 17:40:14 -05:00
Pablo Marti
1ed5aa23e6 ✏️ Fix typo in oauth2-jwt.md (#447) 2019-08-30 17:35:52 -05:00
Sebastián Ramírez
106d2171d8 📝 Update release notes 2019-08-30 17:34:45 -05:00
Zoltan Papp
c5817912d2 🐛 use media_type from Body params for OpenAPI requestBody (Fixes: #431) (#439) 2019-08-30 17:32:39 -05:00
Sebastián Ramírez
a7a92bc637 📝 Update release notes 2019-08-30 17:02:40 -05:00
naxty
68d1fea961 📝 Add article: Deploying a scikit-learn model with ONNX and FastAPI (#438) 2019-08-30 17:00:00 -05:00
Sebastián Ramírez
8c6b2d5804 📝 Update release notes 2019-08-30 16:48:53 -05:00
Zoltan Papp
19c53b21c1 Allow using custom 422 validation error and use media type from response class in schema (#437)
* media_type of additional responses from the response_class

* Use HTTPValidationError only if a custom one is not defined (Fixes: #429)
2019-08-30 16:46:05 -05:00
Sebastián Ramírez
44d63cd555 📝 Update release notes 2019-08-30 16:36:18 -05:00
Sebastián Ramírez
55c4b5fb0b 🐛 Fix "default" extra response with extra status codes (#489)
* 🐛 Fix lowercase "default" extra response

* 🐛 Fix model for responses, to allow "default" plus status codes

*  Add test for "default" extra response
2019-08-30 16:34:47 -05:00
Sebastián Ramírez
c32e800c23 📝 Update release notes 2019-08-30 11:30:52 -05:00
Zoltan Papp
73dbbeab55 Allow additional responses to use status ranges and "default" (#435) 2019-08-30 11:17:42 -05:00
1859 changed files with 160991 additions and 9387 deletions

View File

@@ -0,0 +1,144 @@
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: 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.

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
github: [tiangolo]

View File

@@ -1,42 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a file with '...'
2. Add a path operation function with '....'
3. Open the browser and call it with a payload of '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Environment:**
- OS: [e.g. Linux / Windows / macOS]
- FastAPI Version [e.g. 0.3.0], get it with:
```Python
import fastapi
print(fastapi.__version__)
```
- Python version, get it with:
```bash
python --version
```
**Additional context**
Add any other context about the problem here.

16
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +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,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[FEATURE]"
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I want to be able to [...] but I can't because [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request 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,17 +0,0 @@
---
name: Question
about: Ask a question
title: "[QUESTION]"
labels: question
assignees: ''
---
**Description**
How can I [...]?
Is it possible to [...]?
**Additional context**
Add any other context or screenshots about the feature request here.

View File

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

View File

@@ -0,0 +1,13 @@
name: Comment Docs Preview in PR
description: Comment with the docs URL preview in the PR
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
deploy_url:
description: The deployment URL to comment in the PR
required: true
runs:
using: docker
image: Dockerfile

View File

@@ -0,0 +1,68 @@
import logging
import sys
from pathlib import Path
from typing import Union
import httpx
from github import Github
from github.PullRequest import PullRequest
from pydantic import BaseModel, BaseSettings, SecretStr, ValidationError
github_api = "https://api.github.com"
class Settings(BaseSettings):
github_repository: str
github_event_path: Path
github_event_name: Union[str, None] = None
input_token: SecretStr
input_deploy_url: str
class PartialGithubEventHeadCommit(BaseModel):
id: str
class PartialGithubEventWorkflowRun(BaseModel):
head_commit: PartialGithubEventHeadCommit
class PartialGithubEvent(BaseModel):
workflow_run: PartialGithubEventWorkflowRun
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)
try:
event = PartialGithubEvent.parse_file(settings.github_event_path)
except ValidationError as e:
logging.error(f"Error parsing event file: {e.errors()}")
sys.exit(0)
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}")
sys.exit(0)
github_headers = {
"Authorization": f"token {settings.input_token.get_secret_value()}"
}
url = f"{github_api}/repos/{settings.github_repository}/issues/{use_pr.number}/comments"
logging.info(f"Using comments URL: {url}")
response = httpx.post(
url,
headers=github_headers,
json={
"body": f"📝 Docs preview for commit {use_pr.head.sha} at: {settings.input_deploy_url}"
},
)
if not (200 <= response.status_code <= 300):
logging.error(f"Error posting comment: {response.text}")
sys.exit(1)
logging.info("Finished")

View File

@@ -0,0 +1,7 @@
FROM python:3.7
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")

7
.github/actions/people/Dockerfile vendored Normal file
View File

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

13
.github/actions/people/action.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: "Generate FastAPI People"
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 }}'
required: true
runs:
using: 'docker'
image: 'Dockerfile'

726
.github/actions/people/app/main.py vendored Normal file
View File

@@ -0,0 +1,726 @@
import logging
import subprocess
import sys
from collections import Counter, defaultdict
from datetime import datetime, timedelta, timezone
from pathlib import Path
from typing import Any, Container, DefaultDict, Dict, List, Set, Union
import httpx
import yaml
from github import Github
from pydantic import BaseModel, BaseSettings, SecretStr
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) {
repository(name: "fastapi", owner: "tiangolo") {
issues(first: 100, after: $after) {
edges {
cursor
node {
number
author {
login
avatarUrl
url
}
title
createdAt
state
comments(first: 100) {
nodes {
createdAt
author {
login
avatarUrl
url
}
}
}
}
}
}
}
}
"""
prs_query = """
query Q($after: String) {
repository(name: "fastapi", owner: "tiangolo") {
pullRequests(first: 100, after: $after) {
edges {
cursor
node {
number
labels(first: 100) {
nodes {
name
}
}
author {
login
avatarUrl
url
}
title
createdAt
state
comments(first: 100) {
nodes {
createdAt
author {
login
avatarUrl
url
}
}
}
reviews(first:100) {
nodes {
author {
login
avatarUrl
url
}
state
}
}
}
}
}
}
}
"""
sponsors_query = """
query Q($after: String) {
user(login: "tiangolo") {
sponsorshipsAsMaintainer(first: 100, after: $after) {
edges {
cursor
node {
sponsorEntity {
... on Organization {
login
avatarUrl
url
}
... on User {
login
avatarUrl
url
}
}
tier {
name
monthlyPriceInDollars
}
}
}
}
}
}
"""
class Author(BaseModel):
login: str
avatarUrl: str
url: str
# Issues and Discussions
class CommentsNode(BaseModel):
createdAt: datetime
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: 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
class Labels(BaseModel):
nodes: List[LabelNode]
class ReviewNode(BaseModel):
author: Union[Author, None] = None
state: str
class Reviews(BaseModel):
nodes: List[ReviewNode]
class PullRequestNode(BaseModel):
number: int
labels: Labels
author: Union[Author, None] = None
title: str
createdAt: datetime
state: str
comments: Comments
reviews: Reviews
class PullRequestEdge(BaseModel):
cursor: str
node: PullRequestNode
class PullRequests(BaseModel):
edges: List[PullRequestEdge]
class PRsRepository(BaseModel):
pullRequests: PullRequests
class PRsResponseData(BaseModel):
repository: PRsRepository
class PRsResponse(BaseModel):
data: PRsResponseData
# Sponsors
class SponsorEntity(BaseModel):
login: str
avatarUrl: str
url: str
class Tier(BaseModel):
name: str
monthlyPriceInDollars: float
class SponsorshipAsMaintainerNode(BaseModel):
sponsorEntity: SponsorEntity
tier: Tier
class SponsorshipAsMaintainerEdge(BaseModel):
cursor: str
node: SponsorshipAsMaintainerNode
class SponsorshipAsMaintainer(BaseModel):
edges: List[SponsorshipAsMaintainerEdge]
class SponsorsUser(BaseModel):
sponsorshipsAsMaintainer: SponsorshipAsMaintainer
class SponsorsResponseData(BaseModel):
user: SponsorsUser
class SponsorsResponse(BaseModel):
data: SponsorsResponseData
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: Union[str, None] = None,
category_id: Union[str, None] = None,
) -> Dict[str, Any]:
headers = {"Authorization": f"token {settings.input_token.get_secret_value()}"}
# 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 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 data
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)
return graphql_response.data.repository.issues.edges
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.parse_obj(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)
return graphql_response.data.repository.pullRequests.edges
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)
return graphql_response.data.user.sponsorshipsAsMaintainer.edges
def get_issues_experts(settings: Settings):
issue_nodes: List[IssuesNode] = []
issue_edges = get_graphql_issue_edges(settings=settings)
while issue_edges:
for edge in issue_edges:
issue_nodes.append(edge.node)
last_edge = issue_edges[-1]
issue_edges = get_graphql_issue_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 issue in issue_nodes:
issue_author_name = None
if issue.author:
authors[issue.author.login] = issue.author
issue_author_name = issue.author.login
issue_commentors = set()
for comment in issue.comments.nodes:
if comment.author:
authors[comment.author.login] = comment.author
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
def get_contributors(settings: Settings):
pr_nodes: List[PullRequestNode] = []
pr_edges = get_graphql_pr_edges(settings=settings)
while pr_edges:
for edge in pr_edges:
pr_nodes.append(edge.node)
last_edge = pr_edges[-1]
pr_edges = get_graphql_pr_edges(settings=settings, after=last_edge.cursor)
contributors = Counter()
commentors = Counter()
reviewers = Counter()
authors: Dict[str, Author] = {}
for pr in pr_nodes:
author_name = None
if pr.author:
authors[pr.author.login] = pr.author
author_name = pr.author.login
pr_commentors: Set[str] = set()
pr_reviewers: Set[str] = set()
for comment in pr.comments.nodes:
if comment.author:
authors[comment.author.login] = comment.author
if comment.author.login == author_name:
continue
pr_commentors.add(comment.author.login)
for author_name in pr_commentors:
commentors[author_name] += 1
for review in pr.reviews.nodes:
if review.author:
authors[review.author.login] = review.author
pr_reviewers.add(review.author.login)
for reviewer in pr_reviewers:
reviewers[reviewer] += 1
if pr.state == "MERGED" and pr.author:
contributors[pr.author.login] += 1
return contributors, commentors, reviewers, authors
def get_individual_sponsors(settings: Settings):
nodes: List[SponsorshipAsMaintainerNode] = []
edges = get_graphql_sponsor_edges(settings=settings)
while edges:
for edge in edges:
nodes.append(edge.node)
last_edge = edges[-1]
edges = get_graphql_sponsor_edges(settings=settings, after=last_edge.cursor)
tiers: DefaultDict[float, Dict[str, SponsorEntity]] = defaultdict(dict)
for node in nodes:
tiers[node.tier.monthlyPriceInDollars][
node.sponsorEntity.login
] = node.sponsorEntity
return tiers
def get_top_users(
*,
counter: Counter,
min_count: int,
authors: Dict[str, Author],
skip_users: Container[str],
):
users = []
for commentor, count in counter.most_common(50):
if commentor in skip_users:
continue
if count >= min_count:
author = authors[commentor]
users.append(
{
"login": commentor,
"count": count,
"avatarUrl": author.avatarUrl,
"url": author.url,
}
)
return 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())
repo = g.get_repo(settings.github_repository)
question_commentors, question_last_month_commentors, question_authors = get_experts(
settings=settings
)
contributors, pr_commentors, reviewers, pr_authors = get_contributors(
settings=settings
)
authors = {**question_authors, **pr_authors}
maintainers_logins = {"tiangolo"}
bot_names = {"codecov", "github-actions", "pre-commit-ci", "dependabot"}
maintainers = []
for login in maintainers_logins:
user = authors[login]
maintainers.append(
{
"login": login,
"answers": question_commentors[login],
"prs": contributors[login],
"avatarUrl": user.avatarUrl,
"url": user.url,
}
)
min_count_expert = 10
min_count_last_month = 3
min_count_contributor = 4
min_count_reviewer = 4
skip_users = maintainers_logins | bot_names
experts = get_top_users(
counter=question_commentors,
min_count=min_count_expert,
authors=authors,
skip_users=skip_users,
)
last_month_active = get_top_users(
counter=question_last_month_commentors,
min_count=min_count_last_month,
authors=authors,
skip_users=skip_users,
)
top_contributors = get_top_users(
counter=contributors,
min_count=min_count_contributor,
authors=authors,
skip_users=skip_users,
)
top_reviewers = get_top_users(
counter=reviewers,
min_count=min_count_reviewer,
authors=authors,
skip_users=skip_users,
)
tiers = get_individual_sponsors(settings=settings)
keys = list(tiers.keys())
keys.sort(reverse=True)
sponsors = []
for key in keys:
sponsor_group = []
for login, sponsor in tiers[key].items():
sponsor_group.append(
{"login": login, "avatarUrl": sponsor.avatarUrl, "url": sponsor.url}
)
sponsors.append(sponsor_group)
people = {
"maintainers": maintainers,
"experts": experts,
"last_month_active": last_month_active,
"top_contributors": top_contributors,
"top_reviewers": top_reviewers,
}
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")
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_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(
["git", "config", "user.email", "github-actions@github.com"], check=True
)
branch_name = "fastapi-people"
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), str(github_sponsors_path)], check=True
)
logging.info("Committing updated file")
message = "👥 Update FastAPI People"
result = subprocess.run(["git", "commit", "-m", message], check=True)
logging.info("Pushing branch")
subprocess.run(["git", "push", "origin", branch_name], check=True)
logging.info("Creating PR")
pr = repo.create_pull(title=message, body=message, base="master", head=branch_name)
logging.info(f"Created PR: {pr.number}")
logging.info("Finished")

View File

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

View File

@@ -0,0 +1,10 @@
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

@@ -0,0 +1,101 @@
import logging
from datetime import datetime
from pathlib import Path
from typing import List, Union
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: Union[str, None] = 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: Union[Artifact, None] = 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")

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

@@ -0,0 +1,16 @@
version: 2
updates:
# GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix:
# Python
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix:

49
.github/workflows/build-docs.yml vendored Normal file
View File

@@ -0,0 +1,49 @@
name: Build Docs
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize]
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
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') }}-v03
- name: Install docs extras
if: steps.cache.outputs.cache-hit != 'true'
run: pip install .[doc]
- name: Install Material for MkDocs Insiders
if: ( github.event_name != 'pull_request' || 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
- name: Build Docs
run: python ./scripts/docs.py build-all
- name: Zip docs
run: bash ./scripts/zip-docs.sh
- uses: actions/upload-artifact@v3
with:
name: docs-zip
path: ./site/docs.zip
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v2.0.0
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 }}

30
.github/workflows/issue-manager.yml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Issue Manager
on:
schedule:
- cron: "0 0 * * *"
issue_comment:
types:
- created
issues:
types:
- labeled
pull_request_target:
types:
- labeled
workflow_dispatch:
jobs:
issue-manager:
runs-on: ubuntu-latest
steps:
- uses: tiangolo/issue-manager@0.4.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
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."
}
}

13
.github/workflows/label-approved.yml vendored Normal file
View File

@@ -0,0 +1,13 @@
name: Label Approved
on:
schedule:
- cron: "0 12 * * *"
jobs:
label-approved:
runs-on: ubuntu-latest
steps:
- uses: docker://tiangolo/label-approved:0.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}

40
.github/workflows/latest-changes.yml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: Latest Changes
on:
pull_request_target:
branches:
- master
types:
- 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:
latest-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
# To allow latest-changes to commit to master
token: ${{ secrets.ACTIONS_TOKEN }}
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
with:
limit-access-to-actor: true
token: ${{ secrets.ACTIONS_TOKEN }}
standard_token: ${{ secrets.GITHUB_TOKEN }}
- uses: docker://tiangolo/latest-changes:0.0.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
latest_changes_file: docs/en/docs/release-notes.md
latest_changes_header: '## Latest Changes\n\n'
debug_logs: true

View File

@@ -0,0 +1,22 @@
name: Notify Translations
on:
pull_request_target:
types:
- labeled
- closed
jobs:
notify-translations:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Allow debugging with tmate
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
with:
limit-access-to-actor: true
- uses: ./.github/actions/notify-translations
with:
token: ${{ secrets.GITHUB_TOKEN }}

32
.github/workflows/people.yml vendored Normal file
View File

@@ -0,0 +1,32 @@
name: FastAPI People
on:
schedule:
- cron: "0 14 1 * *"
workflow_dispatch:
inputs:
debug_enabled:
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
fastapi-people:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# 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 }}
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 }}

46
.github/workflows/preview-docs.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: Preview Docs
on:
workflow_run:
workflows:
- Build Docs
types:
- completed
jobs:
preview-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Clean site
run: |
rm -rf ./site
mkdir ./site
- name: Download Artifact Docs
uses: dawidd6/action-download-artifact@v2.26.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: build-docs.yml
run_id: ${{ github.event.workflow_run.id }}
name: docs-zip
path: ./site/
- name: Unzip docs
run: |
cd ./site
unzip docs.zip
rm -f docs.zip
- name: Deploy to Netlify
id: netlify
uses: nwtgck/actions-netlify@v2.0.0
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 }}"

46
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,46 @@
name: Publish
on:
release:
types:
- created
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
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 build dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install build
- name: Build distribution
run: python -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.6.4
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

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

@@ -0,0 +1,35 @@
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:
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- run: pip install smokeshow
- uses: dawidd6/action-download-artifact@v2.26.0
with:
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.GITHUB_TOKEN }}
SMOKESHOW_GITHUB_PR_HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
SMOKESHOW_AUTH_KEY: ${{ secrets.SMOKESHOW_AUTH_KEY }}

93
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,93 @@
name: Test
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
fail-fast: false
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
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-v03
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: pip install -e .[all,dev,doc,test]
- name: Lint
run: bash scripts/lint.sh
- run: mkdir coverage
- name: Test
run: bash scripts/test.sh
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:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.8'
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: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}

10
.gitignore vendored
View File

@@ -13,3 +13,13 @@ coverage.xml
test.db
log.txt
Pipfile.lock
env3.*
env
docs_build
venv
docs.zip
archive.zip
# vim temporary files
*~
.*.sw?

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

@@ -0,0 +1,46 @@
# 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/asottile/pyupgrade
rev: v3.3.1
hooks:
- id: pyupgrade
args:
- --py3-plus
- --keep-runtime-typing
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.254
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (python)
- id: isort
name: isort (cython)
types: [cython]
- id: isort
name: isort (pyi)
types: [pyi]
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
ci:
autofix_commit_msg: 🎨 [pre-commit.ci] Auto format from pre-commit.com hooks
autoupdate_commit_msg: ⬆ [pre-commit.ci] pre-commit autoupdate

View File

@@ -1,26 +0,0 @@
dist: xenial
language: python
cache: pip
python:
- "3.6"
- "3.7"
install:
- pip install flit
- flit install --symlink
script:
- bash scripts/test.sh
after_script:
- bash <(curl -s https://codecov.io/bash)
deploy:
provider: script
script: bash scripts/deploy.sh
on:
tags: true
python: "3.6"

37
Pipfile
View File

@@ -1,37 +0,0 @@
[[source]]
name = "pypi"
url = "https://pypi.org/simple"
verify_ssl = true
[dev-packages]
mypy = "*"
black = "*"
jupyter = "*"
better-exceptions = "*"
pytest = "*"
pytest-cov = "*"
isort = "*"
requests = "*"
flit = "*"
mkdocs = "*"
mkdocs-material = "*"
markdown-include = "*"
autoflake = "*"
email-validator = "*"
ujson = "*"
flake8 = "*"
python-multipart = "*"
sqlalchemy = "*"
uvicorn = "*"
[packages]
starlette = "==0.12.7"
pydantic = "==0.30.0"
databases = {extras = ["sqlite"],version = "*"}
hypercorn = "*"
[requires]
python_version = "3.6"
[pipenv]
allow_prereleases = true

191
README.md
View File

@@ -5,17 +5,17 @@
<em>FastAPI framework, high performance, easy to learn, fast to code, ready for production</em>
</p>
<p align="center">
<a href="https://travis-ci.org/tiangolo/fastapi" target="_blank">
<img src="https://travis-ci.org/tiangolo/fastapi.svg?branch=master" alt="Build Status">
<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://codecov.io/gh/tiangolo/fastapi/branch/master/graph/badge.svg" 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://badge.fury.io/py/fastapi.svg" alt="Package version">
<img src="https://img.shields.io/pypi/v/fastapi?color=%2334D058&label=pypi%20package" alt="Package version">
</a>
<a href="https://gitter.im/tiangolo/fastapi?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge" target="_blank">
<img src="https://badges.gitter.im/tiangolo/fastapi.svg" alt="Join the chat at https://gitter.im/tiangolo/fastapi">
<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>
@@ -27,67 +27,126 @@
---
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.7+ 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% *.
* **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.
* **Easy**: Designed to be easy to use and learn. Less time reading docs.
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
* **Robust**: Get production-ready code. With automatic interactive documentation.
* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: <a href="https://github.com/OAI/OpenAPI-Specification" target="_blank">OpenAPI</a> (previously known as Swagger) and <a href="http://json-schema.org/" target="_blank">JSON Schema</a>.
* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a> (previously known as Swagger) and <a href="https://json-schema.org/" class="external-link" target="_blank">JSON Schema</a>.
<small>* estimation based on tests on an internal development team, building production applications.</small>
## Sponsors
<!-- 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://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://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://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://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://databento.com/" target="_blank" title="Pay as you go for market data"><img src="https://fastapi.tiangolo.com/img/sponsors/databento.svg"></a>
<!-- /sponsors -->
<a href="https://fastapi.tiangolo.com/fastapi-people/#sponsors" class="external-link" target="_blank">Other sponsors</a>
## Opinions
"*[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products.*"
"_[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products._"
<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/tiangolo/fastapi/pull/26" target="_blank"><small>(ref)</small></a></div>
---
"*Im over the moon excited about **FastAPI**. Its so fun!*"
"_We adopted the **FastAPI** library to spawn a **REST** server that can be queried to obtain **predictions**. [for Ludwig]_"
<div style="text-align: right; margin-right: 10%;">Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/" target="_blank"><small>(ref)</small></a></div>
---
"_**Netflix** is pleased to announce the open-source release of our **crisis management** orchestration framework: **Dispatch**! [built with **FastAPI**]_"
<div style="text-align: right; margin-right: 10%;">Kevin Glisson, Marc Vilanova, Forest Monsen - <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072" target="_blank"><small>(ref)</small></a></div>
---
"_Im over the moon excited about **FastAPI**. Its so fun!_"
<div style="text-align: right; margin-right: 10%;">Brian Okken - <strong><a href="https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855" target="_blank">Python Bytes</a> podcast host</strong> <a href="https://twitter.com/brianokken/status/1112220079972728832" target="_blank"><small>(ref)</small></a></div>
---
"*Honestly, what you've built looks super solid and polished. In many ways, it's what I wanted **Hug** to be - it's really inspiring to see someone build that.*"
"_Honestly, what you've built looks super solid and polished. In many ways, it's what I wanted **Hug** to be - it's really inspiring to see someone build that._"
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong><a href="http://www.hug.rest/" target="_blank">Hug</a> creator</strong> <a href="https://news.ycombinator.com/item?id=19455465" target="_blank"><small>(ref)</small></a></div>
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong><a href="https://www.hug.rest/" target="_blank">Hug</a> creator</strong> <a href="https://news.ycombinator.com/item?id=19455465" target="_blank"><small>(ref)</small></a></div>
---
"_If you're looking to learn one **modern framework** for building REST APIs, check out **FastAPI** [...] It's fast, easy to use and easy to learn [...]_"
"_We've switched over to **FastAPI** for our **APIs** [...] I think you'll like it [...]_"
<div style="text-align: right; margin-right: 10%;">Ines Montani - Matthew Honnibal - <strong><a href="https://explosion.ai" target="_blank">Explosion AI</a> founders - <a href="https://spacy.io" target="_blank">spaCy</a> creators</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>
---
"_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>
If you are building a <abbr title="Command Line Interface">CLI</abbr> app to be used in the terminal instead of a web API, check out <a href="https://typer.tiangolo.com/" class="external-link" target="_blank">**Typer**</a>.
**Typer** is FastAPI's little sibling. And it's intended to be the **FastAPI of CLIs**. ⌨️ 🚀
## Requirements
Python 3.6+
Python 3.7+
FastAPI stands on the shoulders of giants:
* <a href="https://www.starlette.io/" target="_blank">Starlette</a> for the web parts.
* <a href="https://pydantic-docs.helpmanual.io/" target="_blank">Pydantic</a> for the data parts.
* <a href="https://www.starlette.io/" class="external-link" target="_blank">Starlette</a> for the web parts.
* <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> for the data parts.
## Installation
```bash
<div class="termy">
```console
$ pip install fastapi
---> 100%
```
You will also need an ASGI server, for production such as <a href="http://www.uvicorn.org" target="_blank">Uvicorn</a> or <a href="https://gitlab.com/pgjones/hypercorn" target="_blank">Hypercorn</a>.
</div>
```bash
$ pip install uvicorn
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]"
---> 100%
```
</div>
## Example
### Create it
@@ -95,6 +154,8 @@ $ pip install uvicorn
* Create a file `main.py` with:
```Python
from typing import Union
from fastapi import FastAPI
app = FastAPI()
@@ -106,15 +167,18 @@ def read_root():
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
```
<details markdown="1">
<summary>Or use <code>async def</code>...</summary>
If your code uses `async` / `await`, use `async def`:
```Python hl_lines="7 12"
```Python hl_lines="9 14"
from typing import Union
from fastapi import FastAPI
app = FastAPI()
@@ -126,12 +190,12 @@ async def read_root():
@app.get("/items/{item_id}")
async def read_item(item_id: int, q: str = None):
async def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
```
**Note**:
If you don't know, check the _"In a hurry?"_ section about <a href="https://fastapi.tiangolo.com/async/#in-a-hurry" target="_blank">`async` and `await` in the docs</a>.
</details>
@@ -140,10 +204,20 @@ If you don't know, check the _"In a hurry?"_ section about <a href="https://fast
Run the server with:
```bash
uvicorn main:app --reload
<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>About the command <code>uvicorn main:app --reload</code>...</summary>
@@ -157,7 +231,7 @@ The command `uvicorn main:app` refers to:
### Check it
Open your browser at <a href="http://127.0.0.1:8000/items/5?q=somequery" target="_blank">http://127.0.0.1:8000/items/5?q=somequery</a>.
Open your browser at <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>.
You will see the JSON response as:
@@ -174,18 +248,17 @@ You already created an API that:
### Interactive API docs
Now go to <a href="http://127.0.0.1:8000/docs" target="_blank">http://127.0.0.1:8000/docs</a>.
Now go to <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
You will see the automatic interactive API documentation (provided by <a href="https://github.com/swagger-api/swagger-ui" target="_blank">Swagger UI</a>):
You will see the automatic interactive API documentation (provided by <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 docs
And now, go to <a href="http://127.0.0.1:8000/redoc" target="_blank">http://127.0.0.1:8000/redoc</a>.
And now, go to <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
You will see the alternative automatic documentation (provided by <a href="https://github.com/Rebilly/ReDoc" target="_blank">ReDoc</a>):
You will see the alternative automatic documentation (provided by <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)
@@ -195,8 +268,9 @@ 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 Union
```Python hl_lines="2 7 8 9 10 24"
from fastapi import FastAPI
from pydantic import BaseModel
@@ -206,7 +280,7 @@ app = FastAPI()
class Item(BaseModel):
name: str
price: float
is_offer: bool = None
is_offer: Union[bool, None] = None
@app.get("/")
@@ -215,7 +289,7 @@ def read_root():
@app.get("/items/{item_id}")
def read_item(item_id: int, q: str = None):
def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
@@ -228,7 +302,7 @@ The server should reload automatically (because you added `--reload` to the `uvi
### Interactive API docs upgrade
Now go to <a href="http://127.0.0.1:8000/docs" target="_blank">http://127.0.0.1:8000/docs</a>.
Now go to <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
* The interactive API documentation will be automatically updated, including the new body:
@@ -242,25 +316,23 @@ Now go to <a href="http://127.0.0.1:8000/docs" target="_blank">http://127.0.0.1:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png)
### Alternative API docs upgrade
And now, go to <a href="http://127.0.0.1:8000/redoc" target="_blank">http://127.0.0.1:8000/redoc</a>.
And now, go to <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
* The alternative documentation will also reflect the new query parameter and body:
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
### 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.7+**.
For example, for an `int`:
@@ -311,8 +383,8 @@ 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 is has a required attribute `price` that has to be a `float`.
* 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.
* Convert from and to JSON automatically.
@@ -321,7 +393,6 @@ Coming back to the previous code example, **FastAPI** will:
* Automatic client code generation systems, for many languages.
* Provide 2 interactive documentation web interfaces directly.
---
We just scratched the surface, but you already get the idea of how it all works.
@@ -348,8 +419,7 @@ Try changing the line with:
![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
For a more complete example including more features, see the <a href="https://fastapi.tiangolo.com/tutorial/intro/">Tutorial - User Guide</a>.
For a more complete example including more features, see the <a href="https://fastapi.tiangolo.com/tutorial/">Tutorial - User Guide</a>.
**Spoiler alert**: the tutorial - user guide includes:
@@ -358,20 +428,19 @@ 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.
## Performance
Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as <a href="https://www.techempower.com/benchmarks/#section=test&runid=7464e520-0dc2-473d-bd34-dbdfd7e85911&hw=ph&test=query&l=zijzen-7" target="_blank">one of the fastest Python frameworks available</a>, only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)
Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as <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">one of the fastest Python frameworks available</a>, only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)
To understand more about it, see the section <a href="https://fastapi.tiangolo.com/benchmarks/" target="_blank">Benchmarks</a>.
To understand more about it, see the section <a href="https://fastapi.tiangolo.com/benchmarks/" class="internal-link" target="_blank">Benchmarks</a>.
## Optional Dependencies
@@ -380,23 +449,21 @@ 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.
Used by Starlette:
* <a href="http://docs.python-requests.org" 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="http://jinja.pocoo.org" target="_blank"><code>jinja2</code></a> - Required if you want to use the default template configuration.
* <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 `SchemaGenerator` support.
* <a href="https://graphene-python.org/" target="_blank"><code>graphene</code></a> - Required for `GraphQLApp` 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://github.com/esnme/ultrajson" target="_blank"><code>ujson</code></a> - Required if you want to use `UJSONResponse`.
Used by FastAPI / Starlette:
* <a href="http://www.uvicorn.org" target="_blank"><code>uvicorn</code></a> - for the server that loads and serves your application.
* <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 `pip3 install fastapi[all]`.
You can install all of these with `pip install "fastapi[all]"`.
## License

31
SECURITY.md Normal file
View File

@@ -0,0 +1,31 @@
# Security Policy
Security is very important for FastAPI and its community. 🔒
Learn more about it below. 👇
## Versions
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**.
You can learn more about [FastAPI versions and how to pin and upgrade them](https://fastapi.tiangolo.com/deployment/versions/) for your project in the docs.
## Reporting a Vulnerability
If you think you found a vulnerability, and even if you are not sure about it, please report it right away by sending an email to: security@tiangolo.com. Please try to be as explicit as possible, describing all the steps and example code to reproduce the security issue.
I (the author, [@tiangolo](https://twitter.com/tiangolo)) will review it thoroughly and get back to you.
## Public Discussions
Please restrain from publicly discussing a potential security vulnerability. 🙊
It's better to discuss privately and try to find a solution first, to limit the potential impact as much as possible.
---
Thanks for your help!
The FastAPI community and I thank you for that. 🙇

466
docs/az/docs/index.md Normal file
View File

@@ -0,0 +1,466 @@
{!../../../docs/missing-translation.md!}
<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 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>
<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>
---
**Documentation**: <a href="https://fastapi.tiangolo.com" target="_blank">https://fastapi.tiangolo.com</a>
**Source Code**: <a href="https://github.com/tiangolo/fastapi" target="_blank">https://github.com/tiangolo/fastapi</a>
---
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ 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.
* **Easy**: Designed to be easy to use and learn. Less time reading docs.
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
* **Robust**: Get production-ready code. With automatic interactive documentation.
* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a> (previously known as Swagger) and <a href="https://json-schema.org/" class="external-link" target="_blank">JSON Schema</a>.
<small>* estimation based on tests on an internal development team, building production applications.</small>
## Sponsors
<!-- 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">Other sponsors</a>
## Opinions
"_[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products._"
<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/tiangolo/fastapi/pull/26" target="_blank"><small>(ref)</small></a></div>
---
"_We adopted the **FastAPI** library to spawn a **REST** server that can be queried to obtain **predictions**. [for Ludwig]_"
<div style="text-align: right; margin-right: 10%;">Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/" target="_blank"><small>(ref)</small></a></div>
---
"_**Netflix** is pleased to announce the open-source release of our **crisis management** orchestration framework: **Dispatch**! [built with **FastAPI**]_"
<div style="text-align: right; margin-right: 10%;">Kevin Glisson, Marc Vilanova, Forest Monsen - <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072" target="_blank"><small>(ref)</small></a></div>
---
"_Im over the moon excited about **FastAPI**. Its so fun!_"
<div style="text-align: right; margin-right: 10%;">Brian Okken - <strong><a href="https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855" target="_blank">Python Bytes</a> podcast host</strong> <a href="https://twitter.com/brianokken/status/1112220079972728832" target="_blank"><small>(ref)</small></a></div>
---
"_Honestly, what you've built looks super solid and polished. In many ways, it's what I wanted **Hug** to be - it's really inspiring to see someone build that._"
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong><a href="https://www.hug.rest/" target="_blank">Hug</a> creator</strong> <a href="https://news.ycombinator.com/item?id=19455465" target="_blank"><small>(ref)</small></a></div>
---
"_If you're looking to learn one **modern framework** for building REST APIs, check out **FastAPI** [...] It's fast, easy to use and easy to learn [...]_"
"_We've switched over to **FastAPI** for our **APIs** [...] I think you'll like it [...]_"
<div style="text-align: right; margin-right: 10%;">Ines Montani - Matthew Honnibal - <strong><a href="https://explosion.ai" target="_blank">Explosion AI</a> founders - <a href="https://spacy.io" target="_blank">spaCy</a> creators</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**, 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>
If you are building a <abbr title="Command Line Interface">CLI</abbr> app to be used in the terminal instead of a web API, check out <a href="https://typer.tiangolo.com/" class="external-link" target="_blank">**Typer**</a>.
**Typer** is FastAPI's little sibling. And it's intended to be the **FastAPI of CLIs**. ⌨️ 🚀
## Requirements
Python 3.7+
FastAPI stands on the shoulders of giants:
* <a href="https://www.starlette.io/" class="external-link" target="_blank">Starlette</a> for the web parts.
* <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> for the data parts.
## Installation
<div class="termy">
```console
$ pip install fastapi
---> 100%
```
</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>.
<div class="termy">
```console
$ pip install "uvicorn[standard]"
---> 100%
```
</div>
## Example
### Create it
* Create a file `main.py` with:
```Python
from typing import Optional
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: Optional[str] = None):
return {"item_id": item_id, "q": q}
```
<details markdown="1">
<summary>Or use <code>async def</code>...</summary>
If your code uses `async` / `await`, use `async def`:
```Python hl_lines="9 14"
from typing import Optional
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: Optional[str] = None):
return {"item_id": item_id, "q": q}
```
**Note**:
If you don't know, check the _"In a hurry?"_ section about <a href="https://fastapi.tiangolo.com/async/#in-a-hurry" target="_blank">`async` and `await` in the docs</a>.
</details>
### Run it
Run the server with:
<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>About the command <code>uvicorn main:app --reload</code>...</summary>
The command `uvicorn main:app` refers to:
* `main`: the file `main.py` (the Python "module").
* `app`: the object created inside of `main.py` with the line `app = FastAPI()`.
* `--reload`: make the server restart after code changes. Only do this for development.
</details>
### Check it
Open your browser at <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>.
You will see the JSON response as:
```JSON
{"item_id": 5, "q": "somequery"}
```
You already created an API that:
* Receives HTTP requests in the _paths_ `/` and `/items/{item_id}`.
* Both _paths_ take `GET` <em>operations</em> (also known as HTTP _methods_).
* The _path_ `/items/{item_id}` has a _path parameter_ `item_id` that should be an `int`.
* The _path_ `/items/{item_id}` has an optional `str` _query parameter_ `q`.
### Interactive API docs
Now go to <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
You will see the automatic interactive API documentation (provided by <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 docs
And now, go to <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
You will see the alternative automatic documentation (provided by <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)
## Example upgrade
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 fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
price: float
is_offer: Optional[bool] = None
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = 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}
```
The server should reload automatically (because you added `--reload` to the `uvicorn` command above).
### Interactive API docs upgrade
Now go to <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
* The interactive API documentation will be automatically updated, including the new body:
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
* Click on the button "Try it out", it allows you to fill the parameters and directly interact with the API:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png)
* Then click on the "Execute" button, the user interface will communicate with your API, send the parameters, get the results and show them on the screen:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png)
### Alternative API docs upgrade
And now, go to <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
* The alternative documentation will also reflect the new query parameter and body:
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
### Recap
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+**.
For example, for an `int`:
```Python
item_id: int
```
or for a more complex `Item` model:
```Python
item: Item
```
...and with that single declaration you get:
* Editor support, including:
* Completion.
* Type checks.
* Validation of data:
* Automatic and clear errors when the data is invalid.
* Validation even for deeply nested JSON objects.
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of input data: coming from the network to Python data and types. Reading from:
* JSON.
* Path parameters.
* Query parameters.
* Cookies.
* Headers.
* Forms.
* Files.
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of output data: converting from Python data and types to network data (as JSON):
* Convert Python types (`str`, `int`, `float`, `bool`, `list`, etc).
* `datetime` objects.
* `UUID` objects.
* Database models.
* ...and many more.
* Automatic interactive API documentation, including 2 alternative user interfaces:
* Swagger UI.
* ReDoc.
---
Coming back to the previous code example, **FastAPI** will:
* Validate that there is an `item_id` in the path for `GET` and `PUT` requests.
* Validate that the `item_id` is of type `int` for `GET` and `PUT` requests.
* If it is not, the client will see a useful, clear error.
* Check if there is an optional query parameter named `q` (as in `http://127.0.0.1:8000/items/foo?q=somequery`) for `GET` requests.
* 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 `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.
* Convert from and to JSON automatically.
* Document everything with OpenAPI, that can be used by:
* Interactive documentation systems.
* Automatic client code generation systems, for many languages.
* Provide 2 interactive documentation web interfaces directly.
---
We just scratched the surface, but you already get the idea of how it all works.
Try changing the line with:
```Python
return {"item_name": item.name, "item_id": item_id}
```
...from:
```Python
... "item_name": item.name ...
```
...to:
```Python
... "item_price": item.price ...
```
...and see how your editor will auto-complete the attributes and know their types:
![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
For a more complete example including more features, see the <a href="https://fastapi.tiangolo.com/tutorial/">Tutorial - User Guide</a>.
**Spoiler alert**: the tutorial - user guide includes:
* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**.
* How to set **validation constraints** as `maximum_length` or `regex`.
* 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).
* Many extra features (thanks to Starlette) as:
* **WebSockets**
* **GraphQL**
* extremely easy tests based on `requests` and `pytest`
* **CORS**
* **Cookie Sessions**
* ...and more.
## Performance
Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as <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">one of the fastest Python frameworks available</a>, only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)
To understand more about it, see the section <a href="https://fastapi.tiangolo.com/benchmarks/" class="internal-link" target="_blank">Benchmarks</a>.
## Optional Dependencies
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.
Used by Starlette:
* <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]`.
## License
This project is licensed under the terms of the MIT license.

154
docs/az/mkdocs.yml Normal file
View File

@@ -0,0 +1,154 @@
site_name: FastAPI
site_description: FastAPI framework, high performance, easy to learn, fast to code, ready for production
site_url: https://fastapi.tiangolo.com/az/
theme:
name: material
custom_dir: overrides
palette:
- media: '(prefers-color-scheme: light)'
scheme: default
primary: teal
accent: amber
toggle:
icon: material/lightbulb
name: Switch to light mode
- media: '(prefers-color-scheme: dark)'
scheme: slate
primary: teal
accent: amber
toggle:
icon: material/lightbulb-outline
name: Switch to dark mode
features:
- search.suggest
- search.highlight
- content.tabs.link
icon:
repo: fontawesome/brands/github-alt
logo: https://fastapi.tiangolo.com/img/icon-white.svg
favicon: https://fastapi.tiangolo.com/img/favicon.png
language: en
repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
- FastAPI: index.md
- Languages:
- en: /
- az: /az/
- de: /de/
- em: /em/
- es: /es/
- fa: /fa/
- fr: /fr/
- he: /he/
- hy: /hy/
- id: /id/
- it: /it/
- ja: /ja/
- ko: /ko/
- nl: /nl/
- pl: /pl/
- pt: /pt/
- ru: /ru/
- sq: /sq/
- sv: /sv/
- ta: /ta/
- tr: /tr/
- uk: /uk/
- zh: /zh/
markdown_extensions:
- toc:
permalink: true
- markdown.extensions.codehilite:
guess_lang: false
- mdx_include:
base_path: docs
- admonition
- codehilite
- extra
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format ''
- pymdownx.tabbed:
alternate_style: true
- attr_list
- md_in_html
extra:
analytics:
provider: google
property: G-YNEVN69SC3
social:
- icon: fontawesome/brands/github-alt
link: https://github.com/tiangolo/fastapi
- icon: fontawesome/brands/discord
link: https://discord.gg/VQjSZaeJmf
- icon: fontawesome/brands/twitter
link: https://twitter.com/fastapi
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/in/tiangolo
- icon: fontawesome/brands/dev
link: https://dev.to/tiangolo
- icon: fontawesome/brands/medium
link: https://medium.com/@tiangolo
- icon: fontawesome/solid/globe
link: https://tiangolo.com
alternate:
- link: /
name: en - English
- link: /az/
name: az
- link: /de/
name: de
- link: /em/
name: 😉
- link: /es/
name: es - español
- link: /fa/
name: fa
- link: /fr/
name: fr - français
- link: /he/
name: he
- link: /hy/
name: hy
- link: /id/
name: id
- link: /it/
name: it - italiano
- link: /ja/
name: ja - 日本語
- link: /ko/
name: ko - 한국어
- link: /nl/
name: nl
- link: /pl/
name: pl
- link: /pt/
name: pt - português
- link: /ru/
name: ru - русский язык
- link: /sq/
name: sq - shqip
- link: /sv/
name: sv - svenska
- link: /ta/
name: ta - தமிழ்
- link: /tr/
name: tr - Türkçe
- link: /uk/
name: uk - українська мова
- link: /zh/
name: zh - 汉语
extra_css:
- https://fastapi.tiangolo.com/css/termynal.css
- https://fastapi.tiangolo.com/css/custom.css
extra_javascript:
- https://fastapi.tiangolo.com/js/termynal.js
- https://fastapi.tiangolo.com/js/custom.js

View File

@@ -1,123 +0,0 @@
First, you might want to see the basic ways to <a href="https://fastapi.tiangolo.com/help-fastapi/" target="_blank">help FastAPI and get help</a>.
## Developing
If you already cloned the repository and you know that you need to deep dive in the code, here are some guidelines to set up your environment.
### Pipenv
If you are using <a href="https://pipenv.readthedocs.io/en/latest/" target="_blank">Pipenv</a>, you can create a virtual environment and install the packages with:
```bash
pipenv install --dev
```
Then you can activate that virtual environment with:
```bash
pipenv shell
```
### No Pipenv
If you are not using Pipenv, you can create a virtual environment with your preferred tool, and install the packages listed in the file `Pipfile`.
### Flit
**FastAPI** uses <a href="https://flit.readthedocs.io/en/latest/index.html" target="_blank">Flit</a> to build, package and publish the project.
If you installed the development dependencies with one of the methods above, you already have the `flit` command.
To install your local version of FastAPI as a package in your local environment, run:
```bash
flit install --symlink
```
It will install your local FastAPI in your local environment.
#### Using your local FastAPI
If you create a Python file that imports and uses FastAPI, and run it with the Python from your local environment, it will use your local FastAPI source code.
And if you update that local FastAPI source code, as it is installed with `--symlink`, when you run that Python file again, it will use the fresh version of FastAPI you just edited.
That way, you don't have to "install" your local version to be able to test every change.
### Format
There is a script that you can run that will format and clean all your code:
```bash
bash scripts/lint.sh
```
It will also auto-sort all your imports.
For it to sort them correctly, you need to have FastAPI installed locally in your environment, with the command in the section above:
```bash
flit install --symlink
```
### Docs
The documentation uses <a href="https://www.mkdocs.org/" target="_blank">MkDocs</a>.
All the documentation is in Markdown format in the directory `./docs`.
Many of the tutorials have blocks of code.
In most of the cases, these blocks of code are actual complete applications that can be run as is.
In fact, those blocks of code are not written inside the Markdown, they are Python files in the `./docs/src/` directory.
And those Python files are included/injected in the documentation when generating the site.
#### Docs for tests
Most of the tests actually run against the example source files in the documentation.
This helps making sure that:
* The documentation is up to date.
* The documentation examples can be run as is.
* Most of the features are covered by the documentation, ensured by the coverage tests.
During local development, there is a script that builds the site and checks for any changes, live-reloading:
```bash
bash scripts/docs-live.sh
```
It will serve the documentation on `http://0.0.0.0:8008`.
That way, you can edit the documentation/source files and see the changes live.
#### Apps and docs at the same time
And if you run the examples with, e.g.:
```bash
uvicorn tutorial001:app --reload
```
as Uvicorn by default will use the port `8000`, the documentation on port `8008` won't clash.
### Tests
There is a script that you can run locally to test all the code and generate coverage reports in HTML:
```bash
bash scripts/test-cov-html.sh
```
This command generates a directory `./htmlcov/`, if you open the file `./htmlcov/index.html` in your browser, you can explore interactively the regions of code that are covered by the tests, and notice if there is any region missing.

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.6 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.

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

@@ -0,0 +1,464 @@
{!../../../docs/missing-translation.md!}
<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 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>
<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>
---
**Documentation**: <a href="https://fastapi.tiangolo.com" target="_blank">https://fastapi.tiangolo.com</a>
**Source Code**: <a href="https://github.com/tiangolo/fastapi" target="_blank">https://github.com/tiangolo/fastapi</a>
---
FastAPI is a modern, fast (high-performance), web framework for building APIs with Python 3.6+ 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.
* **Easy**: Designed to be easy to use and learn. Less time reading docs.
* **Short**: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.
* **Robust**: Get production-ready code. With automatic interactive documentation.
* **Standards-based**: Based on (and fully compatible with) the open standards for APIs: <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">OpenAPI</a> (previously known as Swagger) and <a href="https://json-schema.org/" class="external-link" target="_blank">JSON Schema</a>.
<small>* estimation based on tests on an internal development team, building production applications.</small>
## Sponsors
<!-- 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">Other sponsors</a>
## Opinions
"_[...] I'm using **FastAPI** a ton these days. [...] I'm actually planning to use it for all of my team's **ML services at Microsoft**. Some of them are getting integrated into the core **Windows** product and some **Office** products._"
<div style="text-align: right; margin-right: 10%;">Kabir Khan - <strong>Microsoft</strong> <a href="https://github.com/tiangolo/fastapi/pull/26" target="_blank"><small>(ref)</small></a></div>
---
"_We adopted the **FastAPI** library to spawn a **REST** server that can be queried to obtain **predictions**. [for Ludwig]_"
<div style="text-align: right; margin-right: 10%;">Piero Molino, Yaroslav Dudin, and Sai Sumanth Miryala - <strong>Uber</strong> <a href="https://eng.uber.com/ludwig-v0-2/" target="_blank"><small>(ref)</small></a></div>
---
"_**Netflix** is pleased to announce the open-source release of our **crisis management** orchestration framework: **Dispatch**! [built with **FastAPI**]_"
<div style="text-align: right; margin-right: 10%;">Kevin Glisson, Marc Vilanova, Forest Monsen - <strong>Netflix</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072" target="_blank"><small>(ref)</small></a></div>
---
"_Im over the moon excited about **FastAPI**. Its so fun!_"
<div style="text-align: right; margin-right: 10%;">Brian Okken - <strong><a href="https://pythonbytes.fm/episodes/show/123/time-to-right-the-py-wrongs?time_in_sec=855" target="_blank">Python Bytes</a> podcast host</strong> <a href="https://twitter.com/brianokken/status/1112220079972728832" target="_blank"><small>(ref)</small></a></div>
---
"_Honestly, what you've built looks super solid and polished. In many ways, it's what I wanted **Hug** to be - it's really inspiring to see someone build that._"
<div style="text-align: right; margin-right: 10%;">Timothy Crosley - <strong><a href="https://www.hug.rest/" target="_blank">Hug</a> creator</strong> <a href="https://news.ycombinator.com/item?id=19455465" target="_blank"><small>(ref)</small></a></div>
---
"_If you're looking to learn one **modern framework** for building REST APIs, check out **FastAPI** [...] It's fast, easy to use and easy to learn [...]_"
"_We've switched over to **FastAPI** for our **APIs** [...] I think you'll like it [...]_"
<div style="text-align: right; margin-right: 10%;">Ines Montani - Matthew Honnibal - <strong><a href="https://explosion.ai" target="_blank">Explosion AI</a> founders - <a href="https://spacy.io" target="_blank">spaCy</a> creators</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**, 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>
If you are building a <abbr title="Command Line Interface">CLI</abbr> app to be used in the terminal instead of a web API, check out <a href="https://typer.tiangolo.com/" class="external-link" target="_blank">**Typer**</a>.
**Typer** is FastAPI's little sibling. And it's intended to be the **FastAPI of CLIs**. ⌨️ 🚀
## Requirements
Python 3.7+
FastAPI stands on the shoulders of giants:
* <a href="https://www.starlette.io/" class="external-link" target="_blank">Starlette</a> for the web parts.
* <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> for the data parts.
## Installation
<div class="termy">
```console
$ pip install fastapi
---> 100%
```
</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>.
<div class="termy">
```console
$ pip install "uvicorn[standard]"
---> 100%
```
</div>
## Example
### Create it
* Create a file `main.py` with:
```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>Or use <code>async def</code>...</summary>
If your code uses `async` / `await`, use `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}
```
**Note**:
If you don't know, check the _"In a hurry?"_ section about <a href="https://fastapi.tiangolo.com/async/#in-a-hurry" target="_blank">`async` and `await` in the docs</a>.
</details>
### Run it
Run the server with:
<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>About the command <code>uvicorn main:app --reload</code>...</summary>
The command `uvicorn main:app` refers to:
* `main`: the file `main.py` (the Python "module").
* `app`: the object created inside of `main.py` with the line `app = FastAPI()`.
* `--reload`: make the server restart after code changes. Only do this for development.
</details>
### Check it
Open your browser at <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>.
You will see the JSON response as:
```JSON
{"item_id": 5, "q": "somequery"}
```
You already created an API that:
* Receives HTTP requests in the _paths_ `/` and `/items/{item_id}`.
* Both _paths_ take `GET` <em>operations</em> (also known as HTTP _methods_).
* The _path_ `/items/{item_id}` has a _path parameter_ `item_id` that should be an `int`.
* The _path_ `/items/{item_id}` has an optional `str` _query parameter_ `q`.
### Interactive API docs
Now go to <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
You will see the automatic interactive API documentation (provided by <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 docs
And now, go to <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
You will see the alternative automatic documentation (provided by <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)
## Example upgrade
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 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}
```
The server should reload automatically (because you added `--reload` to the `uvicorn` command above).
### Interactive API docs upgrade
Now go to <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
* The interactive API documentation will be automatically updated, including the new body:
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
* Click on the button "Try it out", it allows you to fill the parameters and directly interact with the API:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png)
* Then click on the "Execute" button, the user interface will communicate with your API, send the parameters, get the results and show them on the screen:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png)
### Alternative API docs upgrade
And now, go to <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
* The alternative documentation will also reflect the new query parameter and body:
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
### Recap
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+**.
For example, for an `int`:
```Python
item_id: int
```
or for a more complex `Item` model:
```Python
item: Item
```
...and with that single declaration you get:
* Editor support, including:
* Completion.
* Type checks.
* Validation of data:
* Automatic and clear errors when the data is invalid.
* Validation even for deeply nested JSON objects.
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of input data: coming from the network to Python data and types. Reading from:
* JSON.
* Path parameters.
* Query parameters.
* Cookies.
* Headers.
* Forms.
* Files.
* <abbr title="also known as: serialization, parsing, marshalling">Conversion</abbr> of output data: converting from Python data and types to network data (as JSON):
* Convert Python types (`str`, `int`, `float`, `bool`, `list`, etc).
* `datetime` objects.
* `UUID` objects.
* Database models.
* ...and many more.
* Automatic interactive API documentation, including 2 alternative user interfaces:
* Swagger UI.
* ReDoc.
---
Coming back to the previous code example, **FastAPI** will:
* Validate that there is an `item_id` in the path for `GET` and `PUT` requests.
* Validate that the `item_id` is of type `int` for `GET` and `PUT` requests.
* If it is not, the client will see a useful, clear error.
* Check if there is an optional query parameter named `q` (as in `http://127.0.0.1:8000/items/foo?q=somequery`) for `GET` requests.
* 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 `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.
* Convert from and to JSON automatically.
* Document everything with OpenAPI, that can be used by:
* Interactive documentation systems.
* Automatic client code generation systems, for many languages.
* Provide 2 interactive documentation web interfaces directly.
---
We just scratched the surface, but you already get the idea of how it all works.
Try changing the line with:
```Python
return {"item_name": item.name, "item_id": item_id}
```
...from:
```Python
... "item_name": item.name ...
```
...to:
```Python
... "item_price": item.price ...
```
...and see how your editor will auto-complete the attributes and know their types:
![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
For a more complete example including more features, see the <a href="https://fastapi.tiangolo.com/tutorial/">Tutorial - User Guide</a>.
**Spoiler alert**: the tutorial - user guide includes:
* Declaration of **parameters** from other different places as: **headers**, **cookies**, **form fields** and **files**.
* How to set **validation constraints** as `maximum_length` or `regex`.
* 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).
* Many extra features (thanks to Starlette) as:
* **WebSockets**
* extremely easy tests based on `requests` and `pytest`
* **CORS**
* **Cookie Sessions**
* ...and more.
## Performance
Independent TechEmpower benchmarks show **FastAPI** applications running under Uvicorn as <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">one of the fastest Python frameworks available</a>, only below Starlette and Uvicorn themselves (used internally by FastAPI). (*)
To understand more about it, see the section <a href="https://fastapi.tiangolo.com/benchmarks/" class="internal-link" target="_blank">Benchmarks</a>.
## Optional Dependencies
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.
Used by Starlette:
* <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://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]`.
## License
This project is licensed under the terms of the MIT license.

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

@@ -0,0 +1,155 @@
site_name: FastAPI
site_description: FastAPI framework, high performance, easy to learn, fast to code, ready for production
site_url: https://fastapi.tiangolo.com/de/
theme:
name: material
custom_dir: overrides
palette:
- media: '(prefers-color-scheme: light)'
scheme: default
primary: teal
accent: amber
toggle:
icon: material/lightbulb
name: Switch to light mode
- media: '(prefers-color-scheme: dark)'
scheme: slate
primary: teal
accent: amber
toggle:
icon: material/lightbulb-outline
name: Switch to dark mode
features:
- search.suggest
- search.highlight
- content.tabs.link
icon:
repo: fontawesome/brands/github-alt
logo: https://fastapi.tiangolo.com/img/icon-white.svg
favicon: https://fastapi.tiangolo.com/img/favicon.png
language: de
repo_name: tiangolo/fastapi
repo_url: https://github.com/tiangolo/fastapi
edit_uri: ''
plugins:
- search
- markdownextradata:
data: data
nav:
- FastAPI: index.md
- Languages:
- en: /
- az: /az/
- de: /de/
- em: /em/
- es: /es/
- fa: /fa/
- fr: /fr/
- he: /he/
- hy: /hy/
- id: /id/
- it: /it/
- ja: /ja/
- ko: /ko/
- nl: /nl/
- pl: /pl/
- pt: /pt/
- ru: /ru/
- sq: /sq/
- sv: /sv/
- ta: /ta/
- tr: /tr/
- uk: /uk/
- zh: /zh/
- features.md
markdown_extensions:
- toc:
permalink: true
- markdown.extensions.codehilite:
guess_lang: false
- mdx_include:
base_path: docs
- admonition
- codehilite
- extra
- pymdownx.superfences:
custom_fences:
- name: mermaid
class: mermaid
format: !!python/name:pymdownx.superfences.fence_code_format ''
- pymdownx.tabbed:
alternate_style: true
- attr_list
- md_in_html
extra:
analytics:
provider: google
property: G-YNEVN69SC3
social:
- icon: fontawesome/brands/github-alt
link: https://github.com/tiangolo/fastapi
- icon: fontawesome/brands/discord
link: https://discord.gg/VQjSZaeJmf
- icon: fontawesome/brands/twitter
link: https://twitter.com/fastapi
- icon: fontawesome/brands/linkedin
link: https://www.linkedin.com/in/tiangolo
- icon: fontawesome/brands/dev
link: https://dev.to/tiangolo
- icon: fontawesome/brands/medium
link: https://medium.com/@tiangolo
- icon: fontawesome/solid/globe
link: https://tiangolo.com
alternate:
- link: /
name: en - English
- link: /az/
name: az
- link: /de/
name: de
- link: /em/
name: 😉
- link: /es/
name: es - español
- link: /fa/
name: fa
- link: /fr/
name: fr - français
- link: /he/
name: he
- link: /hy/
name: hy
- link: /id/
name: id
- link: /it/
name: it - italiano
- link: /ja/
name: ja - 日本語
- link: /ko/
name: ko - 한국어
- link: /nl/
name: nl
- link: /pl/
name: pl
- link: /pt/
name: pt - português
- link: /ru/
name: ru - русский язык
- link: /sq/
name: sq - shqip
- link: /sv/
name: sv - svenska
- link: /ta/
name: ta - தமிழ்
- link: /tr/
name: tr - Türkçe
- link: /uk/
name: uk - українська мова
- link: /zh/
name: zh - 汉语
extra_css:
- https://fastapi.tiangolo.com/css/termynal.css
- https://fastapi.tiangolo.com/css/custom.css
extra_javascript:
- https://fastapi.tiangolo.com/js/termynal.js
- https://fastapi.tiangolo.com/js/custom.js

View File

@@ -1,274 +0,0 @@
You can use <a href="https://www.docker.com/" target="_blank">**Docker**</a> for deployment. It has several advantages like security, replicability, development simplicity, etc.
In this section you'll see instructions and links to guides to know how to:
* Make your **FastAPI** application a Docker image/container with maximum performance. In about **5 min**.
* (Optionally) understand what you, as a developer, need to know about HTTPS.
* Set up a Docker Swarm mode cluster with automatic HTTPS, even on a simple $5 USD/month server. In about **20 min**.
* Generate and deploy a full **FastAPI** application, using your Docker Swarm cluster, with HTTPS, etc. In about **10 min**.
---
You can also easily use **FastAPI** in a standard server directly too (without Docker).
## Docker
If you are using Docker, you can use the official Docker image:
### <a href="https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker" target="_blank">tiangolo/uvicorn-gunicorn-fastapi</a>
This image has an "auto-tuning" mechanism included, so that you can just add your code and get very high performance automatically. And without making sacrifices.
But you can still change and update all the configurations with environment variables or configuration files.
!!! tip
To see all the configurations and options, go to the Docker image page: <a href="https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker" target="_blank">tiangolo/uvicorn-gunicorn-fastapi</a>.
### Create a `Dockerfile`
* Go to your project directory.
* Create a `Dockerfile` with:
```Dockerfile
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
COPY ./app /app
```
#### Bigger Applications
If you followed the section about creating <a href="https://fastapi.tiangolo.com/tutorial/bigger-applications/" target="_blank">Bigger Applications with Multiple Files
</a>, your `Dockerfile` might instead look like:
```Dockerfile
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
COPY ./app /app/app
```
#### Raspberry Pi and other architectures
If you are running Docker in a Raspberry Pi (that has an ARM processor) or any other architecture, you can create a `Dockerfile` from scratch, based on a Python base image (that is multi-architecture) and use Uvicorn alone.
In this case, your `Dockerfile` could look like:
```Dockerfile
FROM python:3.7
RUN pip install fastapi uvicorn
EXPOSE 80
COPY ./app /app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "80"]
```
### Create the **FastAPI** Code
* Create an `app` directory and enter in it.
* Create a `main.py` file with:
```Python
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: str = None):
return {"item_id": item_id, "q": q}
```
* You should now have a directory structure like:
```
.
├── app
│ └── main.py
└── Dockerfile
```
### Build the Docker image
* Go to the project directory (in where your `Dockerfile` is, containing your `app` directory).
* Build your FastAPI image:
```bash
docker build -t myimage .
```
### Start the Docker container
* Run a container based on your image:
```bash
docker run -d --name mycontainer -p 80:80 myimage
```
Now you have an optimized FastAPI server in a Docker container. Auto-tuned for your current server (and number of CPU cores).
### Check it
You should be able to check it in your Docker container's URL, for example: <a href="http://192.168.99.100/items/5?q=somequery" target="_blank">http://192.168.99.100/items/5?q=somequery</a> or <a href="http://127.0.0.1/items/5?q=somequery" target="_blank">http://127.0.0.1/items/5?q=somequery</a> (or equivalent, using your Docker host).
You will see something like:
```JSON
{"item_id": 5, "q": "somequery"}
```
### Interactive API docs
Now you can go to <a href="http://192.168.99.100/docs" target="_blank">http://192.168.99.100/docs</a> or <a href="http://127.0.0.1/docs" target="_blank">http://127.0.0.1/docs</a> (or equivalent, using your Docker host).
You will see the automatic interactive API documentation (provided by <a href="https://github.com/swagger-api/swagger-ui" target="_blank">Swagger UI</a>):
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-01-swagger-ui-simple.png)
### Alternative API docs
And you can also go to <a href="http://192.168.99.100/redoc" target="_blank">http://192.168.99.100/redoc</a> or <a href="http://127.0.0.1/redoc" target="_blank">http://127.0.0.1/redoc</a> (or equivalent, using your Docker host).
You will see the alternative automatic documentation (provided by <a href="https://github.com/Rebilly/ReDoc" target="_blank">ReDoc</a>):
![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
## HTTPS
### About HTTPS
It is easy to assume that HTTPS is something that is just "enabled" or not.
But it is way more complex than that.
!!! tip
If you are in a hurry or don't care, continue with the next section for step by step instructions to set everything up.
To learn the basics of HTTPS, from a consumer perspective, check <a href="https://howhttps.works/" target="_blank">https://howhttps.works/</a>.
Now, from a developer's perspective, here are several things to have in mind while thinking about HTTPS:
* For HTTPS, the server needs to have "certificates" generated by a third party.
* Those certificates are actually acquired from the third-party, not "generated".
* Certificates have a lifetime.
* They expire.
* And then they need to be renewed, acquired again from the third party.
* The encryption of the connection happens at the TCP level.
* That's one layer below HTTP.
* So, the certificate and encryption handling is done before HTTP.
* TCP doesn't know about "domains". Only about IP addresses.
* The information about the specific domain requested goes in the HTTP data.
* The HTTPS certificates "certificate" a certain domain, but the protocol and encryption happen at the TCP level, before knowing which domain is being dealt with.
* By default, that would mean that you can only have one HTTPS certificate per IP address.
* No matter how big is your server and how small each application you have there might be. But...
* There's an extension to the TLS protocol (the one handling the encryption at the TCP level, before HTTP) called <a href="https://en.wikipedia.org/wiki/Server_Name_Indication" target="_blank"><abbr title="Server Name Indication">SNI</abbr></a>.
* This SNI extension allows one single server (with a single IP address) to have several HTTPS certificates and server multiple HTTPS domains/applications.
* For this to work, a single component (program) running in the server, listening in the public IP address, must have all the HTTPS certificates in the server.
* After having a secure connection, the communication protocol is the same HTTP.
* It goes encrypted, but the encrypted contents are the same HTTP protocol.
It is a common practice to have one program/HTTP server running in the server (the machine, host, etc) and managing all the HTTPS parts, sending the decrypted HTTP requests to the actual HTTP application running in the same server (the **FastAPI** application, in this case), take the HTTP response from the application, encrypt it using the appropriate certificate and sending it back to the client using HTTPS. This server is ofter called a <a href="https://en.wikipedia.org/wiki/TLS_termination_proxy" target="_blank">TLS Termination Proxy</a>.
### Let's Encrypt
Up to some years ago, these HTTPS certificates were sold by trusted third-parties.
The process to acquire one of these certificates used to be cumbersome, require quite some paperwork and the certificates were quite expensive.
But then <a href="https://letsencrypt.org/" target="_blank">Let's Encrypt</a> was created.
It is a project from the Linux Foundation. It provides HTTPS certificates for free. In an automated way. These certificates use all the standard cryptographic security, and are short lived (about 3 months), so, the security is actually increased, by reducing their lifespan.
The domains are securely verified and the certificates are generated automatically. This also allows automatizing the renewal of these certificates.
The idea is to automatize the acquisition and renewal of these certificates, so that you can have secure HTTPS, free, forever.
### Traefik
<a href="https://traefik.io/" target="_blank">Traefik</a> is a high performance reverse proxy / load balancer. It can do the "TLS Termination Proxy" job (apart from other features).
It has integration with Let's Encrypt. So, it can handle all the HTTPS parts, including certificate acquisition and renewal.
It also has integrations with Docker. So, you can declare your domains in each application configurations and have it read those configurations, generate the HTTPS certificates and serve HTTPS to your application, all automatically. Without requiring any change in its configuration.
---
With this information and tools, continue with the next section to combine everything.
## Docker Swarm mode cluster with Traefik and HTTPS
You can have a Docker Swarm mode cluster set up in minutes (about 20 min) with a main Traefik handling HTTPS (including certificate acquisition and renewal).
By using Docker Swarm mode, you can start with a "cluster" of a single machine (it can even be a $5 USD / month server) and then you can grow as much as you need adding more servers.
To set up a Docker Swarm Mode cluster with Traefik and HTTPS handling, follow this guide:
### <a href="https://medium.com/@tiangolo/docker-swarm-mode-and-traefik-for-a-https-cluster-20328dba6232" target="_blank">Docker Swarm Mode and Traefik for an HTTPS cluster</a>.
### Deploy a FastAPI application
The easiest way to set everything up, would be using the <a href="/project-generation/" target="_blank">FastAPI project generator</a>.
It is designed to be integrated with this Docker Swarm cluster with Traefik and HTTPS described above.
You can generate a project in about 2 min.
The generated project has instructions to deploy it, doing it takes other 2 min.
## Alternatively, deploy **FastAPI** without Docker
You can deploy **FastAPI** directly without Docker too.
You just need to install an ASGI compatible server like:
* <a href="https://www.uvicorn.org/" target="_blank">Uvicorn</a>, a lightning-fast ASGI server, built on uvloop and httptools.
```bash
pip install uvicorn
```
* <a href="https://gitlab.com/pgjones/hypercorn" target="_blank">Hypercorn</a>, an ASGI server also compatible with HTTP/2.
```bash
pip install hypercorn
```
...or any other ASGI server.
And run your application the same way you have done in the tutorials, but without the `--reload` option, e.g.:
```bash
uvicorn main:app --host 0.0.0.0 --port 80
```
or with Hypercorn:
```bash
hypercorn main:app --bind 0.0.0.0:80
```
You might want to set up some tooling to make sure it is restarted automatically if it stops.
You might also want to install <a href="https://gunicorn.org/" target="_blank">Gunicorn</a> and <a href="https://www.uvicorn.org/#running-with-gunicorn" target="_blank">use it as a manager for Uvicorn</a>, or use Hypercorn with multiple workers.
Making sure to fine-tune the number of workers, etc.
But if you are doing all that, you might just use the Docker image that does it automatically.

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,58 @@
# 🎲 🗄
🚥 👆 💪, 👆 💪 ⚙️ ⚒ &amp; 🌐 🔢 🔗 🗄 ✔ ⚓️ 🔛 🌐, &amp; ❎ ⚫️ 🍕.
## 🔃 💂‍♂, 🔗, &amp; 🩺
🕵‍♂ 👆 🧾 👩‍💻 🔢 🏭 *🚫🔜 🚫* 🌌 🛡 👆 🛠️.
👈 🚫 🚮 🙆 💂‍♂ 👆 🛠️, *➡ 🛠️* 🔜 💪 🌐❔ 👫.
🚥 📤 💂‍♂ ⚠ 👆 📟, ⚫️ 🔜 🔀.
🕵‍♂ 🧾 ⚒ ⚫️ 🌅 ⚠ 🤔 ❔ 🔗 ⏮️ 👆 🛠️, &amp; 💪 ⚒ ⚫️ 🌅 ⚠ 👆 ⚫️ 🏭. ⚫️ 💪 🤔 🎯 📨 <a href="https://en.wikipedia.org/wiki/Security_through_obscurity" class="external-link" target="_blank">💂‍♂ 🔘 🌌</a>.
🚥 👆 💚 🔐 👆 🛠️, 📤 📚 👍 👜 👆 💪, 🖼:
* ⚒ 💭 👆 ✔️ 👍 🔬 Pydantic 🏷 👆 📨 💪 &amp; 📨.
* 🔗 🙆 ✔ ✔ &amp; 🔑 ⚙️ 🔗.
* 🙅 🏪 🔢 🔐, 🕴 🔐#⃣.
* 🛠️ &amp; ⚙️ 👍-💭 🔐 🧰, 💖 🇸🇲 &amp; 🥙 🤝, ♒️.
* 🚮 🌅 🧽 ✔ 🎛 ⏮️ Oauth2⃣ ↔ 🌐❔ 💪.
* ...♒️.
👐, 👆 5⃣📆 ✔️ 📶 🎯 ⚙️ 💼 🌐❔ 👆 🤙 💪 ❎ 🛠️ 🩺 🌐 (✅ 🏭) ⚖️ ⚓️ 🔛 📳 ⚪️➡️ 🌐 🔢.
## 🎲 🗄 ⚪️➡️ ⚒ &amp; 🇨🇻 {
👆 💪 💪 ⚙️ 🎏 Pydantic ⚒ 🔗 👆 🏗 🗄 &amp; 🩺 ⚜.
🖼:
```Python hl_lines="6 11"
{!../../../docs_src/conditional_openapi/tutorial001.py!}
```
📥 👥 📣 ⚒ `openapi_url` ⏮️ 🎏 🔢 `"/openapi.json"`.
&amp; ⤴️ 👥 ⚙️ ⚫️ 🕐❔ 🏗 `FastAPI` 📱.
⤴️ 👆 💪 ❎ 🗄 (✅ 🎚 🩺) ⚒ 🌐 🔢 `OPENAPI_URL` 🛁 🎻, 💖:
<div class="termy">
```console
$ OPENAPI_URL= uvicorn main:app
<span style="color: green;">INFO</span>: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)
```
</div>
⤴️ 🚥 👆 🚶 📛 `/openapi.json`, `/docs`, ⚖️ `/redoc` 👆 🔜 🤚 `404 Not Found` ❌ 💖:
```JSON
{
"detail": "Not Found"
}
```

View File

@@ -0,0 +1,109 @@
# 🛃 📨 &amp; APIRoute 🎓
💼, 👆 5⃣📆 💚 🔐 ⚛ ⚙️ `Request` &amp; `APIRoute` 🎓.
🎯, 👉 5⃣📆 👍 🎛 ⚛ 🛠️.
🖼, 🚥 👆 💚 ✍ ⚖️ 🔬 📨 💪 ⏭ ⚫️ 🛠️ 👆 🈸.
!!! danger
👉 "🏧" ⚒.
🚥 👆 ▶️ ⏮️ **FastAPI** 👆 💪 💚 🚶 👉 📄.
## ⚙️ 💼
⚙️ 💼 🔌:
* 🏭 🚫-🎻 📨 💪 🎻 (✅ <a href="https://msgpack.org/index.html" class="external-link" target="_blank">`msgpack`</a>).
* 🗜 🗜-🗜 📨 💪.
* 🔁 🚨 🌐 📨 💪.
## 🚚 🛃 📨 💪 🔢
➡️ 👀 ❔ ⚒ ⚙️ 🛃 `Request` 🏿 🗜 🗜 📨.
&amp; `APIRoute` 🏿 ⚙️ 👈 🛃 📨 🎓.
### ✍ 🛃 `GzipRequest` 🎓
!!! tip
👉 🧸 🖼 🎦 ❔ ⚫️ 👷, 🚥 👆 💪 🗜 🐕‍🦺, 👆 💪 ⚙️ 🚚 [`GzipMiddleware`](./middleware.md#gzipmiddleware){.internal-link target=_blank}.
🥇, 👥 ✍ `GzipRequest` 🎓, ❔ 🔜 📁 `Request.body()` 👩‍🔬 🗜 💪 🔍 ☑ 🎚.
🚥 📤 🙅‍♂ `gzip` 🎚, ⚫️ 🔜 🚫 🔄 🗜 💪.
👈 🌌, 🎏 🛣 🎓 💪 🍵 🗜 🗜 ⚖️ 🗜 📨.
```Python hl_lines="8-15"
{!../../../docs_src/custom_request_and_route/tutorial001.py!}
```
### ✍ 🛃 `GzipRoute` 🎓
⏭, 👥 ✍ 🛃 🏿 `fastapi.routing.APIRoute` 👈 🔜 ⚒ ⚙️ `GzipRequest`.
👉 🕰, ⚫️ 🔜 📁 👩‍🔬 `APIRoute.get_route_handler()`.
👉 👩‍🔬 📨 🔢. &amp; 👈 🔢 ⚫️❔ 🔜 📨 📨 &amp; 📨 📨.
📥 👥 ⚙️ ⚫️ ✍ `GzipRequest` ⚪️➡️ ⏮️ 📨.
```Python hl_lines="18-26"
{!../../../docs_src/custom_request_and_route/tutorial001.py!}
```
!!! note "📡 "
`Request` ✔️ `request.scope` 🔢, 👈 🐍 `dict` ⚗ 🗃 🔗 📨.
`Request` ✔️ `request.receive`, 👈 🔢 "📨" 💪 📨.
`scope` `dict` &amp; `receive` 🔢 👯‍♂️ 🍕 🔫 🔧.
&amp; 👈 2⃣ 👜, `scope` &amp; `receive`, ⚫️❔ 💪 ✍ 🆕 `Request` 👐.
💡 🌅 🔃 `Request` ✅ <a href="https://www.starlette.io/requests/" class="external-link" target="_blank">💃 🩺 🔃 📨</a>.
🕴 👜 🔢 📨 `GzipRequest.get_route_handler` 🔨 🎏 🗜 `Request` `GzipRequest`.
🔨 👉, 👆 `GzipRequest` 🔜 ✊ 💅 🗜 📊 (🚥 💪) ⏭ 🚶‍♀️ ⚫️ 👆 *➡ 🛠️*.
⏮️ 👈, 🌐 🏭 ⚛ 🎏.
✋️ ↩️ 👆 🔀 `GzipRequest.body`, 📨 💪 🔜 🔁 🗜 🕐❔ ⚫️ 📐 **FastAPI** 🕐❔ 💪.
## 🔐 📨 💪 ⚠ 🐕‍🦺
!!! tip
❎ 👉 🎏 ⚠, ⚫️ 🎲 📚 ⏩ ⚙️ `body` 🛃 🐕‍🦺 `RequestValidationError` ([🚚 ❌](../tutorial/handling-errors.md#use-the-requestvalidationerror-body){.internal-link target=_blank}).
✋️ 👉 🖼 ☑ &amp; ⚫️ 🎦 ❔ 🔗 ⏮️ 🔗 🦲.
👥 💪 ⚙️ 👉 🎏 🎯 🔐 📨 💪 ⚠ 🐕‍🦺.
🌐 👥 💪 🍵 📨 🔘 `try`/`except` 🍫:
```Python hl_lines="13 15"
{!../../../docs_src/custom_request_and_route/tutorial002.py!}
```
🚥 ⚠ 📉, `Request` 👐 🔜 ↔, 👥 💪 ✍ &amp; ⚒ ⚙️ 📨 💪 🕐❔ 🚚 ❌:
```Python hl_lines="16-18"
{!../../../docs_src/custom_request_and_route/tutorial002.py!}
```
## 🛃 `APIRoute` 🎓 📻
👆 💪 ⚒ `route_class` 🔢 `APIRouter`:
```Python hl_lines="26"
{!../../../docs_src/custom_request_and_route/tutorial003.py!}
```
👉 🖼, *➡ 🛠️* 🔽 `router` 🔜 ⚙️ 🛃 `TimedRoute` 🎓, &amp; 🔜 ✔️ `X-Response-Time` 🎚 📨 ⏮️ 🕰 ⚫️ ✊ 🏗 📨:
```Python hl_lines="13-20"
{!../../../docs_src/custom_request_and_route/tutorial003.py!}
```

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,314 @@
# ↔ 🗄
!!! warning
👉 👍 🏧 ⚒. 👆 🎲 💪 🚶 ⚫️.
🚥 👆 📄 🔰 - 👩‍💻 🦮, 👆 💪 🎲 🚶 👉 📄.
🚥 👆 ⏪ 💭 👈 👆 💪 🔀 🏗 🗄 🔗, 😣 👂.
📤 💼 🌐❔ 👆 💪 💪 🔀 🏗 🗄 🔗.
👉 📄 👆 🔜 👀 ❔.
## 😐 🛠️
😐 (🔢) 🛠️, ⏩.
`FastAPI` 🈸 (👐) ✔️ `.openapi()` 👩‍🔬 👈 📈 📨 🗄 🔗.
🍕 🈸 🎚 🏗, *➡ 🛠️* `/openapi.json` (⚖️ ⚫️❔ 👆 ⚒ 👆 `openapi_url`) ®.
⚫️ 📨 🎻 📨 ⏮️ 🏁 🈸 `.openapi()` 👩‍🔬.
🔢, ⚫️❔ 👩‍🔬 `.openapi()` 🔨 ✅ 🏠 `.openapi_schema` 👀 🚥 ⚫️ ✔️ 🎚 &amp; 📨 👫.
🚥 ⚫️ 🚫, ⚫️ 🏗 👫 ⚙️ 🚙 🔢 `fastapi.openapi.utils.get_openapi`.
&amp; 👈 🔢 `get_openapi()` 📨 🔢:
* `title`: 🗄 📛, 🎦 🩺.
* `version`: ⏬ 👆 🛠️, ✅ `2.5.0`.
* `openapi_version`: ⏬ 🗄 🔧 ⚙️. 🔢, ⏪: `3.0.2`.
* `description`: 📛 👆 🛠️.
* `routes`: 📇 🛣, 👫 🔠 ® *➡ 🛠️*. 👫 ✊ ⚪️➡️ `app.routes`.
## 🔑 🔢
⚙️ 🔛, 👆 💪 ⚙️ 🎏 🚙 🔢 🏗 🗄 🔗 &amp; 🔐 🔠 🍕 👈 👆 💪.
🖼, ➡️ 🚮 <a href="https://github.com/Rebilly/ReDoc/blob/master/docs/redoc-vendor-extensions.md#x-logo" class="external-link" target="_blank">📄 🗄 ↔ 🔌 🛃 🔱</a>.
### 😐 **FastAPI**
🥇, ✍ 🌐 👆 **FastAPI** 🈸 🛎:
```Python hl_lines="1 4 7-9"
{!../../../docs_src/extending_openapi/tutorial001.py!}
```
### 🏗 🗄 🔗
⤴️, ⚙️ 🎏 🚙 🔢 🏗 🗄 🔗, 🔘 `custom_openapi()` 🔢:
```Python hl_lines="2 15-20"
{!../../../docs_src/extending_openapi/tutorial001.py!}
```
### 🔀 🗄 🔗
🔜 👆 💪 🚮 📄 ↔, ❎ 🛃 `x-logo` `info` "🎚" 🗄 🔗:
```Python hl_lines="21-23"
{!../../../docs_src/extending_openapi/tutorial001.py!}
```
### 💾 🗄 🔗
👆 💪 ⚙️ 🏠 `.openapi_schema` "💾", 🏪 👆 🏗 🔗.
👈 🌌, 👆 🈸 🏆 🚫 ✔️ 🏗 🔗 🔠 🕰 👩‍💻 📂 👆 🛠️ 🩺.
⚫️ 🔜 🏗 🕴 🕐, &amp; ⤴️ 🎏 💾 🔗 🔜 ⚙️ ⏭ 📨.
```Python hl_lines="13-14 24-25"
{!../../../docs_src/extending_openapi/tutorial001.py!}
```
### 🔐 👩‍🔬
🔜 👆 💪 ❎ `.openapi()` 👩‍🔬 ⏮️ 👆 🆕 🔢.
```Python hl_lines="28"
{!../../../docs_src/extending_openapi/tutorial001.py!}
```
### ✅ ⚫️
🕐 👆 🚶 <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a> 👆 🔜 👀 👈 👆 ⚙️ 👆 🛃 🔱 (👉 🖼, **FastAPI**'Ⓜ 🔱):
<img src="/img/tutorial/extending-openapi/image01.png">
## 👤-🕸 🕸 &amp; 🎚 🩺
🛠️ 🩺 ⚙️ **🦁 🎚** &amp; **📄**, &amp; 🔠 👈 💪 🕸 &amp; 🎚 📁.
🔢, 👈 📁 🍦 ⚪️➡️ <abbr title="Content Delivery Network: A service, normally composed of several servers, that provides static files, like JavaScript and CSS. It's commonly used to serve those files from the server closer to the client, improving performance.">💲</abbr>.
✋️ ⚫️ 💪 🛃 ⚫️, 👆 💪 ⚒ 🎯 💲, ⚖️ 🍦 📁 👆.
👈 ⚠, 🖼, 🚥 👆 💪 👆 📱 🚧 👷 ⏪ 📱, 🍵 📂 🕸 🔐, ⚖️ 🇧🇿 🕸.
📥 👆 🔜 👀 ❔ 🍦 👈 📁 👆, 🎏 FastAPI 📱, &amp; 🔗 🩺 ⚙️ 👫.
### 🏗 📁 📊
➡️ 💬 👆 🏗 📁 📊 👀 💖 👉:
```
.
├── app
│ ├── __init__.py
│ ├── main.py
```
🔜 ✍ 📁 🏪 📚 🎻 📁.
👆 🆕 📁 📊 💪 👀 💖 👉:
```
.
├── app
│   ├── __init__.py
│   ├── main.py
└── static/
```
### ⏬ 📁
⏬ 🎻 📁 💪 🩺 &amp; 🚮 👫 🔛 👈 `static/` 📁.
👆 💪 🎲 ▶️️-🖊 🔠 🔗 &amp; 🖊 🎛 🎏 `Save link as...`.
**🦁 🎚** ⚙️ 📁:
* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@4/swagger-ui-bundle.js" class="external-link" target="_blank">`swagger-ui-bundle.js`</a>
* <a href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@4/swagger-ui.css" class="external-link" target="_blank">`swagger-ui.css`</a>
&amp; **📄** ⚙️ 📁:
* <a href="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js" class="external-link" target="_blank">`redoc.standalone.js`</a>
⏮️ 👈, 👆 📁 📊 💪 👀 💖:
```
.
├── app
│   ├── __init__.py
│   ├── main.py
└── static
├── redoc.standalone.js
├── swagger-ui-bundle.js
└── swagger-ui.css
```
### 🍦 🎻 📁
* 🗄 `StaticFiles`.
* "🗻" `StaticFiles()` 👐 🎯 ➡.
```Python hl_lines="7 11"
{!../../../docs_src/extending_openapi/tutorial002.py!}
```
### 💯 🎻 📁
▶️ 👆 🈸 &amp; 🚶 <a href="http://127.0.0.1:8000/static/redoc.standalone.js" class="external-link" target="_blank">http://127.0.0.1:8000/static/redoc.standalone.js</a>.
👆 🔜 👀 📶 📏 🕸 📁 **📄**.
⚫️ 💪 ▶️ ⏮️ 🕳 💖:
```JavaScript
/*!
* ReDoc - OpenAPI/Swagger-generated API Reference Documentation
* -------------------------------------------------------------
* Version: "2.0.0-rc.18"
* Repo: https://github.com/Redocly/redoc
*/
!function(e,t){"object"==typeof exports&&"object"==typeof m
...
```
👈 ✔ 👈 👆 💆‍♂ 💪 🍦 🎻 📁 ⚪️➡️ 👆 📱, &amp; 👈 👆 🥉 🎻 📁 🩺 ☑ 🥉.
🔜 👥 💪 🔗 📱 ⚙️ 📚 🎻 📁 🩺.
### ❎ 🏧 🩺
🥇 🔁 ❎ 🏧 🩺, 📚 ⚙️ 💲 🔢.
❎ 👫, ⚒ 👫 📛 `None` 🕐❔ 🏗 👆 `FastAPI` 📱:
```Python hl_lines="9"
{!../../../docs_src/extending_openapi/tutorial002.py!}
```
### 🔌 🛃 🩺
🔜 👆 💪 ✍ *➡ 🛠️* 🛃 🩺.
👆 💪 🏤-⚙️ FastAPI 🔗 🔢 ✍ 🕸 📃 🩺, &amp; 🚶‍♀️ 👫 💪 ❌:
* `openapi_url`: 📛 🌐❔ 🕸 📃 🩺 💪 🤚 🗄 🔗 👆 🛠️. 👆 💪 ⚙️ 📥 🔢 `app.openapi_url`.
* `title`: 📛 👆 🛠️.
* `oauth2_redirect_url`: 👆 💪 ⚙️ `app.swagger_ui_oauth2_redirect_url` 📥 ⚙️ 🔢.
* `swagger_js_url`: 📛 🌐❔ 🕸 👆 🦁 🎚 🩺 💪 🤚 **🕸** 📁. 👉 1⃣ 👈 👆 👍 📱 🔜 🍦.
* `swagger_css_url`: 📛 🌐❔ 🕸 👆 🦁 🎚 🩺 💪 🤚 **🎚** 📁. 👉 1⃣ 👈 👆 👍 📱 🔜 🍦.
&amp; ➡ 📄...
```Python hl_lines="2-6 14-22 25-27 30-36"
{!../../../docs_src/extending_openapi/tutorial002.py!}
```
!!! tip
*➡ 🛠️* `swagger_ui_redirect` 👩‍🎓 🕐❔ 👆 ⚙️ Oauth2⃣.
🚥 👆 🛠️ 👆 🛠️ ⏮️ Oauth2⃣ 🐕‍🦺, 👆 🔜 💪 🔓 &amp; 👟 🔙 🛠️ 🩺 ⏮️ 📎 🎓. &amp; 🔗 ⏮️ ⚫️ ⚙️ 🎰 Oauth2⃣ 🤝.
🦁 🎚 🔜 🍵 ⚫️ ⛅ 🎑 👆, ✋️ ⚫️ 💪 👉 "❎" 👩‍🎓.
### ✍ *➡ 🛠️* 💯 ⚫️
🔜, 💪 💯 👈 🌐 👷, ✍ *➡ 🛠️*:
```Python hl_lines="39-41"
{!../../../docs_src/extending_openapi/tutorial002.py!}
```
### 💯 ⚫️
🔜, 👆 🔜 💪 🔌 👆 📻, 🚶 👆 🩺 <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>, &amp; 🔃 📃.
&amp; 🍵 🕸, 👆 🔜 💪 👀 🩺 👆 🛠️ &amp; 🔗 ⏮️ ⚫️.
## 🛠️ 🦁 🎚
👆 💪 🔗 <a href="https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration" class="external-link" target="_blank">🦁 🎚 🔢</a>.
🔗 👫, 🚶‍♀️ `swagger_ui_parameters` ❌ 🕐❔ 🏗 `FastAPI()` 📱 🎚 ⚖️ `get_swagger_ui_html()` 🔢.
`swagger_ui_parameters` 📨 📖 ⏮️ 📳 🚶‍♀️ 🦁 🎚 🔗.
FastAPI 🗜 📳 **🎻** ⚒ 👫 🔗 ⏮️ 🕸, 👈 ⚫️❔ 🦁 🎚 💪.
### ❎ ❕ 🎦
🖼, 👆 💪 ❎ ❕ 🎦 🦁 🎚.
🍵 🔀 ⚒, ❕ 🎦 🛠️ 🔢:
<img src="/img/tutorial/extending-openapi/image02.png">
✋️ 👆 💪 ❎ ⚫️ ⚒ `syntaxHighlight` `False`:
```Python hl_lines="3"
{!../../../docs_src/extending_openapi/tutorial003.py!}
```
...&amp; ⤴️ 🦁 🎚 🏆 🚫 🎦 ❕ 🎦 🚫🔜:
<img src="/img/tutorial/extending-openapi/image03.png">
### 🔀 🎢
🎏 🌌 👆 💪 ⚒ ❕ 🎦 🎢 ⏮️ 🔑 `"syntaxHighlight.theme"` (👀 👈 ⚫️ ✔️ ❣ 🖕):
```Python hl_lines="3"
{!../../../docs_src/extending_openapi/tutorial004.py!}
```
👈 📳 🔜 🔀 ❕ 🎦 🎨 🎢:
<img src="/img/tutorial/extending-openapi/image04.png">
### 🔀 🔢 🦁 🎚 🔢
FastAPI 🔌 🔢 📳 🔢 ☑ 🌅 ⚙️ 💼.
⚫️ 🔌 👫 🔢 📳:
```Python
{!../../../fastapi/openapi/docs.py[ln:7-13]!}
```
👆 💪 🔐 🙆 👫 ⚒ 🎏 💲 ❌ `swagger_ui_parameters`.
🖼, ❎ `deepLinking` 👆 💪 🚶‍♀️ 👉 ⚒ `swagger_ui_parameters`:
```Python hl_lines="3"
{!../../../docs_src/extending_openapi/tutorial005.py!}
```
### 🎏 🦁 🎚 🔢
👀 🌐 🎏 💪 📳 👆 💪 ⚙️, ✍ 🛂 <a href="https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration" class="external-link" target="_blank">🩺 🦁 🎚 🔢</a>.
### 🕸-🕴 ⚒
🦁 🎚 ✔ 🎏 📳 **🕸-🕴** 🎚 (🖼, 🕸 🔢).
FastAPI 🔌 👫 🕸-🕴 `presets` ⚒:
```JavaScript
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
]
```
👫 **🕸** 🎚, 🚫 🎻, 👆 💪 🚫 🚶‍♀️ 👫 ⚪️➡️ 🐍 📟 🔗.
🚥 👆 💪 ⚙️ 🕸-🕴 📳 💖 📚, 👆 💪 ⚙️ 1⃣ 👩‍🔬 🔛. 🔐 🌐 🦁 🎚 *➡ 🛠️* &amp; ❎ ✍ 🙆 🕸 👆 💪.

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,56 @@
# 🕹
**FastAPI** ⚓️ 🔛 **🔫** 🐩, ⚫️ 📶 ⏩ 🛠️ 🙆 **🕹** 🗃 🔗 ⏮️ 🔫.
👆 💪 🌀 😐 FastAPI *➡ 🛠️* ⏮️ 🕹 🔛 🎏 🈸.
!!! tip
**🕹** ❎ 📶 🎯 ⚙️ 💼.
⚫️ ✔️ **📈** &amp; **⚠** 🕐❔ 🔬 ⚠ **🕸 🔗**.
⚒ 💭 👆 🔬 🚥 **💰** 👆 ⚙️ 💼 ⚖ **👐**. 👶
## 🕹 🗃
📥 **🕹** 🗃 👈 ✔️ **🔫** 🐕‍🦺. 👆 💪 ⚙️ 👫 ⏮️ **FastAPI**:
* <a href="https://strawberry.rocks/" class="external-link" target="_blank">🍓</a> 👶
* ⏮️ <a href="https://strawberry.rocks/docs/integrations/fastapi" class="external-link" target="_blank">🩺 FastAPI</a>
* <a href="https://ariadnegraphql.org/" class="external-link" target="_blank">👸</a>
* ⏮️ <a href="https://ariadnegraphql.org/docs/starlette-integration" class="external-link" target="_blank">🩺 💃</a> (👈 ✔ FastAPI)
* <a href="https://tartiflette.io/" class="external-link" target="_blank">🍟</a>
* ⏮️ <a href="https://tartiflette.github.io/tartiflette-asgi/" class="external-link" target="_blank">🍟 🔫</a> 🚚 🔫 🛠️
* <a href="https://graphene-python.org/" class="external-link" target="_blank">⚗</a>
* ⏮️ <a href="https://github.com/ciscorn/starlette-graphene3" class="external-link" target="_blank">💃-Graphene3⃣</a>
## 🕹 ⏮️ 🍓
🚥 👆 💪 ⚖️ 💚 👷 ⏮️ **🕹**, <a href="https://strawberry.rocks/" class="external-link" target="_blank">**🍓**</a> **👍** 🗃 ⚫️ ✔️ 🔧 🔐 **FastAPI** 🔧, ⚫️ 🌐 ⚓️ 🔛 **🆎 ✍**.
⚓️ 🔛 👆 ⚙️ 💼, 👆 5⃣📆 💖 ⚙️ 🎏 🗃, ✋️ 🚥 👆 💭 👤, 👤 🔜 🎲 🤔 👆 🔄 **🍓**.
📥 🤪 🎮 ❔ 👆 💪 🛠️ 🍓 ⏮️ FastAPI:
```Python hl_lines="3 22 25-26"
{!../../../docs_src/graphql/tutorial001.py!}
```
👆 💪 💡 🌅 🔃 🍓 <a href="https://strawberry.rocks/" class="external-link" target="_blank">🍓 🧾</a>.
&amp; 🩺 🔃 <a href="https://strawberry.rocks/docs/integrations/fastapi" class="external-link" target="_blank">🍓 ⏮️ FastAPI</a>.
## 🗝 `GraphQLApp` ⚪️➡️ 💃
⏮️ ⏬ 💃 🔌 `GraphQLApp` 🎓 🛠️ ⏮️ <a href="https://graphene-python.org/" class="external-link" target="_blank">⚗</a>.
⚫️ 😢 ⚪️➡️ 💃, ✋️ 🚥 👆 ✔️ 📟 👈 ⚙️ ⚫️, 👆 💪 💪 **↔** <a href="https://github.com/ciscorn/starlette-graphene3" class="external-link" target="_blank">💃-Graphene3⃣</a>, 👈 📔 🎏 ⚙️ 💼 &amp; ✔️ **🌖 🌓 🔢**.
!!! tip
🚥 👆 💪 🕹, 👤 🔜 👍 👆 ✅ 👅 <a href="https://strawberry.rocks/" class="external-link" target="_blank">🍓</a>, ⚫️ ⚓️ 🔛 🆎 ✍ ↩️ 🛃 🎓 &amp; 🆎.
## 💡 🌅
👆 💪 💡 🌅 🔃 **🕹** <a href="https://graphql.org/" class="external-link" target="_blank">🛂 🕹 🧾</a>.
👆 💪 ✍ 🌅 🔃 🔠 👈 🗃 🔬 🔛 👫 🔗.

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 153"
{!../../../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="153"
{!../../../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 166"
{!../../../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://pydantic-docs.helpmanual.io/usage/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,529 @@
# 🗄 (🔗) 💽 ⏮️ 🏒
!!! warning
🚥 👆 ▶️, 🔰 [🗄 (🔗) 💽](../tutorial/sql-databases.md){.internal-link target=_blank} 👈 ⚙️ 🇸🇲 🔜 🥃.
💭 🆓 🚶 👉.
🚥 👆 ▶️ 🏗 ⚪️➡️ 🖌, 👆 🎲 👻 📆 ⏮️ 🇸🇲 🐜 ([🗄 (🔗) 💽](../tutorial/sql-databases.md){.internal-link target=_blank}), ⚖️ 🙆 🎏 🔁 🐜.
🚥 👆 ⏪ ✔️ 📟 🧢 👈 ⚙️ <a href="https://docs.peewee-orm.com/en/latest/" class="external-link" target="_blank">🏒 🐜</a>, 👆 💪 ✅ 📥 ❔ ⚙️ ⚫️ ⏮️ **FastAPI**.
!!! warning "🐍 3⃣.7️⃣ ✔"
👆 🔜 💪 🐍 3⃣.7️⃣ ⚖️ 🔛 🔒 ⚙️ 🏒 ⏮️ FastAPI.
## 🏒 🔁
🏒 🚫 🔧 🔁 🛠️, ⚖️ ⏮️ 👫 🤯.
🏒 ✔️ 🏋️ 🔑 🔃 🚮 🔢 &amp; 🔃 ❔ ⚫️ 🔜 ⚙️.
🚥 👆 🛠️ 🈸 ⏮️ 🗝 🚫-🔁 🛠️, &amp; 💪 👷 ⏮️ 🌐 🚮 🔢, **⚫️ 💪 👑 🧰**.
✋️ 🚥 👆 💪 🔀 🔢, 🐕‍🦺 🌖 🌘 1⃣ 🔁 💽, 👷 ⏮️ 🔁 🛠️ (💖 FastAPI), ♒️, 👆 🔜 💪 🚮 🏗 📟 🔐 👈 🔢.
👐, ⚫️ 💪 ⚫️, &amp; 📥 👆 🔜 👀 ⚫️❔ ⚫️❔ 📟 👆 ✔️ 🚮 💪 ⚙️ 🏒 ⏮️ FastAPI.
!!! note "📡 "
👆 💪 ✍ 🌅 🔃 🏒 🧍 🔃 🔁 🐍 <a href="https://docs.peewee-orm.com/en/latest/peewee/database.html#async-with-gevent" class="external-link" target="_blank">🩺</a>, <a href="https://github.com/coleifer/peewee/issues/263#issuecomment-517347032" class="external-link" target="_blank">❔</a>, <a href="https://github.com/coleifer/peewee/pull/2072#issuecomment-563215132" class="external-link" target="_blank">🇵🇷</a>.
## 🎏 📱
👥 🔜 ✍ 🎏 🈸 🇸🇲 🔰 ([🗄 (🔗) 💽](../tutorial/sql-databases.md){.internal-link target=_blank}).
🌅 📟 🤙 🎏.
, 👥 🔜 🎯 🕴 🔛 🔺.
## 📁 📊
➡️ 💬 👆 ✔️ 📁 📛 `my_super_project` 👈 🔌 🎧-📁 🤙 `sql_app` ⏮️ 📊 💖 👉:
```
.
└── sql_app
├── __init__.py
├── crud.py
├── database.py
├── main.py
└── schemas.py
```
👉 🌖 🎏 📊 👥 ✔️ 🇸🇲 🔰.
🔜 ➡️ 👀 ⚫️❔ 🔠 📁/🕹 🔨.
## ✍ 🏒 🍕
➡️ 🔗 📁 `sql_app/database.py`.
### 🐩 🏒 📟
➡️ 🥇 ✅ 🌐 😐 🏒 📟, ✍ 🏒 💽:
```Python hl_lines="3 5 22"
{!../../../docs_src/sql_databases_peewee/sql_app/database.py!}
```
!!! tip
✔️ 🤯 👈 🚥 👆 💚 ⚙️ 🎏 💽, 💖 ✳, 👆 🚫 🚫 🔀 🎻. 👆 🔜 💪 ⚙️ 🎏 🏒 💽 🎓.
#### 🗒
❌:
```Python
check_same_thread=False
```
🌓 1⃣ 🇸🇲 🔰:
```Python
connect_args={"check_same_thread": False}
```
...⚫️ 💪 🕴 `SQLite`.
!!! info "📡 "
⚫️❔ 🎏 📡 [🗄 (🔗) 💽](../tutorial/sql-databases.md#note){.internal-link target=_blank} ✔.
### ⚒ 🏒 🔁-🔗 `PeeweeConnectionState`
👑 ❔ ⏮️ 🏒 &amp; FastAPI 👈 🏒 ⚓️ 🙇 🔛 <a href="https://docs.python.org/3/library/threading.html#thread-local-data" class="external-link" target="_blank">🐍 `threading.local`</a>, &amp; ⚫️ 🚫 ✔️ 🎯 🌌 🔐 ⚫️ ⚖️ ➡️ 👆 🍵 🔗/🎉 🔗 (🔨 🇸🇲 🔰).
&amp; `threading.local` 🚫 🔗 ⏮️ 🆕 🔁 ⚒ 🏛 🐍.
!!! note "📡 "
`threading.local` ⚙️ ✔️ "🎱" 🔢 👈 ✔️ 🎏 💲 🔠 🧵.
👉 ⚠ 🗝 🛠️ 🏗 ✔️ 1⃣ 👁 🧵 📍 📨, 🙅‍♂ 🌖, 🙅‍♂ 🌘.
⚙️ 👉, 🔠 📨 🔜 ✔️ 🚮 👍 💽 🔗/🎉, ❔ ☑ 🏁 🥅.
✋️ FastAPI, ⚙️ 🆕 🔁 ⚒, 💪 🍵 🌅 🌘 1⃣ 📨 🔛 🎏 🧵. &amp; 🎏 🕰, 👁 📨, ⚫️ 💪 🏃 💗 👜 🎏 🧵 (🧵), ⚓️ 🔛 🚥 👆 ⚙️ `async def` ⚖️ 😐 `def`. 👉 ⚫️❔ 🤝 🌐 🎭 📈 FastAPI.
✋️ 🐍 3⃣.7️⃣ &amp; 🔛 🚚 🌖 🏧 🎛 `threading.local`, 👈 💪 ⚙️ 🥉 🌐❔ `threading.local` 🔜 ⚙️, ✋️ 🔗 ⏮️ 🆕 🔁 ⚒.
👥 🔜 ⚙️ 👈. ⚫️ 🤙 <a href="https://docs.python.org/3/library/contextvars.html" class="external-link" target="_blank">`contextvars`</a>.
👥 🔜 🔐 🔗 🍕 🏒 👈 ⚙️ `threading.local` &amp; ❎ 👫 ⏮️ `contextvars`, ⏮️ 🔗 .
👉 5⃣📆 😑 🍖 🏗 (&amp; ⚫️ 🤙), 👆 🚫 🤙 💪 🍕 🤔 ❔ ⚫️ 👷 ⚙️ ⚫️.
👥 🔜 ✍ `PeeweeConnectionState`:
```Python hl_lines="10-19"
{!../../../docs_src/sql_databases_peewee/sql_app/database.py!}
```
👉 🎓 😖 ⚪️➡️ 🎁 🔗 🎓 ⚙️ 🏒.
⚫️ ✔️ 🌐 ⚛ ⚒ 🏒 ⚙️ `contextvars` ↩️ `threading.local`.
`contextvars` 👷 🍖 🎏 🌘 `threading.local`. ✋️ 🎂 🏒 🔗 📟 🤔 👈 👉 🎓 👷 ⏮️ `threading.local`.
, 👥 💪 🎱 ⚒ ⚫️ 👷 🚥 ⚫️ ⚙️ `threading.local`. `__init__`, `__setattr__`, &amp; `__getattr__` 🛠️ 🌐 ✔ 🎱 👉 ⚙️ 🏒 🍵 🤔 👈 ⚫️ 🔜 🔗 ⏮️ FastAPI.
!!! tip
👉 🔜 ⚒ 🏒 🎭 ☑ 🕐❔ ⚙️ ⏮️ FastAPI. 🚫 🎲 📂 ⚖️ 📪 🔗 👈 ⚙️, 🏗 ❌, ♒️.
✋️ ⚫️ 🚫 🤝 🏒 🔁 💎-🏋️. 👆 🔜 ⚙️ 😐 `def` 🔢 &amp; 🚫 `async def`.
### ⚙️ 🛃 `PeeweeConnectionState` 🎓
🔜, 📁 `._state` 🔗 🔢 🏒 💽 `db` 🎚 ⚙️ 🆕 `PeeweeConnectionState`:
```Python hl_lines="24"
{!../../../docs_src/sql_databases_peewee/sql_app/database.py!}
```
!!! tip
⚒ 💭 👆 📁 `db._state` *⏮️* 🏗 `db`.
!!! tip
👆 🔜 🎏 🙆 🎏 🏒 💽, 🔌 `PostgresqlDatabase`, `MySQLDatabase`, ♒️.
## ✍ 💽 🏷
➡️ 🔜 👀 📁 `sql_app/models.py`.
### ✍ 🏒 🏷 👆 💽
🔜 ✍ 🏒 🏷 (🎓) `User` &amp; `Item`.
👉 🎏 👆 🔜 🚥 👆 ⏩ 🏒 🔰 &amp; 🏷 ✔️ 🎏 💽 🇸🇲 🔰.
!!! tip
🏒 ⚙️ ⚖ "**🏷**" 🔗 👉 🎓 &amp; 👐 👈 🔗 ⏮️ 💽.
✋️ Pydantic ⚙️ ⚖ "**🏷**" 🔗 🕳 🎏, 💽 🔬, 🛠️, &amp; 🧾 🎓 &amp; 👐.
🗄 `db` ⚪️➡️ `database` (📁 `database.py` ⚪️➡️ 🔛) &amp; ⚙️ ⚫️ 📥.
```Python hl_lines="3 6-12 15-21"
{!../../../docs_src/sql_databases_peewee/sql_app/models.py!}
```
!!! tip
🏒 ✍ 📚 🎱 🔢.
⚫️ 🔜 🔁 🚮 `id` 🔢 🔢 👑 🔑.
⚫️ 🔜 ⚒ 📛 🏓 ⚓️ 🔛 🎓 📛.
`Item`, ⚫️ 🔜 ✍ 🔢 `owner_id` ⏮️ 🔢 🆔 `User`. ✋️ 👥 🚫 📣 ⚫️ 🙆.
## ✍ Pydantic 🏷
🔜 ➡️ ✅ 📁 `sql_app/schemas.py`.
!!! tip
❎ 😨 🖖 🏒 *🏷* &amp; Pydantic *🏷*, 👥 🔜 ✔️ 📁 `models.py` ⏮️ 🏒 🏷, &amp; 📁 `schemas.py` ⏮️ Pydantic 🏷.
👫 Pydantic 🏷 🔬 🌅 ⚖️ 🌘 "🔗" (☑ 📊 💠).
👉 🔜 👥 ❎ 😨 ⏪ ⚙️ 👯‍♂️.
### ✍ Pydantic *🏷* / 🔗
✍ 🌐 🎏 Pydantic 🏷 🇸🇲 🔰:
```Python hl_lines="16-18 21-22 25-30 34-35 38-39 42-48"
{!../../../docs_src/sql_databases_peewee/sql_app/schemas.py!}
```
!!! tip
📥 👥 🏗 🏷 ⏮️ `id`.
👥 🚫 🎯 ✔ `id` 🔢 🏒 🏷, ✋️ 🏒 🚮 1⃣ 🔁.
👥 ❎ 🎱 `owner_id` 🔢 `Item`.
### ✍ `PeeweeGetterDict` Pydantic *🏷* / 🔗
🕐❔ 👆 🔐 💛 🏒 🎚, 💖 `some_user.items`, 🏒 🚫 🚚 `list` `Item`.
⚫️ 🚚 🎁 🛃 🎚 🎓 `ModelSelect`.
⚫️ 💪 ✍ `list` 🚮 🏬 ⏮️ `list(some_user.items)`.
✋️ 🎚 ⚫️ 🚫 `list`. &amp; ⚫️ 🚫 ☑ 🐍 <a href="https://docs.python.org/3/glossary.html#term-generator" class="external-link" target="_blank">🚂</a>. ↩️ 👉, Pydantic 🚫 💭 🔢 ❔ 🗜 ⚫️ `list` Pydantic *🏷* / 🔗.
✋️ ⏮️ ⏬ Pydantic ✔ 🚚 🛃 🎓 👈 😖 ⚪️➡️ `pydantic.utils.GetterDict`, 🚚 🛠️ ⚙️ 🕐❔ ⚙️ `orm_mode = True` 🗃 💲 🐜 🏷 🔢.
👥 🔜 ✍ 🛃 `PeeweeGetterDict` 🎓 &amp; ⚙️ ⚫️ 🌐 🎏 Pydantic *🏷* / 🔗 👈 ⚙️ `orm_mode`:
```Python hl_lines="3 8-13 31 49"
{!../../../docs_src/sql_databases_peewee/sql_app/schemas.py!}
```
📥 👥 ✅ 🚥 🔢 👈 🔐 (✅ `.items` `some_user.items`) 👐 `peewee.ModelSelect`.
&amp; 🚥 👈 💼, 📨 `list` ⏮️ ⚫️.
&amp; ⤴️ 👥 ⚙️ ⚫️ Pydantic *🏷* / 🔗 👈 ⚙️ `orm_mode = True`, ⏮️ 📳 🔢 `getter_dict = PeeweeGetterDict`.
!!! tip
👥 🕴 💪 ✍ 1⃣ `PeeweeGetterDict` 🎓, &amp; 👥 💪 ⚙️ ⚫️ 🌐 Pydantic *🏷* / 🔗.
## 💩 🇨🇻
🔜 ➡️ 👀 📁 `sql_app/crud.py`.
### ✍ 🌐 💩 🇨🇻
✍ 🌐 🎏 💩 🇨🇻 🇸🇲 🔰, 🌐 📟 📶 🎏:
```Python hl_lines="1 4-5 8-9 12-13 16-20 23-24 27-30"
{!../../../docs_src/sql_databases_peewee/sql_app/crud.py!}
```
📤 🔺 ⏮️ 📟 🇸🇲 🔰.
👥 🚫 🚶‍♀️ `db` 🔢 🤭. ↩️ 👥 ⚙️ 🏷 🔗. 👉 ↩️ `db` 🎚 🌐 🎚, 👈 🔌 🌐 🔗 ⚛. 👈 ⚫️❔ 👥 ✔️ 🌐 `contextvars` 🔛.
🆖, 🕐❔ 🛬 📚 🎚, 💖 `get_users`, 👥 🔗 🤙 `list`, 💖:
```Python
list(models.User.select())
```
👉 🎏 🤔 👈 👥 ✔️ ✍ 🛃 `PeeweeGetterDict`. ✋️ 🛬 🕳 👈 ⏪ `list` ↩️ `peewee.ModelSelect` `response_model` *➡ 🛠️* ⏮️ `List[models.User]` (👈 👥 🔜 👀 ⏪) 🔜 👷 ☑.
## 👑 **FastAPI** 📱
&amp; 🔜 📁 `sql_app/main.py` ➡️ 🛠️ &amp; ⚙️ 🌐 🎏 🍕 👥 ✍ ⏭.
### ✍ 💽 🏓
📶 🙃 🌌 ✍ 💽 🏓:
```Python hl_lines="9-11"
{!../../../docs_src/sql_databases_peewee/sql_app/main.py!}
```
### ✍ 🔗
✍ 🔗 👈 🔜 🔗 💽 ▶️️ ▶️ 📨 &amp; 🔌 ⚫️ 🔚:
```Python hl_lines="23-29"
{!../../../docs_src/sql_databases_peewee/sql_app/main.py!}
```
📥 👥 ✔️ 🛁 `yield` ↩️ 👥 🤙 🚫 ⚙️ 💽 🎚 🔗.
⚫️ 🔗 💽 &amp; ♻ 🔗 💽 🔗 🔢 👈 🔬 🔠 📨 (⚙️ `contextvars` 🎱 ⚪️➡️ 🔛).
↩️ 💽 🔗 ⚠ 👤/🅾 🚧, 👉 🔗 ✍ ⏮️ 😐 `def` 🔢.
&amp; ⤴️, 🔠 *➡ 🛠️ 🔢* 👈 💪 🔐 💽 👥 🚮 ⚫️ 🔗.
✋️ 👥 🚫 ⚙️ 💲 👐 👉 🔗 (⚫️ 🤙 🚫 🤝 🙆 💲, ⚫️ ✔️ 🛁 `yield`). , 👥 🚫 🚮 ⚫️ *➡ 🛠️ 🔢* ✋️ *➡ 🛠️ 👨‍🎨* `dependencies` 🔢:
```Python hl_lines="32 40 47 59 65 72"
{!../../../docs_src/sql_databases_peewee/sql_app/main.py!}
```
### 🔑 🔢 🎧-🔗
🌐 `contextvars` 🍕 👷, 👥 💪 ⚒ 💭 👥 ✔️ 🔬 💲 `ContextVar` 🔠 📨 👈 ⚙️ 💽, &amp; 👈 💲 🔜 ⚙️ 💽 🇵🇸 (🔗, 💵, ♒️) 🎂 📨.
👈, 👥 💪 ✍ 1⃣ `async` 🔗 `reset_db_state()` 👈 ⚙️ 🎧-🔗 `get_db()`. ⚫️ 🔜 ⚒ 💲 🔑 🔢 (⏮️ 🔢 `dict`) 👈 🔜 ⚙️ 💽 🇵🇸 🎂 📨. &amp; ⤴️ 🔗 `get_db()` 🔜 🏪 ⚫️ 💽 🇵🇸 (🔗, 💵, ♒️).
```Python hl_lines="18-20"
{!../../../docs_src/sql_databases_peewee/sql_app/main.py!}
```
**⏭ 📨**, 👥 🔜 ⏲ 👈 🔑 🔢 🔄 `async` 🔗 `reset_db_state()` &amp; ⤴️ ✍ 🆕 🔗 `get_db()` 🔗, 👈 🆕 📨 🔜 ✔️ 🚮 👍 💽 🇵🇸 (🔗, 💵, ♒️).
!!! tip
FastAPI 🔁 🛠️, 1⃣ 📨 💪 ▶️ 🛠️, &amp; ⏭ 🏁, 1⃣ 📨 💪 📨 &amp; ▶️ 🏭 👍, &amp; ⚫️ 🌐 💪 🛠️ 🎏 🧵.
✋️ 🔑 🔢 🤔 👫 🔁 ⚒,, 🏒 💽 🇵🇸 ⚒ `async` 🔗 `reset_db_state()` 🔜 🚧 🚮 👍 💽 🎂 🎂 📨.
&amp; 🎏 🕰, 🎏 🛠️ 📨 🔜 ✔️ 🚮 👍 💽 🇵🇸 👈 🔜 🔬 🎂 📨.
#### 🏒 🗳
🚥 👆 ⚙️ <a href="https://docs.peewee-orm.com/en/latest/peewee/database.html#dynamically-defining-a-database" class="external-link" target="_blank">🏒 🗳</a>, ☑ 💽 `db.obj`.
, 👆 🔜 ⏲ ⚫️ ⏮️:
```Python hl_lines="3-4"
async def reset_db_state():
database.db.obj._state._state.set(db_state_default.copy())
database.db.obj._state.reset()
```
### ✍ 👆 **FastAPI** *➡ 🛠️*
🔜, 😒, 📥 🐩 **FastAPI** *➡ 🛠️* 📟.
```Python hl_lines="32-37 40-43 46-53 56-62 65-68 71-79"
{!../../../docs_src/sql_databases_peewee/sql_app/main.py!}
```
### 🔃 `def` 🆚 `async def`
🎏 ⏮️ 🇸🇲, 👥 🚫 🔨 🕳 💖:
```Python
user = await models.User.select().first()
```
...✋️ ↩️ 👥 ⚙️:
```Python
user = models.User.select().first()
```
, 🔄, 👥 🔜 📣 *➡ 🛠️ 🔢* &amp; 🔗 🍵 `async def`, ⏮️ 😐 `def`,:
```Python hl_lines="2"
# Something goes here
def read_users(skip: int = 0, limit: int = 100):
# Something goes here
```
## 🔬 🏒 ⏮️ 🔁
👉 🖼 🔌 *➡ 🛠️* 👈 🔬 📏 🏭 📨 ⏮️ `time.sleep(sleep_time)`.
⚫️ 🔜 ✔️ 💽 🔗 📂 ▶️ &amp; 🔜 ⌛ 🥈 ⏭ 🙇 🔙. &amp; 🔠 🆕 📨 🔜 ⌛ 🕐 🥈 🌘.
👉 🔜 💪 ➡️ 👆 💯 👈 👆 📱 ⏮️ 🏒 &amp; FastAPI 🎭 ☑ ⏮️ 🌐 💩 🔃 🧵.
🚥 👆 💚 ✅ ❔ 🏒 🔜 💔 👆 📱 🚥 ⚙️ 🍵 🛠️, 🚶 `sql_app/database.py` 📁 &amp; 🏤 ⏸:
```Python
# db._state = PeeweeConnectionState()
```
&amp; 📁 `sql_app/main.py` 📁, 🏤 💪 `async` 🔗 `reset_db_state()` &amp; ❎ ⚫️ ⏮️ `pass`:
```Python
async def reset_db_state():
# database.db._state._state.set(db_state_default.copy())
# database.db._state.reset()
pass
```
⤴️ 🏃 👆 📱 ⏮️ Uvicorn:
<div class="termy">
```console
$ uvicorn sql_app.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/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a> &amp; ✍ 👩‍❤‍👨 👩‍💻.
⤴️ 📂 1⃣0⃣ 📑 <a href="http://127.0.0.1:8000/docs#/default/read_slow_users_slowusers__get" class="external-link" target="_blank">http://127.0.0.1:8000/docs#/default/read_🐌_👩💻_slowusers_ = </a> 🎏 🕰.
🚶 *➡ 🛠️* "🤚 `/slowusers/`" 🌐 📑. ⚙️ "🔄 ⚫️ 👅" 🔼 &amp; 🛠️ 📨 🔠 📑, 1⃣ ▶️️ ⏮️ 🎏.
📑 🔜 ⌛ 🍖 &amp; ⤴️ 👫 🔜 🎦 `Internal Server Error`.
### ⚫️❔ 🔨
🥇 📑 🔜 ⚒ 👆 📱 ✍ 🔗 💽 &amp; ⌛ 🥈 ⏭ 🙇 🔙 &amp; 📪 💽 🔗.
⤴️, 📨 ⏭ 📑, 👆 📱 🔜 ⌛ 🕐 🥈 🌘, &amp; 🔛.
👉 ⛓ 👈 ⚫️ 🔜 🔚 🆙 🏁 🏁 📑' 📨 ⏪ 🌘 ⏮️ 🕐.
⤴️ 1⃣ 🏁 📨 👈 ⌛ 🌘 🥈 🔜 🔄 📂 💽 🔗, ✋️ 1⃣ 📚 ⏮️ 📨 🎏 📑 🔜 🎲 🍵 🎏 🧵 🥇 🕐, ⚫️ 🔜 ✔️ 🎏 💽 🔗 👈 ⏪ 📂, &amp; 🏒 🔜 🚮 ❌ &amp; 👆 🔜 👀 ⚫️ 📶, &amp; 📨 🔜 ✔️ `Internal Server Error`.
👉 🔜 🎲 🔨 🌅 🌘 1⃣ 📚 📑.
🚥 👆 ✔️ 💗 👩‍💻 💬 👆 📱 ⚫️❔ 🎏 🕰, 👉 ⚫️❔ 💪 🔨.
&amp; 👆 📱 ▶️ 🍵 🌅 &amp; 🌖 👩‍💻 🎏 🕰, ⌛ 🕰 👁 📨 💪 📏 &amp; 📏 ⏲ ❌.
### 🔧 🏒 ⏮️ FastAPI
🔜 🚶 🔙 📁 `sql_app/database.py`, &amp; ✍ ⏸:
```Python
db._state = PeeweeConnectionState()
```
&amp; 📁 `sql_app/main.py` 📁, ✍ 💪 `async` 🔗 `reset_db_state()`:
```Python
async def reset_db_state():
database.db._state._state.set(db_state_default.copy())
database.db._state.reset()
```
❎ 👆 🏃‍♂ 📱 &amp; ▶️ ⚫️ 🔄.
🔁 🎏 🛠️ ⏮️ 1⃣0⃣ 📑. 👉 🕰 🌐 👫 🔜 ⌛ &amp; 👆 🔜 🤚 🌐 🏁 🍵 ❌.
...👆 🔧 ⚫️ ❗
## 📄 🌐 📁
💭 👆 🔜 ✔️ 📁 📛 `my_super_project` (⚖️ 👐 👆 💚) 👈 🔌 🎧-📁 🤙 `sql_app`.
`sql_app` 🔜 ✔️ 📄 📁:
* `sql_app/__init__.py`: 🛁 📁.
* `sql_app/database.py`:
```Python
{!../../../docs_src/sql_databases_peewee/sql_app/database.py!}
```
* `sql_app/models.py`:
```Python
{!../../../docs_src/sql_databases_peewee/sql_app/models.py!}
```
* `sql_app/schemas.py`:
```Python
{!../../../docs_src/sql_databases_peewee/sql_app/schemas.py!}
```
* `sql_app/crud.py`:
```Python
{!../../../docs_src/sql_databases_peewee/sql_app/crud.py!}
```
* `sql_app/main.py`:
```Python
{!../../../docs_src/sql_databases_peewee/sql_app/main.py!}
```
## 📡
!!! warning
👉 📶 📡 👈 👆 🎲 🚫 💪.
### ⚠
🏒 ⚙️ <a href="https://docs.python.org/3/library/threading.html#thread-local-data" class="external-link" target="_blank">`threading.local`</a> 🔢 🏪 ⚫️ 💽 "🇵🇸" 💽 (🔗, 💵, ♒️).
`threading.local` ✍ 💲 🌟 ⏮️ 🧵, ✋️ 🔁 🛠️ 🔜 🏃 🌐 📟 (✅ 🔠 📨) 🎏 🧵, &amp; 🎲 🚫 ✔.
🔛 🔝 👈, 🔁 🛠️ 💪 🏃 🔁 📟 🧵 (⚙️ `asyncio.run_in_executor`), ✋️ 🔗 🎏 📨.
👉 ⛓ 👈, ⏮️ 🏒 ⏮️ 🛠️, 💗 📋 💪 ⚙️ 🎏 `threading.local` 🔢 &amp; 🔚 🆙 🤝 🎏 🔗 &amp; 💽 (👈 👫 🚫🔜 🚫), &amp; 🎏 🕰, 🚥 👫 🛠️ 🔁 👤/🅾-🚧 📟 🧵 (⏮️ 😐 `def` 🔢 FastAPI, *➡ 🛠️* &amp; 🔗), 👈 📟 🏆 🚫 ✔️ 🔐 💽 🇵🇸 🔢, ⏪ ⚫️ 🍕 🎏 📨 &amp; ⚫️ 🔜 💪 🤚 🔐 🎏 💽 🇵🇸.
### 🔑 🔢
🐍 3⃣.7️⃣ ✔️ <a href="https://docs.python.org/3/library/contextvars.html" class="external-link" target="_blank">`contextvars`</a> 👈 💪 ✍ 🇧🇿 🔢 📶 🎏 `threading.local`, ✋️ 🔗 👫 🔁 ⚒.
📤 📚 👜 ✔️ 🤯.
`ContextVar` ✔️ ✍ 🔝 🕹, 💖:
```Python
some_var = ContextVar("some_var", default="default value")
```
⚒ 💲 ⚙️ ⏮️ "🔑" (✅ ⏮️ 📨) ⚙️:
```Python
some_var.set("new value")
```
🤚 💲 🙆 🔘 🔑 (✅ 🙆 🍕 🚚 ⏮️ 📨) ⚙️:
```Python
some_var.get()
```
### ⚒ 🔑 🔢 `async` 🔗 `reset_db_state()`
🚥 🍕 🔁 📟 ⚒ 💲 ⏮️ `some_var.set("updated in function")` (✅ 💖 `async` 🔗), 🎂 📟 ⚫️ &amp; 📟 👈 🚶 ⏮️ (✅ 📟 🔘 `async` 🔢 🤙 ⏮️ `await`) 🔜 👀 👈 🆕 💲.
, 👆 💼, 🚥 👥 ⚒ 🏒 🇵🇸 🔢 (⏮️ 🔢 `dict`) `async` 🔗, 🌐 🎂 🔗 📟 👆 📱 🔜 👀 👉 💲 &amp; 🔜 💪 ♻ ⚫️ 🎂 📨.
&amp; 🔑 🔢 🔜 ⚒ 🔄 ⏭ 📨, 🚥 👫 🛠️.
### ⚒ 💽 🇵🇸 🔗 `get_db()`
`get_db()` 😐 `def` 🔢, **FastAPI** 🔜 ⚒ ⚫️ 🏃 🧵, ⏮️ *📁* "🔑", 🧑‍🤝‍🧑 🎏 💲 🔑 🔢 ( `dict` ⏮️ ⏲ 💽 🇵🇸). ⤴️ ⚫️ 💪 🚮 💽 🇵🇸 👈 `dict`, 💖 🔗, ♒️.
✋️ 🚥 💲 🔑 🔢 (🔢 `dict`) ⚒ 👈 😐 `def` 🔢, ⚫️ 🔜 ✍ 🆕 💲 👈 🔜 🚧 🕴 👈 🧵 🧵, &amp; 🎂 📟 (💖 *➡ 🛠️ 🔢*) 🚫🔜 ✔️ 🔐 ⚫️. `get_db()` 👥 💪 🕴 ⚒ 💲 `dict`, ✋️ 🚫 🎂 `dict` ⚫️.
, 👥 💪 ✔️ `async` 🔗 `reset_db_state()` ⚒ `dict` 🔑 🔢. 👈 🌌, 🌐 📟 ✔️ 🔐 🎏 `dict` 💽 🇵🇸 👁 📨.
### 🔗 &amp; 🔌 🔗 `get_db()`
⤴️ ⏭ ❔ 🔜, ⚫️❔ 🚫 🔗 &amp; 🔌 💽 `async` 🔗 ⚫️, ↩️ `get_db()`❓
`async` 🔗 ✔️ `async` 🔑 🔢 🛡 🎂 📨, ✋️ 🏗 &amp; 📪 💽 🔗 ⚠ 🚧, ⚫️ 💪 📉 🎭 🚥 ⚫️ 📤.
👥 💪 😐 `def` 🔗 `get_db()`.

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-16"
{!../../../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 -e ."[dev,doc,test]"
---> 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 📄 🔕
* Kubernete ⏮️ 🚧 🕹 💖 👌
* ⏮️ 🔢 🦲 💖 🛂-👨‍💼 📄 🔕
* 🍵 🔘 ☁ 🐕‍🦺 🍕 👫 🐕‍🦺 (✍ 🔛 👶)
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; 📚 💼, ⚫️ 🔜 ⚒ 💭 🎏 🦲 ⚖️ 🈸 🏃, 🖼, 💽.
### 🖼 🧰 🏃 🕴
🖼 🧰 👈 💪 👉 👨‍🏭:
*
* Kubernete
* ☁ ✍
* ☁ 🐝 📳
*
* 👨‍💻
* 🍵 🔘 ☁ 🐕‍🦺 🍕 👫 🐕‍🦺
* 🎏...
👤 🔜 🤝 👆 🌅 🧱 🖼 ⏭ 📃.
## ⏏
🎏 ⚒ 💭 👆 🈸 🏃 🔛 🕴, 👆 🎲 💚 ⚒ 💭 ⚫️ **⏏** ⏮️ ❌.
### 👥 ⚒ ❌
👥, 🗿, ⚒ **❌**, 🌐 🕰. 🖥 🌖 *🕧* ✔️ **🐛** 🕵‍♂ 🎏 🥉. 👶
&amp; 👥 👩‍💻 🚧 📉 📟 👥 🔎 👈 🐛 &amp; 👥 🛠️ 🆕 ⚒ (🎲 ❎ 🆕 🐛 💁‍♂️ 👶).
### 🤪 ❌ 🔁 🍵
🕐❔ 🏗 🕸 🔗 ⏮️ FastAPI, 🚥 📤 ❌ 👆 📟, FastAPI 🔜 🛎 🔌 ⚫️ 👁 📨 👈 ⏲ ❌. 🛡
👩‍💻 🔜 🤚 **5⃣0⃣0⃣ 🔗 💽 ❌** 👈 📨, ✋️ 🈸 🔜 😣 👷 ⏭ 📨 ↩️ 💥 🍕.
### 🦏 ❌ - 💥
👐, 📤 5⃣📆 💼 🌐❔ 👥 ✍ 📟 👈 **💥 🎂 🈸** ⚒ Uvicorn &amp; 🐍 💥. 👶
&amp; , 👆 🔜 🎲 🚫 💚 🈸 🚧 ☠️ ↩️ 📤 ❌ 1⃣ 🥉, 👆 🎲 💚 ⚫️ **😣 🏃** 🌘 *➡ 🛠️* 👈 🚫 💔.
### ⏏ ⏮️ 💥
✋️ 👈 💼 ⏮️ 🤙 👎 ❌ 👈 💥 🏃‍♂ **🛠️**, 👆 🔜 💚 🔢 🦲 👈 🈚 **🔁** 🛠️, 🌘 👩‍❤‍👨 🕰...
!!! tip
...👐 🚥 🎂 🈸 **💥 ⏪** ⚫️ 🎲 🚫 ⚒ 🔑 🚧 🔁 ⚫️ ♾. ✋️ 📚 💼, 👆 🔜 🎲 👀 ⚫️ ⏮️ 🛠️, ⚖️ 🌘 ▶️️ ⏮️ 🛠️.
➡️ 🎯 🔛 👑 💼, 🌐❔ ⚫️ 💪 💥 🍕 🎯 💼 **🔮**, &amp; ⚫️ ⚒ 🔑 ⏏ ⚫️.
👆 🔜 🎲 💚 ✔️ 👜 🈚 🔁 👆 🈸 **🔢 🦲**, ↩️ 👈 ☝, 🎏 🈸 ⏮️ Uvicorn &amp; 🐍 ⏪ 💥, 📤 🕳 🎏 📟 🎏 📱 👈 💪 🕳 🔃 ⚫️.
### 🖼 🧰 ⏏ 🔁
🏆 💼, 🎏 🧰 👈 ⚙️ **🏃 📋 🔛 🕴** ⚙️ 🍵 🏧 **⏏**.
🖼, 👉 💪 🍵:
*
* Kubernete
* ☁ ✍
* ☁ 🐝 📳
*
* 👨‍💻
* 🍵 🔘 ☁ 🐕‍🦺 🍕 👫 🐕‍🦺
* 🎏...
## 🧬 - 🛠️ &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 👨‍🏭 🛠️**
* **Kubernete** &amp; 🎏 📎 **📦 ⚙️**
* 🕳 **☁** 🧽 🔜 👂 🔛 **📢** &amp; **⛴**. 🧬 🔜 ✔️ **💗 📦**, 🔠 ⏮️ **1⃣ Uvicorn 🛠️** 🏃‍♂
* **☁ 🐕‍🦺** 👈 🍵 👉 👆
* ☁ 🐕‍🦺 🔜 🎲 **🍵 🧬 👆**. ⚫️ 🔜 🎲 ➡️ 👆 🔬 **🛠️ 🏃**, ⚖️ **📦 🖼** ⚙️, 🙆 💼, ⚫️ 🔜 🌅 🎲 **👁 Uvicorn 🛠️**, &amp; ☁ 🐕‍🦺 🔜 🈚 🔁 ⚫️.
!!! tip
🚫 😟 🚥 👫 🏬 🔃 **📦**, ☁, ⚖️ Kubernete 🚫 ⚒ 📚 🔑.
👤 🔜 💬 👆 🌅 🔃 📦 🖼, ☁, Kubernete, ♒️. 🔮 📃: [FastAPI 📦 - ☁](./docker.md){.internal-link target=_blank}.
## ⏮️ 🔁 ⏭ ▶️
📤 📚 💼 🌐❔ 👆 💚 🎭 📶 **⏭ ▶️** 👆 🈸.
🖼, 👆 💪 💚 🏃 **💽 🛠️**.
✋️ 🌅 💼, 👆 🔜 💚 🎭 👉 🔁 🕴 **🕐**.
, 👆 🔜 💚 ✔️ **👁 🛠️** 🎭 👈 **⏮️ 🔁**, ⏭ ▶️ 🈸.
&amp; 👆 🔜 ✔️ ⚒ 💭 👈 ⚫️ 👁 🛠️ 🏃 👈 ⏮️ 🔁 ** 🚥 ⏮️, 👆 ▶️ **💗 🛠️** (💗 👨‍🏭) 🈸 ⚫️. 🚥 👈 🔁 🏃 **💗 🛠️**, 👫 🔜 **❎** 👷 🏃‍♂ ⚫️ 🔛 **🔗**, &amp; 🚥 📶 🕳 💎 💖 💽 🛠️, 👫 💪 🤕 ⚔ ⏮️ 🔠 🎏.
↗️, 📤 💼 🌐❔ 📤 🙅‍♂ ⚠ 🏃 ⏮️ 🔁 💗 🕰, 👈 💼, ⚫️ 📚 ⏩ 🍵.
!!! tip
, ✔️ 🤯 👈 ⚓️ 🔛 👆 🖥, 💼 👆 **5⃣📆 🚫 💪 🙆 ⏮️ 🔁** ⏭ ▶️ 👆 🈸.
👈 💼, 👆 🚫🔜 ✔️ 😟 🔃 🙆 👉. 🤷
### 🖼 ⏮️ 🔁 🎛
👉 🔜 **🪀 🙇** 🔛 🌌 👆 **🛠️ 👆 ⚙️**, &amp; ⚫️ 🔜 🎲 🔗 🌌 👆 ▶️ 📋, 🚚 ⏏, ♒️.
📥 💪 💭:
* "🕑 📦" Kubernete 👈 🏃 ⏭ 👆 📱 📦
* 🎉 ✍ 👈 🏃 ⏮️ 🔁 &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,258 @@
# 🛠️ FastAPI 🔛 🪔
👉 📄 👆 🔜 💡 ❔ 💪 🛠️ **FastAPI** 🈸 🔛 <a href="https://www.deta.sh/?ref=fastapi" class="external-link" target="_blank">🪔</a> ⚙️ 🆓 📄. 👶
⚫️ 🔜 ✊ 👆 🔃 **1⃣0⃣ ⏲**.
!!! info
<a href="https://www.deta.sh/?ref=fastapi" class="external-link" target="_blank">🪔</a> **FastAPI** 💰. 👶
## 🔰 **FastAPI** 📱
* ✍ 📁 👆 📱, 🖼, `./fastapideta/` &amp; ⛔ 🔘 ⚫️.
### FastAPI 📟
*`main.py` 📁 ⏮️:
```Python
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):
return {"item_id": item_id}
```
### 📄
🔜, 🎏 📁 ✍ 📁 `requirements.txt` ⏮️:
```text
fastapi
```
!!! tip
👆 🚫 💪 ❎ Uvicorn 🛠️ 🔛 🪔, 👐 👆 🔜 🎲 💚 ❎ ⚫️ 🌐 💯 👆 📱.
### 📁 📊
👆 🔜 🔜 ✔️ 1⃣ 📁 `./fastapideta/` ⏮️ 2⃣ 📁:
```
.
└── main.py
└── requirements.txt
```
## ✍ 🆓 🪔 🏧
🔜 ✍ <a href="https://www.deta.sh/?ref=fastapi" class="external-link" target="_blank">🆓 🏧 🔛 🪔</a>, 👆 💪 📧 &amp; 🔐.
👆 🚫 💪 💳.
## ❎ ✳
🕐 👆 ✔️ 👆 🏧, ❎ 🪔 <abbr title="Command Line Interface application">✳</abbr>:
=== "💾, 🇸🇻"
<div class="termy">
```console
$ curl -fsSL https://get.deta.dev/cli.sh | sh
```
</div>
=== "🚪 📋"
<div class="termy">
```console
$ iwr https://get.deta.dev/cli.ps1 -useb | iex
```
</div>
⏮️ ❎ ⚫️, 📂 🆕 📶 👈 ❎ ✳ 🔍.
🆕 📶, ✔ 👈 ⚫️ ☑ ❎ ⏮️:
<div class="termy">
```console
$ deta --help
Deta command line interface for managing deta micros.
Complete documentation available at https://docs.deta.sh
Usage:
deta [flags]
deta [command]
Available Commands:
auth Change auth settings for a deta micro
...
```
</div>
!!! tip
🚥 👆 ✔️ ⚠ ❎ ✳, ✅ <a href="https://docs.deta.sh/docs/micros/getting_started?ref=fastapi" class="external-link" target="_blank">🛂 🪔 🩺</a>.
## 💳 ⏮️ ✳
🔜 💳 🪔 ⚪️➡️ ✳ ⏮️:
<div class="termy">
```console
$ deta login
Please, log in from the web page. Waiting..
Logged in successfully.
```
</div>
👉 🔜 📂 🕸 🖥 &amp; 🔓 🔁.
## 🛠️ ⏮️ 🪔
⏭, 🛠️ 👆 🈸 ⏮️ 🪔 ✳:
<div class="termy">
```console
$ deta new
Successfully created a new micro
// Notice the "endpoint" 🔍
{
"name": "fastapideta",
"runtime": "python3.7",
"endpoint": "https://qltnci.deta.dev",
"visor": "enabled",
"http_auth": "enabled"
}
Adding dependencies...
---> 100%
Successfully installed fastapi-0.61.1 pydantic-1.7.2 starlette-0.13.6
```
</div>
👆 🔜 👀 🎻 📧 🎏:
```JSON hl_lines="4"
{
"name": "fastapideta",
"runtime": "python3.7",
"endpoint": "https://qltnci.deta.dev",
"visor": "enabled",
"http_auth": "enabled"
}
```
!!! tip
👆 🛠️ 🔜 ✔️ 🎏 `"endpoint"` 📛.
## ✅ ⚫️
🔜 📂 👆 🖥 👆 `endpoint` 📛. 🖼 🔛 ⚫️ `https://qltnci.deta.dev`, ✋️ 👆 🔜 🎏.
👆 🔜 👀 🎻 📨 ⚪️➡️ 👆 FastAPI 📱:
```JSON
{
"Hello": "World"
}
```
&amp; 🔜 🚶 `/docs` 👆 🛠️, 🖼 🔛 ⚫️ 🔜 `https://qltnci.deta.dev/docs`.
⚫️ 🔜 🎦 👆 🩺 💖:
<img src="/img/deployment/deta/image01.png">
## 🛠️ 📢 🔐
🔢, 🪔 🔜 🍵 🤝 ⚙️ 🍪 👆 🏧.
✋️ 🕐 👆 🔜, 👆 💪 ⚒ ⚫️ 📢 ⏮️:
<div class="termy">
```console
$ deta auth disable
Successfully disabled http auth
```
</div>
🔜 👆 💪 💰 👈 📛 ⏮️ 🙆 &amp; 👫 🔜 💪 🔐 👆 🛠️. 👶
## 🇺🇸🔍
㊗ ❗ 👆 🛠️ 👆 FastAPI 📱 🪔 ❗ 👶 👶
, 👀 👈 🪔 ☑ 🍵 🇺🇸🔍 👆, 👆 🚫 ✔️ ✊ 💅 👈 &amp; 💪 💭 👈 👆 👩‍💻 🔜 ✔️ 🔐 🗜 🔗. 👶 👶
## ✅ 🕶
⚪️➡️ 👆 🩺 🎚 (👫 🔜 📛 💖 `https://qltnci.deta.dev/docs`) 📨 📨 👆 *➡ 🛠️* `/items/{item_id}`.
🖼 ⏮️ 🆔 `5`.
🔜 🚶 <a href="https://web.deta.sh/" class="external-link" target="_blank">https://web.deta.sh</a>.
👆 🔜 👀 📤 📄 ◀️ 🤙 <abbr title="it comes from Micro(server)">"◾"</abbr> ⏮️ 🔠 👆 📱.
👆 🔜 👀 📑 ⏮️ "", &amp; 📑 "🕶", 🚶 📑 "🕶".
📤 👆 💪 ✔ ⏮️ 📨 📨 👆 📱.
👆 💪 ✍ 👫 &amp; 🏤-🤾 👫.
<img src="/img/deployment/deta/image02.png">
## 💡 🌅
☝, 👆 🔜 🎲 💚 🏪 💽 👆 📱 🌌 👈 😣 🔘 🕰. 👈 👆 💪 ⚙️ <a href="https://docs.deta.sh/docs/base/py_tutorial?ref=fastapi" class="external-link" target="_blank">🪔 🧢</a>, ⚫️ ✔️ 👍 **🆓 🎚**.
👆 💪 ✍ 🌅 <a href="https://docs.deta.sh?ref=fastapi" class="external-link" target="_blank">🪔 🩺</a>.
## 🛠️ 🔧
👟 🔙 🔧 👥 🔬 [🛠️ 🔧](./concepts.md){.internal-link target=_blank}, 📥 ❔ 🔠 👫 🔜 🍵 ⏮️ 🪔:
* **🇺🇸🔍**: 🍵 🪔, 👫 🔜 🤝 👆 📁 &amp; 🍵 🇺🇸🔍 🔁.
* **🏃‍♂ 🔛 🕴**: 🍵 🪔, 🍕 👫 🐕‍🦺.
* **⏏**: 🍵 🪔, 🍕 👫 🐕‍🦺.
* **🧬**: 🍵 🪔, 🍕 👫 🐕‍🦺.
* **💾**: 📉 🔁 🪔, 👆 💪 📧 👫 📈 ⚫️.
* **⏮️ 🔁 ⏭ ▶️**: 🚫 🔗 🐕‍🦺, 👆 💪 ⚒ ⚫️ 👷 ⏮️ 👫 💾 ⚙️ ⚖️ 🌖 ✍.
!!! note
🪔 🔧 ⚒ ⚫️ ⏩ (&amp; 🆓) 🛠️ 🙅 🈸 🔜.
⚫️ 💪 📉 📚 ⚙️ 💼, ✋️ 🎏 🕰, ⚫️ 🚫 🐕‍🦺 🎏, 💖 ⚙️ 🔢 💽 (↖️ ⚪️➡️ 🪔 👍 ☁ 💽 ⚙️), 🛃 🕹 🎰, ♒️.
👆 💪 ✍ 🌅 <a href="https://docs.deta.sh/docs/micros/about/" class="external-link" target="_blank">🪔 🩺</a> 👀 🚥 ⚫️ ▶️️ ⚒ 👆.

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; 🔗 👫 👯‍♂️ 📨 👫 🔗 🕸.
🌐 📦 🧾 ⚙️ (💖 ☁ ⚖️ Kubernete) ✔️ 👫 🕸 ⚒ 🛠️ 🔘 👫.
## 📦 &amp; 🛠️
**📦 🖼** 🛎 🔌 🚮 🗃 🔢 📋 ⚖️ 📋 👈 🔜 🏃 🕐❔ **📦** ▶️ &amp; 🔢 🚶‍♀️ 👈 📋. 📶 🎏 ⚫️❔ 🔜 🚥 ⚫️ 📋 ⏸.
🕐❔ **📦** ▶️, ⚫️ 🔜 🏃 👈 📋/📋 (👐 👆 💪 🔐 ⚫️ &amp; ⚒ ⚫️ 🏃 🎏 📋/📋).
📦 🏃 📏 **👑 🛠️** (📋 ⚖️ 📋) 🏃.
📦 🛎 ✔️ **👁 🛠️**, ✋️ ⚫️ 💪 ▶️ ✳ ⚪️➡️ 👑 🛠️, &amp; 👈 🌌 👆 🔜 ✔️ **💗 🛠️** 🎏 📦.
✋️ ⚫️ 🚫 💪 ✔️ 🏃‍♂ 📦 🍵 **🌘 1⃣ 🏃‍♂ 🛠️**. 🚥 👑 🛠️ ⛔️, 📦 ⛔️.
## 🏗 ☁ 🖼 FastAPI
🆗, ➡️ 🏗 🕳 🔜 ❗ 👶
👤 🔜 🎦 👆 ❔ 🏗 **☁ 🖼** FastAPI **⚪️➡️ 🖌**, ⚓️ 🔛 **🛂 🐍** 🖼.
👉 ⚫️❔ 👆 🔜 💚 **🏆 💼**, 🖼:
* ⚙️ **Kubernete** ⚖️ 🎏 🧰
* 🕐❔ 🏃‍♂ 🔛 **🍓 👲**
* ⚙️ ☁ 🐕‍🦺 👈 🔜 🏃 📦 🖼 👆, ♒️.
### 📦 📄
👆 🔜 🛎 ✔️ **📦 📄** 👆 🈸 📁.
⚫️ 🔜 🪀 ✴️ 🔛 🧰 👆 ⚙️ **❎** 👈 📄.
🌅 ⚠ 🌌 ⚫️ ✔️ 📁 `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 ✔️ 🛠️ ⏮️ ☁, Kubernete, &amp; 🎏, ⚫️ 📶 ⏩ ⚒ 🆙 &amp; 🔗 🇺🇸🔍 👆 📦 ⏮️ ⚫️.
👐, 🇺🇸🔍 💪 🍵 ☁ 🐕‍🦺 1⃣ 👫 🐕‍🦺 (⏪ 🏃 🈸 📦).
## 🏃‍♂ 🔛 🕴 &amp; ⏏
📤 🛎 1⃣ 🧰 🈚 **▶️ &amp; 🏃‍♂** 👆 📦.
⚫️ 💪 **☁** 🔗, **☁ ✍**, **Kubernete**, **☁ 🐕‍🦺**, ♒️.
🌅 (⚖️ 🌐) 💼, 📤 🙅 🎛 🛠️ 🏃 📦 🔛 🕴 &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⃣ 📚 📎 📦 🧾 ⚙️ 💖 Kubernete 🛎 ✔️ 🛠️ 🌌 🚚 **🧬 📦** ⏪ 🔗 **📐 ⚖** 📨 📨. 🌐 **🌑 🎚**.
📚 💼, 👆 🔜 🎲 💚 🏗 **☁ 🖼 ⚪️➡️ 🖌** [🔬 🔛](#dockerfile), ❎ 👆 🔗, &amp; 🏃‍♂ **👁 Uvicorn 🛠️** ↩️ 🏃‍♂ 🕳 💖 🐁 ⏮️ Uvicorn 👨‍🏭.
### 📐 ⚙
🕐❔ ⚙️ 📦, 👆 🔜 🛎 ✔️ 🦲 **👂 🔛 👑 ⛴**. ⚫️ 💪 🎲 1⃣ 📦 👈 **🤝 ❎ 🗳** 🍵 **🇺🇸🔍** ⚖️ 🎏 🧰.
👉 🦲 🔜 ✊ **📐** 📨 &amp; 📎 👈 👪 👨‍🏭 (🤞) **⚖** 🌌, ⚫️ 🛎 🤙 **📐 ⚙**.
!!! tip
🎏 **🤝 ❎ 🗳** 🦲 ⚙️ 🇺🇸🔍 🔜 🎲 **📐 ⚙**.
&amp; 🕐❔ 👷 ⏮️ 📦, 🎏 ⚙️ 👆 ⚙️ ▶️ &amp; 🛠️ 👫 🔜 ⏪ ✔️ 🔗 🧰 📶 **🕸 📻** (✅ 🇺🇸🔍 📨) ⚪️➡️ 👈 **📐 ⚙** (👈 💪 **🤝 ❎ 🗳**) 📦(Ⓜ) ⏮️ 👆 📱.
### 1⃣ 📐 ⚙ - 💗 👨‍🏭 📦
🕐❔ 👷 ⏮️ **Kubernete** ⚖️ 🎏 📎 📦 🧾 ⚙️, ⚙️ 👫 🔗 🕸 🛠️ 🔜 ✔ 👁 **📐 ⚙** 👈 👂 🔛 👑 **⛴** 📶 📻 (📨) 🎲 **💗 📦** 🏃 👆 📱.
🔠 👫 📦 🏃‍♂ 👆 📱 🔜 🛎 ✔️ **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; 📄 👆 📳 👆 📦 🧾 ⚙️ (🖼 **Kubernete**). 👈 🌌 ⚫️ 🔜 💪 **🔁 📦** **💪 🎰** ✊ 🔘 🏧 💸 💾 💪 👫, &amp; 💸 💪 🎰 🌑.
🚥 👆 🈸 **🙅**, 👉 🔜 🎲 **🚫 ⚠**, &amp; 👆 💪 🚫 💪 ✔ 🏋️ 💾 📉. ✋️ 🚥 👆 **⚙️ 📚 💾** (🖼 ⏮️ **🎰 🏫** 🏷), 👆 🔜 ✅ ❔ 🌅 💾 👆 😩 &amp; 🔆 **🔢 📦** 👈 🏃 **🔠 🎰** (&amp; 🎲 🚮 🌖 🎰 👆 🌑).
🚥 👆 🏃 **💗 🛠️ 📍 📦** (🖼 ⏮️ 🛂 ☁ 🖼) 👆 🔜 ✔️ ⚒ 💭 👈 🔢 🛠️ ▶️ 🚫 **🍴 🌖 💾** 🌘 ⚫️❔ 💪.
## ⏮️ 🔁 ⏭ ▶️ &amp; 📦
🚥 👆 ⚙️ 📦 (✅ ☁, Kubernete), ⤴️ 📤 2⃣ 👑 🎯 👆 💪 ⚙️.
### 💗 📦
🚥 👆 ✔️ **💗 📦**, 🎲 🔠 1⃣ 🏃 **👁 🛠️** (🖼, **Kubernete** 🌑), ⤴️ 👆 🔜 🎲 💚 ✔️ **🎏 📦** 🔨 👷 **⏮️ 📶** 👁 📦, 🏃 👁 🛠️, **⏭** 🏃 🔁 👨‍🏭 📦.
!!! info
🚥 👆 ⚙️ Kubernete, 👉 🔜 🎲 <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⃣) 🚥 👆 ⚙️ **Kubernete** (⚖️ 🎏) &amp; 👆 ⏪ ⚒ **🧬** 🌑 🎚, ⏮️ 💗 **📦**. 📚 💼, 👆 👍 📆 **🏗 🖼 ⚪️➡️ 🖌** 🔬 🔛: [🏗 ☁ 🖼 FastAPI](#build-a-docker-image-for-fastapi).
👉 🖼 🔜 ⚠ ✴️ 🎁 💼 🔬 🔛 [📦 ⏮️ 💗 🛠️ &amp; 🎁 💼](#containers-with-multiple-processes-and-special-cases). 🖼, 🚥 👆 🈸 **🙅 🥃** 👈 ⚒ 🔢 🔢 🛠️ ⚓️ 🔛 💽 👷 👍, 👆 🚫 💚 😥 ⏮️ ❎ 🛠️ 🧬 🌑 🎚, &amp; 👆 🚫 🏃 🌅 🌘 1⃣ 📦 ⏮️ 👆 📱. ⚖️ 🚥 👆 🛠️ ⏮️ **☁ ✍**, 🏃 🔛 👁 💽, ♒️.
## 🛠️ 📦 🖼
⏮️ ✔️ 📦 (☁) 🖼 📤 📚 🌌 🛠️ ⚫️.
🖼:
* ⏮️ **☁ ✍** 👁 💽
* ⏮️ **Kubernete** 🌑
* ⏮️ ☁ 🐝 📳 🌑
* ⏮️ 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; **Kubernete**) ⚫️ ▶️️ 📶 🎯 🍵 🌐 **🛠️ 🔧**:
* 🇺🇸🔍
* 🏃‍♂ 🔛 🕴
* ⏏
* 🧬 (🔢 🛠️ 🏃)
* 💾
* ⏮️ 🔁 ⏭ ▶️
🌅 💼, 👆 🎲 🏆 🚫 💚 ⚙️ 🙆 🧢 🖼, &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
🚥 👆 ⚙️ 📦, 🖼 ⏮️ ☁ ⚖️ Kubernete, 👤 🔜 💬 👆 🌅 🔃 👈 ⏭ 📃: [FastAPI 📦 - ☁](./docker.md){.internal-link target=_blank}.
🎯, 🕐❔ 🏃 🔛 **Kubernete** 👆 🔜 🎲 **🚫** 💚 ⚙️ 🐁 &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; 🎲 ⚫️❔ 👆 🔜 💚 🕐❔ ⚙️ 📎 📦 🧾 ⚙️ 💖 **Kubernete**.
## 🌃
👆 💪 ⚙️ **🐁** (⚖️ Uvicorn) 🛠️ 👨‍💼 ⏮️ Uvicorn 👨‍🏭 ✊ 📈 **👁-🐚 💽**, 🏃 **💗 🛠️ 🔗**.
👆 💪 ⚙️ 👉 🧰 &amp; 💭 🚥 👆 ⚒ 🆙 **👆 👍 🛠️ ⚙️** ⏪ ✊ 💅 🎏 🛠️ 🔧 👆.
✅ 👅 ⏭ 📃 💡 🔃 **FastAPI** ⏮️ 📦 (✅ ☁ &amp; Kubernete). 👆 🔜 👀 👈 👈 🧰 ✔️ 🙅 🌌 ❎ 🎏 **🛠️ 🔧** 👍. 👶

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,91 @@
# 🔢 🔗 &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>.
## 📄
### 🇪🇸
{% if external_links %}
{% for article in external_links.articles.english %}
* <a href="{{ article.link }}" class="external-link" target="_blank">{{ article.title }}</a> <a href="{{ article.author_link }}" class="external-link" target="_blank">{{ article.author }}</a>.
{% endfor %}
{% endif %}
### 🇯🇵
{% if external_links %}
{% for article in external_links.articles.japanese %}
* <a href="{{ article.link }}" class="external-link" target="_blank">{{ article.title }}</a> <a href="{{ article.author_link }}" class="external-link" target="_blank">{{ article.author }}</a>.
{% endfor %}
{% endif %}
### 🇻🇳
{% if external_links %}
{% for article in external_links.articles.vietnamese %}
* <a href="{{ article.link }}" class="external-link" target="_blank">{{ article.title }}</a> <a href="{{ article.author_link }}" class="external-link" target="_blank">{{ article.author }}</a>.
{% endfor %}
{% endif %}
### 🇷🇺
{% if external_links %}
{% for article in external_links.articles.russian %}
* <a href="{{ article.link }}" class="external-link" target="_blank">{{ article.title }}</a> <a href="{{ article.author_link }}" class="external-link" target="_blank">{{ article.author }}</a>.
{% endfor %}
{% endif %}
### 🇩🇪
{% if external_links %}
{% for article in external_links.articles.german %}
* <a href="{{ article.link }}" class="external-link" target="_blank">{{ article.title }}</a> <a href="{{ article.author_link }}" class="external-link" target="_blank">{{ article.author }}</a>.
{% endfor %}
{% endif %}
### 🇹🇼
{% if external_links %}
{% for article in external_links.articles.taiwanese %}
* <a href="{{ article.link }}" class="external-link" target="_blank">{{ article.title }}</a> <a href="{{ article.author_link }}" class="external-link" target="_blank">{{ article.author }}</a>.
{% endfor %}
{% endif %}
## 📻
{% if external_links %}
{% for article in external_links.podcasts.english %}
* <a href="{{ article.link }}" class="external-link" target="_blank">{{ article.title }}</a> <a href="{{ article.author_link }}" class="external-link" target="_blank">{{ article.author }}</a>.
{% endfor %}
{% endif %}
## 💬
{% if external_links %}
{% for article in external_links.talks.english %}
* <a href="{{ article.link }}" class="external-link" target="_blank">{{ article.title }}</a> <a href="{{ article.author_link }}" class="external-link" target="_blank">{{ article.author }}</a>.
{% endfor %}
{% endif %}
## 🏗
⏪ 📂 🏗 ⏮️ ❔ `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⃣ 💯 💯 💰.

View File

@@ -0,0 +1,265 @@
# FastAPI - 🤚
👆 💖 **FastAPI**
🔜 👆 💖 FastAPI, 🎏 👩‍💻, &amp; 📕 ❓
⚖️ 🔜 👆 💖 🤚 ⏮️ **FastAPI**
📤 📶 🙅 🌌 (📚 🔌 1⃣ ⚖️ 2⃣ 🖊).
&amp; 📤 📚 🌌 🤚 💁‍♂️.
## 👱📔 📰
👆 💪 👱📔 (🐌) [**FastAPI &amp; 👨‍👧‍👦** 📰](/newsletter/){.internal-link target=_blank} 🚧 🔃:
* 📰 🔃 FastAPI &amp; 👨‍👧‍👦 👶
* 🦮 👶
* ⚒ 👶
* 💔 🔀 👶
* 💁‍♂ &amp; 🎱 👶
## ⏩ FastAPI 🔛 👱📔
<a href="https://twitter.com/fastapi" class="external-link" target="_blank">⏩ 🐶 Fastapi 🔛 **👱📔**</a> 🤚 📰 📰 🔃 **FastAPI**. 👶
## ✴ **FastAPI** 📂
👆 💪 "✴" FastAPI 📂 (🖊 ✴ 🔼 🔝 ▶️️): <a href="https://github.com/tiangolo/fastapi" class="external-link" target="_blank">https://github.com/tiangolo/fastapi</a>. 👶 👶
❎ ✴, 🎏 👩‍💻 🔜 💪 🔎 ⚫️ 🌅 💪 &amp; 👀 👈 ⚫️ ✔️ ⏪ ⚠ 🎏.
## ⌚ 📂 🗃 🚀
👆 💪 "⌚" FastAPI 📂 (🖊 "⌚" 🔼 🔝 ▶️️): <a href="https://github.com/tiangolo/fastapi" class="external-link" target="_blank">https://github.com/tiangolo/fastapi</a>. 👶
📤 👆 💪 🖊 "🚀 🕴".
🔨 ⚫️, 👆 🔜 📨 📨 (👆 📧) 🕐❔ 📤 🆕 🚀 (🆕 ⏬) **FastAPI** ⏮️ 🐛 🔧 &amp; 🆕 ⚒.
## 🔗 ⏮️ 📕
👆 💪 🔗 ⏮️ <a href="https://tiangolo.com" class="external-link" target="_blank">👤 (🇹🇦 🇩🇬 / `tiangolo`)</a>, 📕.
👆 💪:
* <a href="https://github.com/tiangolo" class="external-link" target="_blank">⏩ 👤 🔛 **📂**</a>.
* 👀 🎏 📂 🏗 👤 ✔️ ✍ 👈 💪 👆.
* ⏩ 👤 👀 🕐❔ 👤 ✍ 🆕 📂 🏗.
* <a href="https://twitter.com/tiangolo" class="external-link" target="_blank">⏩ 👤 🔛 **👱📔**</a> ⚖️ <a href="https://fosstodon.org/@tiangolo" class="external-link" target="_blank">☠</a>.
* 💬 👤 ❔ 👆 ⚙️ FastAPI (👤 💌 👂 👈).
* 👂 🕐❔ 👤 ⚒ 🎉 ⚖️ 🚀 🆕 🧰.
* 👆 💪 <a href="https://twitter.com/fastapi" class="external-link" target="_blank">⏩ 🐶 Fastapi 🔛 👱📔</a> (🎏 🏧).
* <a href="https://www.linkedin.com/in/tiangolo/" class="external-link" target="_blank">🔗 ⏮️ 👤 🔛 **👱📔**</a>.
* 👂 🕐❔ 👤 ⚒ 🎉 ⚖️ 🚀 🆕 🧰 (👐 👤 ⚙️ 👱📔 🌖 🛎 🤷 ♂).
* ✍ ⚫️❔ 👤 ✍ (⚖️ ⏩ 👤) 🔛 <a href="https://dev.to/tiangolo" class="external-link" target="_blank">**🇸🇲.**</a> ⚖️ <a href="https://medium.com/@tiangolo" class="external-link" target="_blank">**🔉**</a>.
* ✍ 🎏 💭, 📄, &amp; ✍ 🔃 🧰 👤 ✔️ ✍.
* ⏩ 👤 ✍ 🕐❔ 👤 ✍ 🕳 🆕.
## 👱📔 🔃 **FastAPI**
<a href="https://twitter.com/compose/tweet?text=I'm loving @fastapi because... https://github.com/tiangolo/fastapi" class="external-link" target="_blank">👱📔 🔃 **FastAPI**</a> &amp; ➡️ 👤 &amp; 🎏 💭 ⚫️❔ 👆 💖 ⚫️. 👶
👤 💌 👂 🔃 ❔ **FastAPI** 💆‍♂ ⚙️, ⚫️❔ 👆 ✔️ 💖 ⚫️, ❔ 🏗/🏢 👆 ⚙️ ⚫️, ♒️.
## 🗳 FastAPI
* <a href="https://www.slant.co/options/34241/~fastapi-review" class="external-link" target="_blank">🗳 **FastAPI** 📐</a>.
* <a href="https://alternativeto.net/software/fastapi/" class="external-link" target="_blank">🗳 **FastAPI** 📱</a>.
* <a href="https://stackshare.io/pypi-fastapi" class="external-link" target="_blank">💬 👆 ⚙️ **FastAPI** 🔛 </a>.
## 🎏 ⏮️ ❔ 📂
👆 💪 🔄 &amp; 🎏 ⏮️ 👫 ❔:
* <a href="https://github.com/tiangolo/fastapi/discussions/categories/questions?discussions_q=category%3AQuestions+is%3Aunanswered" class="external-link" target="_blank">📂 💬</a>
* <a href="https://github.com/tiangolo/fastapi/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Aquestion+-label%3Aanswered+" class="external-link" target="_blank">📂 ❔</a>
📚 💼 👆 5⃣📆 ⏪ 💭 ❔ 📚 ❔. 👶
🚥 👆 🤝 📚 👫👫 ⏮️ 👫 ❔, 👆 🔜 ▶️️ 🛂 [FastAPI 🕴](fastapi-people.md#experts){.internal-link target=_blank}. 👶
💭, 🏆 ⚠ ☝: 🔄 😇. 👫👫 👟 ⏮️ 👫 😩 &amp; 📚 💼 🚫 💭 🏆 🌌, ✋️ 🔄 🏆 👆 💪 😇. 👶
💭 **FastAPI** 👪 😇 &amp; 👍. 🎏 🕰, 🚫 🚫 🎭 ⚖️ 😛 🎭 ⤵ 🎏. 👥 ✔️ ✊ 💅 🔠 🎏.
---
📥 ❔ 🎏 ⏮️ ❔ (💬 ⚖️ ❔):
### 🤔 ❔
* ✅ 🚥 👆 💪 🤔 ⚫️❔ **🎯** &amp; ⚙️ 💼 👨‍💼 💬.
* ⤴️ ✅ 🚥 ❔ (⭕ 👪 ❔) **🆑**.
* 📚 💼 ❔ 💭 🔃 👽 ⚗ ⚪️➡️ 👩‍💻, ✋️ 📤 💪 **👍** 1⃣. 🚥 👆 💪 🤔 ⚠ &amp; ⚙️ 💼 👍, 👆 💪 💪 🤔 👍 **🎛 ⚗**.
* 🚥 👆 💪 🚫 🤔 ❔, 💭 🌖 ****.
### 🔬 ⚠
🌅 💼 &amp; 🏆 ❔ 📤 🕳 🔗 👨‍💼 **⏮️ 📟**.
📚 💼 👫 🔜 🕴 📁 🧬 📟, ✋️ 👈 🚫 🥃 **🔬 ⚠**.
* 👆 💪 💭 👫 🚚 <a href="https://stackoverflow.com/help/minimal-reproducible-example" class="external-link" target="_blank">⭐, 🔬, 🖼</a>, 👈 👆 💪 **📁-📋** &amp; 🏃 🌐 👀 🎏 ❌ ⚖️ 🎭 👫 👀, ⚖️ 🤔 👫 ⚙️ 💼 👍.
* 🚥 👆 😟 💁‍♂️ 👍, 👆 💪 🔄 **✍ 🖼** 💖 👈 👆, 🧢 🔛 📛 ⚠. ✔️ 🤯 👈 👉 💪 ✊ 📚 🕰 &amp; ⚫️ 💪 👻 💭 👫 ✍ ⚠ 🥇.
### 🤔 ⚗
* ⏮️ 💆‍♂ 💪 🤔 ❔, 👆 💪 🤝 👫 💪 **❔**.
* 📚 💼, ⚫️ 👍 🤔 👫 **📈 ⚠ ⚖️ ⚙️ 💼**, ↩️ 📤 5⃣📆 👍 🌌 ❎ ⚫️ 🌘 ⚫️❔ 👫 🔄.
### 💭 🔐
🚥 👫 📨, 📤 ↕ 🤞 👆 🔜 ✔️ ❎ 👫 ⚠, ㊗, **👆 💂**❗ 🦸
* 🔜, 🚥 👈 ❎ 👫 ⚠, 👆 💪 💭 👫:
* 📂 💬: ™ 🏤 **❔**.
* 📂 ❔: **🔐** ❔**.
## ⌚ 📂 🗃
👆 💪 "⌚" FastAPI 📂 (🖊 "⌚" 🔼 🔝 ▶️️): <a href="https://github.com/tiangolo/fastapi" class="external-link" target="_blank">https://github.com/tiangolo/fastapi</a>. 👶
🚥 👆 🖊 "👀" ↩️ "🚀 🕴" 👆 🔜 📨 📨 🕐❔ 👱 ✍ 🆕 ❔ ⚖️ ❔. 👆 💪 ✔ 👈 👆 🕴 💚 🚨 🔃 🆕 ❔, ⚖️ 💬, ⚖️ 🎸, ♒️.
⤴️ 👆 💪 🔄 &amp; 👫 ❎ 👈 ❔.
## 💭 ❔
👆 💪 <a href="https://github.com/tiangolo/fastapi/discussions/new?category=questions" class="external-link" target="_blank">✍ 🆕 ❔</a> 📂 🗃, 🖼:
* 💭 **❔** ⚖️ 💭 🔃 **⚠**.
* 🤔 🆕 **⚒**.
**🗒**: 🚥 👆 ⚫️, ⤴️ 👤 🔜 💭 👆 🎏. 👶
## 📄 🚲 📨
👆 💪 👤 📄 🚲 📨 ⚪️➡️ 🎏.
🔄, 🙏 🔄 👆 🏆 😇. 👶
---
📥 ⚫️❔ ✔️ 🤯 &amp; ❔ 📄 🚲 📨:
### 🤔 ⚠
* 🥇, ⚒ 💭 👆 **🤔 ⚠** 👈 🚲 📨 🔄 ❎. ⚫️ 💪 ✔️ 📏 💬 📂 💬 ⚖️ ❔.
* 📤 👍 🤞 👈 🚲 📨 🚫 🤙 💪 ↩️ ⚠ 💪 ❎ **🎏 🌌**. ⤴️ 👆 💪 🤔 ⚖️ 💭 🔃 👈.
### 🚫 😟 🔃 👗
* 🚫 😟 💁‍♂️ 🌅 🔃 👜 💖 💕 📧 👗, 👤 🔜 🥬 &amp; 🔗 🛃 💕 ❎.
* 🚫 😟 🔃 👗 🚫, 📤 ⏪ 🏧 🧰 ✅ 👈.
&amp; 🚥 📤 🙆 🎏 👗 ⚖️ ⚖ 💪, 👤 🔜 💭 🔗 👈, ⚖️ 👤 🔜 🚮 💕 🔛 🔝 ⏮️ 💪 🔀.
### ✅ 📟
* ✅ &amp; ✍ 📟, 👀 🚥 ⚫️ ⚒ 🔑, **🏃 ⚫️ 🌐** &amp; 👀 🚥 ⚫️ 🤙 ❎ ⚠.
* ⤴️ **🏤** 💬 👈 👆 👈, 👈 ❔ 👤 🔜 💭 👆 🤙 ✅ ⚫️.
!!! info
👐, 👤 💪 🚫 🎯 💙 🎸 👈 ✔️ 📚 ✔.
📚 🕰 ⚫️ ✔️ 🔨 👈 📤 🎸 ⏮️ 3⃣, 5⃣ ⚖️ 🌅 ✔, 🎲 ↩️ 📛 😌, ✋️ 🕐❔ 👤 ✅ 🎸, 👫 🤙 💔, ✔️ 🐛, ⚖️ 🚫 ❎ ⚠ 👫 🛄 ❎. 👶
, ⚫️ 🤙 ⚠ 👈 👆 🤙 ✍ &amp; 🏃 📟, &amp; ➡️ 👤 💭 🏤 👈 👆. 👶
* 🚥 🇵🇷 💪 📉 🌌, 👆 💪 💭 👈, ✋️ 📤 🙅‍♂ 💪 💁‍♂️ 😟, 📤 5⃣📆 📚 🤔 ☝ 🎑 (&amp; 👤 🔜 ✔️ 👇 👍 👍 👶), ⚫️ 👻 🚥 👆 💪 🎯 🔛 ⚛ 👜.
### 💯
* 👤 ✅ 👈 🇵🇷 ✔️ **💯**.
* ✅ 👈 💯 **❌** ⏭ 🇵🇷. 👶
* ⤴️ ✅ 👈 💯 **🚶‍♀️** ⏮️ 🇵🇷. 👶
* 📚 🎸 🚫 ✔️ 💯, 👆 💪 **🎗** 👫 🚮 💯, ⚖️ 👆 💪 **🤔** 💯 👆. 👈 1⃣ 👜 👈 🍴 🌅 🕰 &amp; 👆 💪 📚 ⏮️ 👈.
* ⤴️ 🏤 ⚫️❔ 👆 🔄, 👈 🌌 👤 🔜 💭 👈 👆 ✅ ⚫️. 👶
## ✍ 🚲 📨
👆 💪 [📉](contributing.md){.internal-link target=_blank} 📟 ⏮️ 🚲 📨, 🖼:
* 🔧 🤭 👆 🔎 🔛 🧾.
* 💰 📄, 📹, ⚖️ 📻 👆 ✍ ⚖️ 🔎 🔃 FastAPI <a href="https://github.com/tiangolo/fastapi/edit/master/docs/en/data/external_links.yml" class="external-link" target="_blank">✍ 👉 📁</a>.
* ⚒ 💭 👆 🚮 👆 🔗 ▶️ 🔗 📄.
* [💬 🧾](contributing.md#translations){.internal-link target=_blank} 👆 🇪🇸.
* 👆 💪 📄 ✍ ✍ 🎏.
* 🛠️ 🆕 🧾 📄.
* 🔧 ♻ ❔/🐛.
* ⚒ 💭 🚮 💯.
* 🚮 🆕 ⚒.
* ⚒ 💭 🚮 💯.
* ⚒ 💭 🚮 🧾 🚥 ⚫️ 🔗.
## 🚧 FastAPI
👤 🚧 **FastAPI**❗ 👶
📤 📚 👷, &amp; 🏆 ⚫️, **👆** 💪 ⚫️.
👑 📋 👈 👆 💪 ▶️️ 🔜:
* [ 🎏 ⏮️ ❔ 📂](#help-others-with-questions-in-github){.internal-link target=_blank} (👀 📄 🔛).
* [📄 🚲 📨](#review-pull-requests){.internal-link target=_blank} (👀 📄 🔛).
👈 2⃣ 📋 ⚫️❔ **🍴 🕰 🏆**. 👈 👑 👷 🏆 FastAPI.
🚥 👆 💪 👤 ⏮️ 👈, **👆 🤝 👤 🚧 FastAPI** &amp; ⚒ 💭 ⚫️ 🚧 **🛠️ ⏩ &amp; 👻**. 👶
## 🛑 💬
🛑 👶 <a href="https://discord.gg/VQjSZaeJmf" class="external-link" target="_blank">😧 💬 💽</a> 👶 &amp; 🤙 👅 ⏮️ 🎏 FastAPI 👪.
!!! tip
❔, 💭 👫 <a href="https://github.com/tiangolo/fastapi/discussions/new?category=questions" class="external-link" target="_blank">📂 💬</a>, 📤 🌅 👍 🤞 👆 🔜 📨 [FastAPI 🕴](fastapi-people.md#experts){.internal-link target=_blank}.
⚙️ 💬 🕴 🎏 🏢 💬.
📤 ⏮️ <a href="https://gitter.im/tiangolo/fastapi" class="external-link" target="_blank">🥊 💬</a>, ✋️ ⚫️ 🚫 ✔️ 📻 &amp; 🏧 ⚒, 💬 🌖 ⚠, 😧 🔜 👍 ⚙️.
### 🚫 ⚙️ 💬 ❔
✔️ 🤯 👈 💬 ✔ 🌅 "🆓 💬", ⚫️ ⏩ 💭 ❔ 👈 💁‍♂️ 🏢 &amp; 🌅 ⚠ ❔,, 👆 💪 🚫 📨 ❔.
📂, 📄 🔜 🦮 👆 ✍ ▶️️ ❔ 👈 👆 💪 🌖 💪 🤚 👍 ❔, ⚖️ ❎ ⚠ 👆 ⏭ 💬. &amp; 📂 👤 💪 ⚒ 💭 👤 🕧 ❔ 🌐, 🚥 ⚫️ ✊ 🕰. 👤 💪 🚫 🤙 👈 ⏮️ 💬 ⚙️. 👶
💬 💬 ⚙️ 🚫 💪 📇 📂, ❔ &amp; ❔ 5⃣📆 🤚 💸 💬. &amp; 🕴 🕐 📂 💯 ▶️️ [FastAPI 🕴](fastapi-people.md#experts){.internal-link target=_blank}, 👆 🔜 🌅 🎲 📨 🌅 🙋 📂.
🔛 🎏 🚄, 📤 💯 👩‍💻 💬 ⚙️, 📤 ↕ 🤞 👆 🔜 🔎 👱 💬 📤, 🌖 🌐 🕰. 👶
## 💰 📕
👆 💪 💰 🐕‍🦺 📕 (👤) 🔘 <a href="https://github.com/sponsors/tiangolo" class="external-link" target="_blank">📂 💰</a>.
📤 👆 💪 🛍 👤 ☕ 👶 👶 💬 👏. 👶
&amp; 👆 💪 ▶️️ 🥇1st ⚖️ 🌟 💰 FastAPI. 👶 👶
## 💰 🧰 👈 🏋️ FastAPI
👆 ✔️ 👀 🧾, FastAPI 🧍 🔛 ⌚ 🐘, 💃 &amp; Pydantic.
👆 💪 💰:
* <a href="https://github.com/sponsors/samuelcolvin" class="external-link" target="_blank">✡ 🍏 (Pydantic)</a>
* <a href="https://github.com/sponsors/encode" class="external-link" target="_blank">🗜 (💃, Uvicorn)</a>
---
👏 ❗ 👶

View File

@@ -0,0 +1,79 @@
# 📖, 🔧 &amp; 🔮
🕰 🏁, <a href="https://github.com/tiangolo/fastapi/issues/3#issuecomment-454956920" class="external-link" target="_blank"> **FastAPI** 👩‍💻 💭</a>:
&gt; ⚫️❔ 📖 👉 🏗 ❓ ⚫️ 😑 ✔️ 👟 ⚪️➡️ 🕳 👌 👩‍❤‍👨 🗓️ [...]
📥 🐥 🍖 👈 📖.
## 🎛
👤 ✔️ 🏗 🔗 ⏮️ 🏗 📄 📚 1⃣2⃣🗓 (🎰 🏫, 📎 ⚙️, 🔁 👨‍🏭, ☁ 💽, ♒️), ↘️ 📚 🏉 👩‍💻.
🍕 👈, 👤 💪 🔬, 💯 &amp; ⚙️ 📚 🎛.
📖 **FastAPI** 👑 🍕 📖 🚮 ⏪.
🙆‍♀ 📄 [🎛](alternatives.md){.internal-link target=_blank}:
<blockquote markdown="1">
**FastAPI** 🚫🔜 🔀 🚥 🚫 ⏮️ 👷 🎏.
📤 ✔️ 📚 🧰 ✍ ⏭ 👈 ✔️ 😮 🚮 🏗.
👤 ✔️ ❎ 🏗 🆕 🛠️ 📚 1⃣2⃣🗓. 🥇 👤 🔄 ❎ 🌐 ⚒ 📔 **FastAPI** ⚙️ 📚 🎏 🛠️, 🔌-🔌, &amp; 🧰.
✋️ ☝, 📤 🙅‍♂ 🎏 🎛 🌘 🏗 🕳 👈 🚚 🌐 👫 ⚒, ✊ 🏆 💭 ⚪️➡️ ⏮️ 🧰, &amp; 🌀 👫 🏆 🌌 💪, ⚙️ 🇪🇸 ⚒ 👈 ➖🚫 💪 ⏭ (🐍 3⃣.6️⃣ 🆎 🔑).
</blockquote>
## 🔬
⚙️ 🌐 ⏮️ 🎛 👤 ✔️ 🤞 💡 ⚪️➡️ 🌐 👫, ✊ 💭, &amp; 🌀 👫 🏆 🌌 👤 💪 🔎 👤 &amp; 🏉 👩‍💻 👤 ✔️ 👷 ⏮️.
🖼, ⚫️ 🆑 👈 🎲 ⚫️ 🔜 ⚓️ 🔛 🐩 🐍 🆎 🔑.
, 🏆 🎯 ⚙️ ⏪ ♻ 🐩.
, ⏭ ▶️ 📟 **FastAPI**, 👤 💸 📚 🗓️ 🎓 🔌 🗄, 🎻 🔗, Oauth2⃣, ♒️. 🎯 👫 💛, 🔀, &amp; 🔺.
## 🔧
⤴️ 👤 💸 🕰 🔧 👩‍💻 "🛠️" 👤 💚 ✔️ 👩‍💻 (👩‍💻 ⚙️ FastAPI).
👤 💯 📚 💭 🏆 🌟 🐍 👨‍🎨: 🗒, 🆚 📟, 🎠 🧢 👨‍🎨.
🏁 <a href="https://www.jetbrains.com/research/python-developers-survey-2018/#development-tools" class="external-link" target="_blank">🐍 👩‍💻 🔬</a>, 👈 📔 🔃 8⃣0⃣ 💯 👩‍💻.
⚫️ ⛓ 👈 **FastAPI** 🎯 💯 ⏮️ 👨‍🎨 ⚙️ 8⃣0⃣ 💯 🐍 👩‍💻. &amp; 🏆 🎏 👨‍🎨 😑 👷 ➡, 🌐 🚮 💰 🔜 👷 🌖 🌐 👨‍🎨.
👈 🌌 👤 💪 🔎 🏆 🌌 📉 📟 ❎ 🌅 💪, ✔️ 🛠️ 🌐, 🆎 &amp; ❌ ✅, ♒️.
🌐 🌌 👈 🚚 🏆 🛠️ 💡 🌐 👩‍💻.
## 📄
⏮️ 🔬 📚 🎛, 👤 💭 👈 👤 🔜 ⚙️ <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">**Pydantic**</a> 🚮 📈.
⤴️ 👤 📉 ⚫️, ⚒ ⚫️ 🍕 🛠️ ⏮️ 🎻 🔗, 🐕‍🦺 🎏 🌌 🔬 ⚛ 📄, &amp; 📉 👨‍🎨 🐕‍🦺 (🆎 ✅, ✍) ⚓️ 🔛 💯 📚 👨‍🎨.
⏮️ 🛠️, 👤 📉 <a href="https://www.starlette.io/" class="external-link" target="_blank">**💃**</a>, 🎏 🔑 📄.
## 🛠️
🕰 👤 ▶️ 🏗 **FastAPI** ⚫️, 🏆 🍖 ⏪ 🥉, 🔧 🔬, 📄 &amp; 🧰 🔜, &amp; 💡 🔃 🐩 &amp; 🔧 🆑 &amp; 🍋.
## 🔮
👉 ☝, ⚫️ ⏪ 🆑 👈 **FastAPI** ⏮️ 🚮 💭 ⚠ 📚 👫👫.
⚫️ 💆‍♂ 👐 🤭 ⏮️ 🎛 ♣ 📚 ⚙️ 💼 👍.
📚 👩‍💻 &amp; 🏉 ⏪ 🪀 🔛 **FastAPI** 👫 🏗 (🔌 👤 &amp; 👇 🏉).
✋️, 📤 📚 📈 &amp; ⚒ 👟.
**FastAPI** ✔️ 👑 🔮 ⤴️.
&amp; [👆 ](help-fastapi.md){.internal-link target=_blank} 📉 👍.

469
docs/em/docs/index.md Normal file
View File

@@ -0,0 +1,469 @@
<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+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://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>
---
**🧾**: <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 🏛, ⏩ (↕-🎭), 🕸 🛠️ 🏗 🛠️ ⏮️ 🐍 3⃣.7️⃣ ⚓️ 🔛 🐩 🐍 🆎 🔑.
🔑 ⚒:
* **⏩**: 📶 ↕ 🎭, 🔛 🇷🇪 ⏮️ **✳** &amp; **🚶** (👏 💃 &amp; Pydantic). [1⃣ ⏩ 🐍 🛠️ 💪](#performance).
* **⏩ 📟**: 📈 🚅 🛠️ ⚒ 🔃 2⃣0⃣0⃣ 💯 3⃣0⃣0⃣ 💯. *
* **👩‍❤‍👨 🐛**: 📉 🔃 4⃣0⃣ 💯 🗿 (👩‍💻) 📉 ❌. *
* **🏋️**: 👑 👨‍🎨 🐕‍🦺. <abbr title="also known as auto-complete, autocompletion, IntelliSense">🛠️</abbr> 🌐. 🌘 🕰 🛠️.
* **⏩**: 🔧 ⏩ ⚙️ &amp; 💡. 🌘 🕰 👂 🩺.
* **📏**: 📉 📟 ❎. 💗 ⚒ ⚪️➡️ 🔠 🔢 📄. 👩‍❤‍👨 🐛.
* **🏋️**: 🤚 🏭-🔜 📟. ⏮️ 🏧 🎓 🧾.
* **🐩-⚓️**: ⚓️ 🔛 (&amp; 🍕 🔗 ⏮️) 📂 🐩 🔗: <a href="https://github.com/OAI/OpenAPI-Specification" class="external-link" target="_blank">🗄</a> (⏪ 💭 🦁) &amp; <a href="https://json-schema.org/" class="external-link" target="_blank">🎻 🔗</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** 📚 👫 📆. [...] 👤 🤙 📆 ⚙️ ⚫️ 🌐 👇 🏉 **⚗ 🐕‍🦺 🤸‍♂**. 👫 💆‍♂ 🛠️ 🔘 🐚 **🖥** 🏬 &amp; **📠** 🏬._"
<div style="text-align: right; margin-right: 10%;">🧿 🇵🇰 - <strong>🤸‍♂</strong> <a href="https://github.com/tiangolo/fastapi/pull/26" target="_blank"><small>(🇦🇪)</small></a></div>
---
"_👥 🛠️ **FastAPI** 🗃 🤖 **🎂** 💽 👈 💪 🔢 🚚 **🔮**. [👨📛]_"
<div style="text-align: right; margin-right: 10%;">🇮🇹 🇸🇻, 👨📛 👨📛, &amp; 🇱🇰 🕉 🕉 - <strong>🙃</strong> <a href="https://eng.uber.com/ludwig-v0-2/" target="_blank"><small>(🇦🇪)</small></a></div>
---
"_**📺** 🙏 📣 📂- 🚀 👆 **⚔ 🧾** 🎶 🛠️: **📨**❗ [🏗 ⏮️ **FastAPI**]_"
<div style="text-align: right; margin-right: 10%;">✡ 🍏, 👖 🇪🇸, 🌲 🍏 - <strong>📺</strong> <a href="https://netflixtechblog.com/introducing-dispatch-da4b8a2a8072" target="_blank"><small>(🇦🇪)</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>(🇦🇪)</small></a></div>
---
"_🤙, ⚫️❔ 👆 ✔️ 🏗 👀 💎 💠 &amp; 🇵🇱. 📚 🌌, ⚫️ ⚫️❔ 👤 💚 **🤗** - ⚫️ 🤙 😍 👀 👱 🏗 👈._"
<div style="text-align: right; margin-right: 10%;">✡ 🗄 - <strong><a href="https://www.hug.rest/" target="_blank">🤗</a> 👼</strong> <a href="https://news.ycombinator.com/item?id=19455465" target="_blank"><small>(🇦🇪)</small></a></div>
---
"_🚥 👆 👀 💡 1**🏛 🛠️** 🏗 🎂 🔗, ✅ 👅 **FastAPI** [...] ⚫️ ⏩, ⏩ ⚙️ &amp; ⏩ 💡 [...]_"
"_👥 ✔️ 🎛 🤭 **FastAPI** 👆 **🔗** [...] 👤 💭 👆 🔜 💖 ⚫️ [...]_"
<div style="text-align: right; margin-right: 10%;">🇱🇨 🇸🇲 - ✡ Honnibal - <strong><a href="https://explosion.ai" target="_blank">💥 👲</a> 🕴 - <a href="https://spacy.io" target="_blank">🌈</a> 👼</strong> <a href="https://twitter.com/_inesmontani/status/1144173225322143744" target="_blank"><small>(🇦🇪)</small></a> - <a href="https://twitter.com/honnibal/status/1144031421859655680" target="_blank"><small>(🇦🇪)</small></a></div>
---
"_🚥 🙆 👀 🏗 🏭 🐍 🛠️, 👤 🔜 🏆 👍 **FastAPI**. ⚫️ **💎 🏗**, **🙅 ⚙️** &amp; **🏆 🛠️**, ⚫️ ✔️ ▶️️ **🔑 🦲** 👆 🛠️ 🥇 🛠️ 🎛 &amp; 🚘 📚 🏧 &amp; 🐕‍🦺 ✅ 👆 🕹 🔫 👨‍💻._"
<div style="text-align: right; margin-right: 10%;">🇹🇦 🍰 - <strong>📻</strong> <a href="https://www.linkedin.com/posts/deonpillsbury_cisco-cx-python-activity-6963242628536487936-trAp/" target="_blank"><small>(🇦🇪)</small></a></div>
---
## **🏎**, 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">✳</abbr> 📱 ⚙️ 📶 ↩️ 🕸 🛠️, ✅ 👅 <a href="https://typer.tiangolo.com/" class="external-link" target="_blank">**🏎**</a>.
**🏎** FastAPI 🐥 👪. &amp; ⚫️ 🎯 **FastAPI 🇳🇨**. 👶 👶 👶
## 📄
🐍 3⃣.7️⃣
FastAPI 🧍 🔛 ⌚ 🐘:
* <a href="https://www.starlette.io/" class="external-link" target="_blank">💃</a> 🕸 🍕.
* <a href="https://pydantic-docs.helpmanual.io/" class="external-link" target="_blank">Pydantic</a> 📊 🍕.
## 👷‍♂
<div class="termy">
```console
$ pip install fastapi
---> 100%
```
</div>
👆 🔜 💪 🔫 💽, 🏭 ✅ <a href="https://www.uvicorn.org" class="external-link" target="_blank">Uvicorn</a> ⚖️ <a href="https://github.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` &amp; `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`: 🎚 ✍ 🔘 `main.py` ⏮️ ⏸ `app = FastAPI()`.
* `--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
{"item_id": 5, "q": "somequery"}
```
👆 ⏪ ✍ 🛠️ 👈:
* 📨 🇺🇸🔍 📨 _➡_ `/` &amp; `/items/{item_id}`.
* 👯‍♂️ _➡_ ✊ `GET` <em>🛠️</em> (💭 🇺🇸🔍 _👩🔬_).
* _➡_ `/items/{item_id}` ✔️ _➡ 🔢_ `item_id` 👈 🔜 `int`.
* _➡_ `/items/{item_id}` ✔️ 📦 `str` _🔢 = `q`.
### 🎓 🛠️ 🩺
🔜 🚶 <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/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://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">📄</a>):
![ReDoc](https://fastapi.tiangolo.com/img/index/index-02-redoc-simple.png)
## 🖼 ♻
🔜 🔀 📁 `main.py` 📨 💪 ⚪️➡️ `PUT` 📨.
📣 💪 ⚙️ 🐩 🐍 🆎, 👏 Pydantic.
```Python hl_lines="4 9-12 25-27"
from typing import Union
from fastapi import FastAPI
from pydantic import BaseModel
app = FastAPI()
class Item(BaseModel):
name: str
price: float
is_offer: Union[bool, None] = None
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/items/{item_id}")
def read_item(item_id: int, q: Union[str, None] = None):
return {"item_id": item_id, "q": q}
@app.put("/items/{item_id}")
def update_item(item_id: int, item: Item):
return {"item_name": item.name, "item_id": item_id}
```
💽 🔜 🔃 🔁 (↩️ 👆 🚮 `--reload` `uvicorn` 📋 🔛).
### 🎓 🛠️ 🩺 ♻
🔜 🚶 <a href="http://127.0.0.1:8000/docs" class="external-link" target="_blank">http://127.0.0.1:8000/docs</a>.
* 🎓 🛠️ 🧾 🔜 🔁 , 🔌 🆕 💪:
![Swagger UI](https://fastapi.tiangolo.com/img/index/index-03-swagger-02.png)
* 🖊 🔛 🔼 "🔄 ⚫️ 👅", ⚫️ ✔ 👆 🥧 🔢 &amp; 🔗 🔗 ⏮️ 🛠️:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-04-swagger-03.png)
* ⤴️ 🖊 🔛 "🛠️" 🔼, 👩‍💻 🔢 🔜 🔗 ⏮️ 👆 🛠️, 📨 🔢, 🤚 🏁 &amp; 🎦 👫 🔛 🖥:
![Swagger UI interaction](https://fastapi.tiangolo.com/img/index/index-05-swagger-04.png)
### 🎛 🛠️ 🩺 ♻
&amp; 🔜, 🚶 <a href="http://127.0.0.1:8000/redoc" class="external-link" target="_blank">http://127.0.0.1:8000/redoc</a>.
* 🎛 🧾 🔜 🎨 🆕 🔢 🔢 &amp; 💪:
![ReDoc](https://fastapi.tiangolo.com/img/index/index-06-redoc-02.png)
### 🌃
📄, 👆 📣 **🕐** 🆎 🔢, 💪, ♒️. 🔢 🔢.
👆 👈 ⏮️ 🐩 🏛 🐍 🆎.
👆 🚫 ✔️ 💡 🆕 ❕, 👩‍🔬 ⚖️ 🎓 🎯 🗃, ♒️.
🐩 **🐍 3⃣.7️⃣ **.
🖼, `int`:
```Python
item_id: int
```
⚖️ 🌖 🏗 `Item` 🏷:
```Python
item: Item
```
...&amp; ⏮️ 👈 👁 📄 👆 🤚:
* 👨‍🎨 🐕‍🦺, 🔌:
* 🛠️.
* 🆎 ✅.
* 🔬 💽:
* 🏧 &amp; 🆑 ❌ 🕐❔ 📊 ❌.
* 🔬 🙇 🐦 🎻 🎚.
* <abbr title="also known as: serialization, parsing, marshalling">🛠️</abbr> 🔢 💽: 👟 ⚪️➡️ 🕸 🐍 💽 &amp; 🆎. 👂 ⚪️➡️:
* 🎻.
* ➡ 🔢.
* 🔢 🔢.
* 🍪.
* 🎚.
* 📨.
* 📁.
* <abbr title="also known as: serialization, parsing, marshalling">🛠️</abbr> 🔢 📊: 🗜 ⚪️➡️ 🐍 💽 &amp; 🆎 🕸 💽 (🎻):
* 🗜 🐍 🆎 (`str`, `int`, `float`, `bool`, `list`, ♒️).
* `datetime` 🎚.
* `UUID` 🎚.
* 💽 🏷.
* ...&amp; 📚 🌖.
* 🏧 🎓 🛠️ 🧾, 🔌 2⃣ 🎛 👩‍💻 🔢:
* 🦁 🎚.
* 📄.
---
👟 🔙 ⏮️ 📟 🖼, **FastAPI** 🔜:
* ✔ 👈 📤 `item_id` ➡ `GET` &amp; `PUT` 📨.
* ✔ 👈 `item_id` 🆎 `int` `GET` &amp; `PUT` 📨.
* 🚥 ⚫️ 🚫, 👩‍💻 🔜 👀 ⚠, 🆑 ❌.
* ✅ 🚥 📤 📦 🔢 🔢 📛 `q` ( `http://127.0.0.1:8000/items/foo?q=somequery`) `GET` 📨.
* `q` 🔢 📣 ⏮️ `= None`, ⚫️ 📦.
* 🍵 `None` ⚫️ 🔜 🚚 (💪 💼 ⏮️ `PUT`).
* `PUT` 📨 `/items/{item_id}`, ✍ 💪 🎻:
* ✅ 👈 ⚫️ ✔️ ✔ 🔢 `name` 👈 🔜 `str`.
* ✅ 👈 ⚫️ ✔️ ✔ 🔢 `price` 👈 ✔️ `float`.
* ✅ 👈 ⚫️ ✔️ 📦 🔢 `is_offer`, 👈 🔜 `bool`, 🚥 🎁.
* 🌐 👉 🔜 👷 🙇 🐦 🎻 🎚.
* 🗜 ⚪️➡️ &amp; 🎻 🔁.
* 📄 🌐 ⏮️ 🗄, 👈 💪 ⚙️:
* 🎓 🧾 ⚙️.
* 🏧 👩‍💻 📟 ⚡ ⚙️, 📚 🇪🇸.
* 🚚 2⃣ 🎓 🧾 🕸 🔢 🔗.
---
👥 🖌 🧽, ✋️ 👆 ⏪ 🤚 💭 ❔ ⚫️ 🌐 👷.
🔄 🔀 ⏸ ⏮️:
```Python
return {"item_name": item.name, "item_id": item_id}
```
...⚪️➡️:
```Python
... "item_name": item.name ...
```
...:
```Python
... "item_price": item.price ...
```
...&amp; 👀 ❔ 👆 👨‍🎨 🔜 🚘-🏁 🔢 &amp; 💭 👫 🆎:
![editor support](https://fastapi.tiangolo.com/img/vscode-completion.png)
🌅 🏁 🖼 🔌 🌅 ⚒, 👀 <a href="https://fastapi.tiangolo.com/tutorial/">🔰 - 👩‍💻 🦮</a>.
**🚘 🚨**: 🔰 - 👩‍💻 🦮 🔌:
* 📄 **🔢** ⚪️➡️ 🎏 🎏 🥉: **🎚**, **🍪**, **📨 🏑** &amp; **📁**.
* ❔ ⚒ **🔬 ⚛** `maximum_length` ⚖️ `regex`.
* 📶 🏋️ &amp; ⏩ ⚙️ **<abbr title="also known as components, resources, providers, services, injectables">🔗 💉</abbr>** ⚙️.
* 💂‍♂ &amp; 🤝, ✅ 🐕‍🦺 **Oauth2⃣** ⏮️ **🥙 🤝** &amp; **🇺🇸🔍 🔰** 🔐.
* 🌅 🏧 (✋️ 😨 ⏩) ⚒ 📣 **🙇 🐦 🎻 🏷** (👏 Pydantic).
* **🕹** 🛠️ ⏮️ <a href="https://strawberry.rocks" class="external-link" target="_blank">🍓</a> &amp; 🎏 🗃.
* 📚 ⚒ (👏 💃):
* ** *️⃣ **
* 📶 ⏩ 💯 ⚓️ 🔛 🇸🇲 &amp; `pytest`
* **⚜**
* **🍪 🎉**
* ...&amp; 🌖.
## 🎭
🔬 🇸🇲 📇 🎦 **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). (*)
🤔 🌖 🔃 ⚫️, 👀 📄 <a href="https://fastapi.tiangolo.com/benchmarks/" class="internal-link" target="_blank">📇</a>.
## 📦 🔗
⚙️ Pydantic:
* <a href="https://github.com/esnme/ultrajson" target="_blank"><code>ujson</code></a> - ⏩ 🎻 <abbr title="converting the string that comes from an HTTP request into Python data">"🎻"</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">"✍"</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://github.com/esnme/ultrajson" target="_blank"><code>ujson</code></a> - ✔ 🚥 👆 💚 ⚙️ `UJSONResponse`.
⚙️ FastAPI / 💃:
* <a href="https://www.uvicorn.org" target="_blank"><code>uvicorn</code></a> - 💽 👈 📐 &amp; 🍦 👆 🈸.
* <a href="https://github.com/ijl/orjson" target="_blank"><code>orjson</code></a> - ✔ 🚥 👆 💚 ⚙️ `ORJSONResponse`.
👆 💪 ❎ 🌐 👫 ⏮️ `pip install "fastapi[all]"`.
## 🛂
👉 🏗 ® 🔽 ⚖ 🇩🇪 🛂.

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