{"id":38564,"date":"2024-11-01T18:18:18","date_gmt":"2024-11-01T18:18:18","guid":{"rendered":"http:\/\/atmokpo.com\/w\/?p=38564"},"modified":"2024-11-26T06:43:59","modified_gmt":"2024-11-26T06:43:59","slug":"fastapi-%ec%84%9c%eb%b2%84%ea%b0%9c%eb%b0%9c-jinja-if%eb%ac%b8","status":"publish","type":"post","link":"https:\/\/atmokpo.com\/w\/38564\/","title":{"rendered":"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38"},"content":{"rendered":"<p><body><\/p>\n<p>FastAPI\ub294 \ub9e4\uc6b0 \ube60\ub974\uace0 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, Python 3.6+\uc5d0\uc11c \ud0c0\uc785 \ud78c\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec API\ub97c \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc11c\ubc84\ub97c \uac1c\ubc1c\ud558\uace0, Jinja \ud15c\ud50c\ub9bf\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub3d9\uc801\uc778 \uc6f9 \ud398\uc774\uc9c0\ub97c \uc0dd\uc131\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ud2b9\ud788, Jinja \ud15c\ud50c\ub9bf\uc5d0\uc11c <code>if<\/code> \ubb38\uc744 \ud65c\uc6a9\ud574 \uc870\uac74\ubd80 \ub80c\ub354\ub9c1\uc744 \uc2e4\uc2b5\ud560 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<h2>FastAPI\ub780?<\/h2>\n<p>FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \ube44\ub3d9\uae30 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, RESTful API\ub97c \uc27d\uac8c \uac1c\ubc1c\ud560 \uc218 \uc788\uac8c \ub3c4\uc640\uc90d\ub2c8\ub2e4. FastAPI\ub294 \ub2e4\uc74c\uacfc \uac19\uc740 \ud2b9\uc9d5\uc744 \uac00\uc9c0\uace0 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<ul>\n<li><strong>\ube60\ub984:<\/strong> Starlette\uacfc Pydantic\uc744 \uae30\ubc18\uc73c\ub85c \ud558\uc5ec \ube44\ub3d9\uae30 \ucc98\ub9ac\ub97c \uc9c0\uc6d0\ud558\uace0, \ube60\ub978 \uc131\ub2a5\uc744 \uc790\ub791\ud569\ub2c8\ub2e4.<\/li>\n<li><strong>\ud0c0\uc785 \ud78c\ud2b8:<\/strong> Python \ud0c0\uc785 \ud78c\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec \ucf54\ub4dc\uc758 \uac00\ub3c5\uc131\uacfc \uc624\ub958 \uac80\ucd9c\uc744 \ud5a5\uc0c1\uc2dc\ud0ac \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li><strong>\uc790\ub3d9\ud654\ub41c \ubb38\uc11c\ud654:<\/strong> API \ubb38\uc11c\uac00 \uc790\ub3d9\uc73c\ub85c \uc0dd\uc131\ub418\uba70 \uc0ac\uc6a9\uc790\uc5d0\uac8c \uc27d\uac8c \uc81c\uacf5\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n<h2>FastAPI\uc640 Jinja2<\/h2>\n<p>FastAPI\ub294 \ud15c\ud50c\ub9bf\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \ubc31\uc5d4\ub4dc \ud504\ub808\uc784\uc6cc\ud06c\uc785\ub2c8\ub2e4. \uc774\ub97c \ud1b5\ud574 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c \ub3d9\uc801\uc778 HTML \ud398\uc774\uc9c0\ub97c \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. FastAPI\uc640 Jinja2\ub97c \ud568\uaed8 \uc0ac\uc6a9\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h3>\uc124\uce58\ud558\uae30<\/h3>\n<p>\uc6b0\uc120, FastAPI\uc640 Jinja2\ub97c \uc124\uce58\ud574\uc57c \ud569\ub2c8\ub2e4. \ub2e4\uc74c\uacfc \uac19\uc740 \uba85\ub839\uc5b4\ub85c \uc124\uce58\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>pip install fastapi[all] jinja2<\/code><\/pre>\n<h3>FastAPI \uc11c\ubc84 \uad6c\uc131\ud558\uae30<\/h3>\n<p>\ub2e4\uc74c\uc740 \uae30\ubcf8\uc801\uc778 FastAPI \uc11c\ubc84\ub97c \uc124\uc815\ud558\ub294 \uc608\uc2dc \ucf54\ub4dc\uc785\ub2c8\ub2e4:<\/p>\n<pre><code>from fastapi import FastAPI\nfrom fastapi.responses import HTMLResponse\nfrom fastapi.templating import Jinja2Templates\nfrom fastapi import Request\n\napp = FastAPI()\ntemplates = Jinja2Templates(directory=\"templates\")\n\n@app.get(\"\/\", response_class=HTMLResponse)\nasync def read_root(request: Request):\n    return templates.TemplateResponse(\"index.html\", {\"request\": request})<\/code><\/pre>\n<p>\uc5ec\uae30\uc11c \uc6b0\ub9ac\ub294 FastAPI \uc778\uc2a4\ud134\uc2a4\ub97c \ub9cc\ub4e4\uace0 Jinja2 \ud15c\ud50c\ub9bf \ub514\ub809\ud1a0\ub9ac\ub97c \uc124\uc815\ud569\ub2c8\ub2e4. \uae30\ubcf8\uc801\uc778 \ub8e8\ud2b8 \uacbd\ub85c(&#8220;\/&#8221;)\uc5d0 \ub300\ud55c GET \uc694\uccad\uc744 \ucc98\ub9ac\ud558\ub294 \ud568\uc218\ub97c \uc815\uc758\ud558\uc600\uc2b5\ub2c8\ub2e4. \uc774 \ud568\uc218\ub294 \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0\uac8c <code>index.html<\/code> \ud15c\ud50c\ub9bf\uc744 \uc751\ub2f5\ud569\ub2c8\ub2e4.<\/p>\n<h3>\ud15c\ud50c\ub9bf \ud30c\uc77c \uc0dd\uc131\ud558\uae30<\/h3>\n<p>\ud15c\ud50c\ub9bf \ud30c\uc77c\uc740 <code>templates\/index.html<\/code>\uc5d0 \uc0dd\uc131\ud569\ub2c8\ub2e4. \uc774 \ud30c\uc77c\uc740 HTML\ub85c \uad6c\uc131\ub41c \ud398\uc774\uc9c0\ub97c \uc815\uc758\ud569\ub2c8\ub2e4. \uae30\uc874 \ud398\uc774\uc9c0\ub97c \uc704\ud574 \ub2e4\uc74c \ub0b4\uc6a9\uc744 \ucd94\uac00\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"ko\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;title&gt;FastAPI\uc640 Jinja2 \uc18c\uac1c&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;\uc548\ub155\ud558\uc138\uc694!&lt;\/h1&gt;\n    &lt;p&gt;FastAPI \ubc0f Jinja2\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub3d9\uc801\uc778 \uc6f9 \ud398\uc774\uc9c0\ub97c \ub9cc\ub4e4\uace0 \uc788\uc2b5\ub2c8\ub2e4.&lt;\/p&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<h2>Jinja2\uc758 if \ubb38 \uc0ac\uc6a9\ud558\uae30<\/h2>\n<p>\uc774\uc81c \ub3d9\uc801\uc778 \ucf58\ud150\uce20\ub97c \ucd94\uac00\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. Jinja2\uc758 <code>if<\/code> \ubb38\uc744 \uc0ac\uc6a9\ud558\uc5ec \ud398\uc774\uc9c0\uc5d0\uc11c \uc870\uac74\ubd80 \ub85c\uc9c1\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c\uc740 \uac04\ub2e8\ud55c \uc608\uc785\ub2c8\ub2e4:<\/p>\n<pre><code>&lt;h2&gt;\ud658\uc601\ud569\ub2c8\ub2e4!&lt;\/h2&gt;\n&lt;ul&gt;\n    &lt;li&gt;\uc624\ub298 \ub0a0\uc9dc\ub294 {{ date }}\uc785\ub2c8\ub2e4.&lt;\/li&gt;\n    &lt;li&gt;{% if user_logged_in %}\ub85c\uadf8\uc778 \uc0c1\ud0dc\uc785\ub2c8\ub2e4.{% else %}\ub85c\uadf8\uc778\ud558\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4.{% endif %}&lt;\/li&gt;\n&lt;\/ul&gt;<\/code><\/pre>\n<p>\uc5ec\uae30\uc11c <code>user_logged_in<\/code> \ubcc0\uc218\ub97c \uc870\uac74\ubd80\ub85c \uc0ac\uc6a9\ud558\uc5ec \ub85c\uadf8\uc778 \uc0c1\ud0dc\ub97c \ucd9c\ub825\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub97c \uc704\ud574 FastAPI \uc11c\ubc84 \ucf54\ub4dc\uc5d0\uc11c \uc774 \ubcc0\uc218\ub97c \ucd94\uac00\ud574\uc57c \ud569\ub2c8\ub2e4:<\/p>\n<pre><code>from datetime import datetime\n\n@app.get(\"\/\", response_class=HTMLResponse)\nasync def read_root(request: Request):\n    user_logged_in = True  # \uc608\uc2dc\ub85c \ub85c\uadf8\uc778 \uc0c1\ud0dc\ub97c true\ub85c \uc124\uc815\n    date_today = datetime.now().strftime(\"%Y-%m-%d\")\n    return templates.TemplateResponse(\"index.html\", {\"request\": request, \"user_logged_in\": user_logged_in, \"date\": date_today})<\/code><\/pre>\n<h2>\uc804\uccb4 \ucf54\ub4dc \uc815\ub9ac\ud558\uae30<\/h2>\n<p>\uc774\uc81c \uc9c0\uae08\uae4c\uc9c0 \uc791\uc131\ud55c \ucf54\ub4dc\ub97c \ud1b5\ud569\ud574 \ubd05\uc2dc\ub2e4. FastAPI \uc11c\ubc84 \ucf54\ub4dc\uc640 \ud15c\ud50c\ub9bf\uc744 \ucd5c\uc885\uc801\uc73c\ub85c \uad6c\uc131\ud574\ubcf4\uaca0\uc2b5\ub2c8\ub2e4:<\/p>\n<h3>FastAPI \uc11c\ubc84 \ucf54\ub4dc<\/h3>\n<pre><code>from fastapi import FastAPI\nfrom fastapi.responses import HTMLResponse\nfrom fastapi.templating import Jinja2Templates\nfrom fastapi import Request\nfrom datetime import datetime\n\napp = FastAPI()\ntemplates = Jinja2Templates(directory=\"templates\")\n\n@app.get(\"\/\", response_class=HTMLResponse)\nasync def read_root(request: Request):\n    user_logged_in = True  # \uc608\uc2dc\ub85c \ub85c\uadf8\uc778 \uc0c1\ud0dc\ub97c true\ub85c \uc124\uc815\n    date_today = datetime.now().strftime(\"%Y-%m-%d\")\n    return templates.TemplateResponse(\"index.html\", {\"request\": request, \"user_logged_in\": user_logged_in, \"date\": date_today})<\/code><\/pre>\n<h3>templates\/index.html \ud30c\uc77c<\/h3>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"ko\"&gt;\n&lt;head&gt;\n    &lt;meta charset=\"UTF-8\"&gt;\n    &lt;title&gt;FastAPI\uc640 Jinja2 \uc18c\uac1c&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;\uc548\ub155\ud558\uc138\uc694!&lt;\/h1&gt;\n    &lt;h2&gt;\ud658\uc601\ud569\ub2c8\ub2e4!&lt;\/h2&gt;\n    &lt;ul&gt;\n        &lt;li&gt;\uc624\ub298 \ub0a0\uc9dc\ub294 {{ date }}\uc785\ub2c8\ub2e4.&lt;\/li&gt;\n        &lt;li&gt;{% if user_logged_in %}\ub85c\uadf8\uc778 \uc0c1\ud0dc\uc785\ub2c8\ub2e4.{% else %}\ub85c\uadf8\uc778\ud558\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4.{% endif %}&lt;\/li&gt;\n    &lt;\/ul&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/code><\/pre>\n<h2>\ub370\ubaa8 \uc2e4\ud589\ud558\uae30<\/h2>\n<p>\uc774\uc81c \ubaa8\ub4e0 \uac83\uc774 \uc900\ube44\ub418\uc5c8\uc2b5\ub2c8\ub2e4. \uc544\ub798 \uba85\ub839\uc5b4\ub85c FastAPI \uc11c\ubc84\ub97c \uc2e4\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre><code>uvicorn main:app --reload<\/code><\/pre>\n<p><code>main.py<\/code> \ud30c\uc77c \uc774\ub984\uc73c\ub85c \uc800\uc7a5\ud55c \ud6c4, \uc704 \uba85\ub839\uc5b4\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc11c\ubc84\ub97c \uc2dc\uc791\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc6f9 \ube0c\ub77c\uc6b0\uc800\uc5d0\uc11c <code>http:\/\/127.0.0.1:8000<\/code>\ub97c \uc5f4\uba74, \uc6b0\ub9ac\uac00 \ub9cc\ub4e0 \ub3d9\uc801\uc778 \uc6f9 \ud398\uc774\uc9c0\ub97c \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>\ub9c8\ubb34\ub9ac<\/h2>\n<p>\uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uac04\ub2e8\ud55c \uc11c\ubc84\ub97c \uad6c\ucd95\ud558\uace0, Jinja2\uc758 <code>if<\/code> \ubb38\uc744 \ud65c\uc6a9\ud558\uc5ec \uc870\uac74\ubd80 \ub80c\ub354\ub9c1\uc744 \uad6c\ud604\ud558\ub294 \ubc29\ubc95\uc744 \ubc30\uc6e0\uc2b5\ub2c8\ub2e4. FastAPI\ub294 \uc18d\ub3c4\uc640 \ud6a8\uc728\uc131\uc744 \uc790\ub791\ud558\ub294 \ud6cc\ub96d\ud55c \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\uc774\uba70 Jinja2\uc640 \ud568\uaed8 \uc0ac\uc6a9\ud558\uba74 \ub3d9\uc801\uc778 \uc6f9 \ud398\uc774\uc9c0\ub97c \uc27d\uac8c \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc774 \uac15\uc88c\ub97c \ud1b5\ud574 FastAPI\uc640 Jinja2\uc5d0 \ub300\ud55c \uc774\ud574\ub97c \ub192\uc774\uae38 \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n<p>\ud5a5\ud6c4 \ub354 \ub9ce\uc740 \uae30\ub2a5\uacfc \ubcf5\uc7a1\ud55c \uc608\uc81c\ub97c \uad6c\ud604\ud558\ub294 \ubc29\ud5a5\uc73c\ub85c \ub098\uc544\uac00\uae38 \uad8c\uc7a5\ud569\ub2c8\ub2e4. FastAPI\uc758 \uacf5\uc2dd \ubb38\uc11c\uc640 Jinja2\uc758 \ubb38\uc11c\ub97c \ucc38\uace0\ud558\uc5ec \ub354 \uae4a\uc774 \uc788\ub294 \ud559\uc2b5\uc744 \uc9c4\ud589\ud574 \ubcf4\uc138\uc694.<\/p>\n<p><\/body><\/p>\n","protected":false},"excerpt":{"rendered":"<p>FastAPI\ub294 \ub9e4\uc6b0 \ube60\ub974\uace0 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, Python 3.6+\uc5d0\uc11c \ud0c0\uc785 \ud78c\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec API\ub97c \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc11c\ubc84\ub97c \uac1c\ubc1c\ud558\uace0, Jinja \ud15c\ud50c\ub9bf\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub3d9\uc801\uc778 \uc6f9 \ud398\uc774\uc9c0\ub97c \uc0dd\uc131\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ud2b9\ud788, Jinja \ud15c\ud50c\ub9bf\uc5d0\uc11c if \ubb38\uc744 \ud65c\uc6a9\ud574 \uc870\uac74\ubd80 \ub80c\ub354\ub9c1\uc744 \uc2e4\uc2b5\ud560 \uac83\uc785\ub2c8\ub2e4. FastAPI\ub780? FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \ube44\ub3d9\uae30 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, RESTful API\ub97c \uc27d\uac8c \uac1c\ubc1c\ud560 \uc218 &hellip; <a href=\"https:\/\/atmokpo.com\/w\/38564\/\" class=\"more-link\">\ub354 \ubcf4\uae30<span class=\"screen-reader-text\"> &#8220;FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[183],"tags":[],"class_list":["post-38564","post","type-post","status-publish","format-standard","hentry","category-fastapi"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/atmokpo.com\/w\/38564\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"og:description\" content=\"FastAPI\ub294 \ub9e4\uc6b0 \ube60\ub974\uace0 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, Python 3.6+\uc5d0\uc11c \ud0c0\uc785 \ud78c\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec API\ub97c \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc11c\ubc84\ub97c \uac1c\ubc1c\ud558\uace0, Jinja \ud15c\ud50c\ub9bf\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub3d9\uc801\uc778 \uc6f9 \ud398\uc774\uc9c0\ub97c \uc0dd\uc131\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ud2b9\ud788, Jinja \ud15c\ud50c\ub9bf\uc5d0\uc11c if \ubb38\uc744 \ud65c\uc6a9\ud574 \uc870\uac74\ubd80 \ub80c\ub354\ub9c1\uc744 \uc2e4\uc2b5\ud560 \uac83\uc785\ub2c8\ub2e4. FastAPI\ub780? FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \ube44\ub3d9\uae30 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, RESTful API\ub97c \uc27d\uac8c \uac1c\ubc1c\ud560 \uc218 &hellip; \ub354 \ubcf4\uae30 &quot;FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/atmokpo.com\/w\/38564\/\" \/>\n<meta property=\"og:site_name\" content=\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-01T18:18:18+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-26T06:43:59+00:00\" \/>\n<meta name=\"author\" content=\"root\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:site\" content=\"@bebubo4\" \/>\n<meta name=\"twitter:label1\" content=\"\uae00\uc4f4\uc774\" \/>\n\t<meta name=\"twitter:data1\" content=\"root\" \/>\n\t<meta name=\"twitter:label2\" content=\"\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04\" \/>\n\t<meta name=\"twitter:data2\" content=\"2\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/atmokpo.com\/w\/38564\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38564\/\"},\"author\":{\"name\":\"root\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\"},\"headline\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38\",\"datePublished\":\"2024-11-01T18:18:18+00:00\",\"dateModified\":\"2024-11-26T06:43:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38564\/\"},\"wordCount\":51,\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"articleSection\":[\"FastAPI\uc11c\ubc84\uac1c\ubc1c\"],\"inLanguage\":\"ko-KR\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/atmokpo.com\/w\/38564\/\",\"url\":\"https:\/\/atmokpo.com\/w\/38564\/\",\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"isPartOf\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#website\"},\"datePublished\":\"2024-11-01T18:18:18+00:00\",\"dateModified\":\"2024-11-26T06:43:59+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/atmokpo.com\/w\/38564\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/atmokpo.com\/w\/38564\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/atmokpo.com\/w\/38564\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\ud648\",\"item\":\"https:\/\/atmokpo.com\/w\/en\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/atmokpo.com\/w\/#website\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/atmokpo.com\/w\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/atmokpo.com\/w\/#organization\",\"name\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\",\"url\":\"https:\/\/atmokpo.com\/w\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"contentUrl\":\"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png\",\"width\":400,\"height\":400,\"caption\":\"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8\"},\"image\":{\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/bebubo4\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7\",\"name\":\"root\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g\",\"caption\":\"root\"},\"sameAs\":[\"http:\/\/atmokpo.com\/w\"],\"url\":\"https:\/\/atmokpo.com\/w\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/atmokpo.com\/w\/38564\/","og_locale":"ko_KR","og_type":"article","og_title":"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","og_description":"FastAPI\ub294 \ub9e4\uc6b0 \ube60\ub974\uace0 \ud604\ub300\uc801\uc778 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, Python 3.6+\uc5d0\uc11c \ud0c0\uc785 \ud78c\ud2b8\ub97c \uc0ac\uc6a9\ud558\uc5ec API\ub97c \uc27d\uac8c \uad6c\ucd95\ud560 \uc218 \uc788\ub294 \uac15\ub825\ud55c \ub3c4\uad6c\uc785\ub2c8\ub2e4. \uc774 \uae00\uc5d0\uc11c\ub294 FastAPI\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc11c\ubc84\ub97c \uac1c\ubc1c\ud558\uace0, Jinja \ud15c\ud50c\ub9bf\uc744 \uc0ac\uc6a9\ud558\uc5ec \ub3d9\uc801\uc778 \uc6f9 \ud398\uc774\uc9c0\ub97c \uc0dd\uc131\ud558\ub294 \ubc29\ubc95\uc744 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ud2b9\ud788, Jinja \ud15c\ud50c\ub9bf\uc5d0\uc11c if \ubb38\uc744 \ud65c\uc6a9\ud574 \uc870\uac74\ubd80 \ub80c\ub354\ub9c1\uc744 \uc2e4\uc2b5\ud560 \uac83\uc785\ub2c8\ub2e4. FastAPI\ub780? FastAPI\ub294 Python\uc73c\ub85c \uc791\uc131\ub41c \ube44\ub3d9\uae30 \uc6f9 \ud504\ub808\uc784\uc6cc\ud06c\ub85c, RESTful API\ub97c \uc27d\uac8c \uac1c\ubc1c\ud560 \uc218 &hellip; \ub354 \ubcf4\uae30 \"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38\"","og_url":"https:\/\/atmokpo.com\/w\/38564\/","og_site_name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","article_published_time":"2024-11-01T18:18:18+00:00","article_modified_time":"2024-11-26T06:43:59+00:00","author":"root","twitter_card":"summary_large_image","twitter_creator":"@bebubo4","twitter_site":"@bebubo4","twitter_misc":{"\uae00\uc4f4\uc774":"root","\uc608\uc0c1 \ub418\ub294 \ud310\ub3c5 \uc2dc\uac04":"2\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/atmokpo.com\/w\/38564\/#article","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/38564\/"},"author":{"name":"root","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7"},"headline":"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38","datePublished":"2024-11-01T18:18:18+00:00","dateModified":"2024-11-26T06:43:59+00:00","mainEntityOfPage":{"@id":"https:\/\/atmokpo.com\/w\/38564\/"},"wordCount":51,"publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"articleSection":["FastAPI\uc11c\ubc84\uac1c\ubc1c"],"inLanguage":"ko-KR"},{"@type":"WebPage","@id":"https:\/\/atmokpo.com\/w\/38564\/","url":"https:\/\/atmokpo.com\/w\/38564\/","name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38 - \ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","isPartOf":{"@id":"https:\/\/atmokpo.com\/w\/#website"},"datePublished":"2024-11-01T18:18:18+00:00","dateModified":"2024-11-26T06:43:59+00:00","breadcrumb":{"@id":"https:\/\/atmokpo.com\/w\/38564\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/atmokpo.com\/w\/38564\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/atmokpo.com\/w\/38564\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\ud648","item":"https:\/\/atmokpo.com\/w\/en\/"},{"@type":"ListItem","position":2,"name":"FastAPI \uc11c\ubc84\uac1c\ubc1c, Jinja, if\ubb38"}]},{"@type":"WebSite","@id":"https:\/\/atmokpo.com\/w\/#website","url":"https:\/\/atmokpo.com\/w\/","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","description":"","publisher":{"@id":"https:\/\/atmokpo.com\/w\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/atmokpo.com\/w\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/atmokpo.com\/w\/#organization","name":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8","url":"https:\/\/atmokpo.com\/w\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/","url":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","contentUrl":"https:\/\/atmokpo.com\/w\/wp-content\/uploads\/2024\/11\/logo.png","width":400,"height":400,"caption":"\ub77c\uc774\ube0c\uc2a4\ub9c8\ud2b8"},"image":{"@id":"https:\/\/atmokpo.com\/w\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/bebubo4"]},{"@type":"Person","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/91b6b3b138fbba0efb4ae64b1abd81d7","name":"root","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/atmokpo.com\/w\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/708197b41fc6435a7ce22d951b25d4a47e9e904270cb1f04682d4f025066f80c?s=96&d=mm&r=g","caption":"root"},"sameAs":["http:\/\/atmokpo.com\/w"],"url":"https:\/\/atmokpo.com\/w\/author\/root\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38564","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/comments?post=38564"}],"version-history":[{"count":1,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38564\/revisions"}],"predecessor-version":[{"id":38565,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/posts\/38564\/revisions\/38565"}],"wp:attachment":[{"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/media?parent=38564"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/categories?post=38564"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/atmokpo.com\/w\/wp-json\/wp\/v2\/tags?post=38564"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}