{"id":6174,"date":"2024-04-27T06:45:03","date_gmt":"2024-04-27T03:45:03","guid":{"rendered":"https:\/\/rss.eground-zerkalo.com\/?p=6174"},"modified":"2024-04-27T06:45:03","modified_gmt":"2024-04-27T03:45:03","slug":"fastapi-%d0%b4%d0%bb%d1%8f-%d0%bd%d0%b0%d1%87%d0%b8%d0%bd%d0%b0%d1%8e%d1%89%d0%b8%d1%85-stepik-%d0%b8%d0%bb%d1%8c%d1%8f-%d0%bf%d0%b5%d1%80%d0%bc%d0%b8%d0%bd%d0%be%d0%b2","status":"publish","type":"post","link":"https:\/\/rss.eground-zerkalo.com\/?p=6174","title":{"rendered":"FastAPI \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 [Stepik] [\u0418\u043b\u044c\u044f \u041f\u0435\u0440\u043c\u0438\u043d\u043e\u0432]"},"content":{"rendered":"<h2 class=\"\">FastAPI \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 [Stepik] [\u0418\u043b\u044c\u044f \u041f\u0435\u0440\u043c\u0438\u043d\u043e\u0432]<\/h2>\n<p> \t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/v14.skladchik.org\/attachments\/fastapi-png.1010393\/?temp_hash=9fbf3c3d8d049376499c59c766a88209\" class=\"bbCodeImage LbImage\" data-url=\"https:\/\/v14.skladchik.org\/attachments\/fastapi-png.1010393\/?temp_hash=9fbf3c3d8d049376499c59c766a88209\" alt=\"[&#x200B;IMG]\" \/> <br \/> \u042d\u0442\u043e\u0442 \u043a\u0443\u0440\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e FastAPI. \u0412\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0435, \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0435 REST API \u043d\u0430 Python. \u0412\u044b \u043d\u0430\u0447\u043d\u0435\u0442\u0435 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Hello World \u0438 \u0434\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u0442\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 API \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u0443\u0440\u0441 \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0438 \u043c\u0438\u043d\u0443\u0442\u044b \u0432\u0438\u0434\u0435\u043e!<br \/> <b><br \/> \u041e \u043a\u0443\u0440\u0441\u0435<br \/> \u0420\u0430\u0437\u0434\u0435\u043b 1:<\/b> \u00ab\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 API\u00bb \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 API, \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u043e\u0439 REST API. \u0418\u0437\u0443\u0447\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 HTTP \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043a\u043e\u0434\u044b \u043e\u0442\u0432\u0435\u0442\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0430.<br \/> <b>\u0420\u0430\u0437\u0434\u0435\u043b 2:<\/b> \u00ab\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 FastAPI\u00bb \u043c\u044b \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u0430\u043c\u0438 FastAPI \u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0432\u043e\u0435 \u043f\u0435\u0440\u0432\u043e\u0435 API, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0435\u0435 &quot;Hello World&quot;. \u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0438\u0437\u0443\u0447\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 FastAPI. \u0418 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c\u044b\u0435 \u0438\u0437 \u043f\u0443\u0442\u0438 \u0438 \u0442\u0435\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<br \/> <b>\u0420\u0430\u0437\u0434\u0435\u043b 3:<\/b> \u00ab\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 CRUD-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 FastAPI\u00bb \u043c\u044b \u0441\u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u0443\u0435\u043c \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 CRUD \u043f\u0440\u043e\u0435\u043a\u0442. \u041f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043c\u0441\u044f \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 GET, POST, PUT, DELETE, \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 Pydantic. \u0418\u0437\u0443\u0447\u0438\u043c \u043c\u043e\u0434\u0435\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u043e\u0432, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u043e\u0448\u0438\u0431\u043e\u043a \u0438 \u043a\u043e\u0434\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f. \u041e\u0431\u0441\u0443\u0434\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0448\u0430\u0431\u043b\u043e\u043d\u044b Jinja \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439 \u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438\u0437 API.<br \/> <b>\u0420\u0430\u0437\u0434\u0435\u043b 4:<\/b> \u00ab\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439\u00bb  \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0448\u0430\u0431\u043b\u043e\u043d \u0432\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439 FastAPI \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u043c\u0438 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u044b Depends() \u0438 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0445 \u043c\u043e\u0434\u0443\u043b\u0435\u0439 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f.<br \/> <b>\u0420\u0430\u0437\u0434\u0435\u043b 5:<\/b> \u00ab\u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043d\u0430 FastAPI\u00bb  \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 FastAPI, \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442. \u0423\u0437\u043d\u0430\u0435\u043c \u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 APIRouter \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 SQLAlchemy, \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Alembic \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0439. \u041d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0441\u0441\u0438\u0438 \u0438 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u0441\u0432\u043e\u0438 \u043f\u0435\u0440\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u043c\u0438. \u0420\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f HTTP Basic Auth,  OAuth2, \u0438 \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c JWT \u0442\u043e\u043a\u0435\u043d. \u0413\u0434\u0435 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e, \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c \u0442\u043e\u0447\u043a\u0430\u043c \u043d\u0430\u0448\u0435\u0433\u043e API.<br \/> <b>\u0420\u0430\u0437\u0434\u0435\u043b 6:<\/b> \u00ab\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432 FastAPI\u00bb \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 API \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u043b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435, \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u0432\u0435\u0442\u043e\u0432. \u0418\u0437\u0443\u0447\u0438\u043c, \u0447\u0442\u043e \u0442\u0430\u043a\u043e\u0435 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043a\u0430\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 API.<br \/> <b>\u0420\u0430\u0437\u0434\u0435\u043b 7:<\/b> \u00abDocker + FastAPI\u00bb \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043d\u0446\u0435\u043f\u0446\u0438\u0438 Docker \u0438 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0432\u043e\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 \u0441 Python \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. \u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0443\u043f\u0430\u043a\u0443\u0435\u043c FastAPI, PostgreSQL, NGINX \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0438 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u043a \u0434\u0435\u043f\u043b\u043e\u044e.<br \/> <b>\u0420\u0430\u0437\u0434\u0435\u043b 8:<\/b> \u00ab\u0414\u0435\u043f\u043b\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 Docker\u00bb \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0435\u043f\u043b\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 FastAPI, \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 PostgreSQL, \u0432\u0435\u0431 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u043c Gunicorn \u0438 Nginx \u043d\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u0445 Docker \u0441 Compose.<\/p>\n<p> <b>\u0427\u0435\u043c\u0443 \u0432\u044b \u043d\u0430\u0443\u0447\u0438\u0442\u0435\u0441\u044c<\/b> <\/p>\n<ul>\n<li>\u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u043c FastAPI<\/li>\n<li>\u041f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 API \u0441\u0435\u0440\u0432\u0438\u0441\u044b<\/li>\n<li>\u0412\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 Pydantic<\/li>\n<li>\u041d\u0430\u0443\u0447\u0438\u0442\u0435\u0441\u044c \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u0411\u0414 \u0447\u0435\u0440\u0435\u0437 SQLAlchemy \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Alembic<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 OAuth2 \u0438 JWT<\/li>\n<li>\u0423\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0442\u044c FastAPI \u0432 Docker Compose<\/li>\n<li>\u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0434\u0435\u043f\u043b\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440<\/li>\n<\/ul>\n<p><b>\u0412 \u043a\u0443\u0440\u0441 \u0432\u0445\u043e\u0434\u044f\u0442<\/b> <\/p>\n<ul>\n<li>52 \u0443\u0440\u043e\u043a\u0430<\/li>\n<li>40 \u0442\u0435\u0441\u0442\u043e\u0432<\/li>\n<li>9 \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0445 \u0437\u0430\u0434\u0430\u0447<\/li>\n<\/ul>\n<p>    \t\u0421\u043f\u043e\u0439\u043b\u0435\u0440: \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043a\u0443\u0440\u0441\u0430 \t\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 API <\/p>\n<ol>\n<li>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 API \u0438 \u0435\u0433\u043e \u0442\u0438\u043f\u044b?<\/li>\n<li>\u0418\u0437\u0443\u0447\u0430\u0435\u043c REST. \u0410\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0430 \u0438 \u043b\u0443\u0447\u0448\u0438\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438<\/li>\n<li>HTTP \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u0438\u0434\u0435\u043c\u043f\u043e\u0442\u0435\u043d\u0442\u043d\u043e\u0441\u0442\u044c<\/li>\n<li>\u041a\u043e\u0434\u044b \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0439 HTTP<\/li>\n<\/ol>\n<p>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 FastAPI <\/p>\n<ol>\n<li>\u0427\u0442\u043e \u0442\u0430\u043a\u043e\u0435 FastAPI?<\/li>\n<li>HelloWorld \u043d\u0430 FastAPI<\/li>\n<li>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439 API<\/li>\n<li>\u041c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0432 FastAPI<\/li>\n<li>\u0412\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u043e\u0432 (Path, Query)<\/li>\n<\/ol>\n<p>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 CRUD-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 FastAPI <\/p>\n<ol>\n<li>\u041f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f REST API (GET, POST, PUT, DELETE)<\/li>\n<li>\u041c\u043e\u0434\u0435\u043b\u0438 Pydantic \u0438 \u0438\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f<\/li>\n<li>\u041c\u043e\u0434\u0435\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0448\u0438\u0431\u043e\u043a<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 Jinja \u0438 \u0444\u043e\u0440\u043c \u0432 FastAPI<\/li>\n<li>\u0418\u0442\u043e\u0433\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0430<\/li>\n<\/ol>\n<p>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 <\/p>\n<ol>\n<li>\u0412\u043d\u0435\u0434\u0440\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/li>\n<li>\u0417\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f\u0445 \u043f\u0443\u0442\u0438 \u0438 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438<\/li>\n<\/ol>\n<p>\u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d \u043d\u0430 FastAPI <\/p>\n<ol>\n<li>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 FastAPI, APIRouter \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043c\u043e\u0434\u0435\u043b\u0435\u0439 Pydantic<\/li>\n<li>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f SQLAlchemy<\/li>\n<li>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 SQLAlchemy<\/li>\n<li>\u041e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0432 SQLAchemy<\/li>\n<li>\u041c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 \u0432 SQLAlchemy, \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 Alembic<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f SQLAlchemy, \u0447\u0430\u0441\u0442\u044c 1<\/li>\n<li>\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u043a \u0411\u0414 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f SQLAlchemy, \u0447\u0430\u0441\u0442\u044c 2<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043d\u0430 PostgreSQL<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0441\u0442\u0438 \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\u0445 SQLAlchemy<\/li>\n<li>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f HTTP Basic Auth<\/li>\n<li>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e OAuth2 \u0438 JWT<\/li>\n<li>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0430\u0432\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0432 FastAPI<\/li>\n<li>\u0418\u0442\u043e\u0433\u0438 \u0440\u0430\u0431\u043e\u0442\u044b<\/li>\n<li>\u042d\u043a\u0437\u0430\u043c\u0435\u043d<\/li>\n<\/ol>\n<p>\u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432 FastAPI <\/p>\n<ol>\n<li>\u0412\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 API<\/li>\n<li>Middleware<\/li>\n<li>\u041b\u043e\u0433\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/li>\n<li>\u041c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f<\/li>\n<li>\u0410\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441 Celery \u0438 Redis<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u0433\u043e WebSocket<\/li>\n<li>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 FastAPI, \u0447\u0430\u0441\u0442\u044c 1<\/li>\n<li>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 FastAPI, \u0447\u0430\u0441\u0442\u044c 2<\/li>\n<\/ol>\n<p>Docker + FastAPI <\/p>\n<ol>\n<li>\u0417\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 Docker<\/li>\n<li>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b Docker<\/li>\n<li>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u0432 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430<\/li>\n<li>\u041a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0438\u0437\u0430\u0446\u0438\u044f Django \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 Dockerfile<\/li>\n<li>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 Docker Compose<\/li>\n<li>Docker Compose \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 FastAPI, PostgreSQL \u0438 Redis<\/li>\n<li>\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430 \u043a \u0434\u0435\u043f\u043b\u043e\u044e, Gunicorn \u0438 NGINX \u0432 Docker Compose<\/li>\n<li>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Docker-Compose \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u043c\u0435\u0434\u0438\u0430 \u0444\u0430\u0439\u043b\u043e\u0432<\/li>\n<li>\u0418\u0442\u043e\u0433\u0438 \u0440\u0430\u0431\u043e\u0442\u044b<\/li>\n<\/ol>\n<p>\u0414\u0435\u043f\u043b\u043e\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 Docker <\/p>\n<ol>\n<li>\u041f\u043e\u043a\u0443\u043f\u043a\u0430 VPS, \u0434\u043e\u043c\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u043c\u0435\u043d\u0438, \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 DNS<\/li>\n<li>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Docker \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/li>\n<li>\u0417\u0430\u043f\u0443\u0441\u043a Docker \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435<\/li>\n<li>\u041f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 SSL-\u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u0430 \u043e\u0442 Let&#039;s Encrypt \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 HTTPS<\/li>\n<\/ol>\n<p>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e <\/p>\n<ol>\n<li>\u041e \u043a\u0443\u0440\u0441\u0435<\/li>\n<\/ol>\n<p> \u041f\u0440\u043e\u0434\u0430\u0436\u043d\u0438\u043a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>FastAPI \u0434\u043b\u044f \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 [Stepik] [\u0418\u043b\u044c\u044f \u041f\u0435\u0440\u043c\u0438\u043d\u043e\u0432] \u042d\u0442\u043e\u0442 \u043a\u0443\u0440\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e FastAPI. \u0412\u044b \u0443\u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0435, \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0435 REST API \u043d\u0430 Python. \u0412\u044b \u043d\u0430\u0447\u043d\u0435\u0442\u0435 \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Hello World \u0438 \u0434\u0430\u043b\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u0442\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0435 API \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0435 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u043f\u0440\u0430\u0432\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430. \u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0434\u0430\u043d\u043d\u044b\u0439 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-6174","post","type-post","status-publish","format-standard","hentry","category-rss"],"_links":{"self":[{"href":"https:\/\/rss.eground-zerkalo.com\/index.php?rest_route=\/wp\/v2\/posts\/6174","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rss.eground-zerkalo.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/rss.eground-zerkalo.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/rss.eground-zerkalo.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/rss.eground-zerkalo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6174"}],"version-history":[{"count":0,"href":"https:\/\/rss.eground-zerkalo.com\/index.php?rest_route=\/wp\/v2\/posts\/6174\/revisions"}],"wp:attachment":[{"href":"https:\/\/rss.eground-zerkalo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6174"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/rss.eground-zerkalo.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6174"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/rss.eground-zerkalo.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6174"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}