{"id":57,"date":"2018-11-30T19:14:31","date_gmt":"2018-11-30T10:14:31","guid":{"rendered":"http:\/\/aiacademy.jp\/media\/?p=57"},"modified":"2025-06-02T12:24:06","modified_gmt":"2025-06-02T03:24:06","slug":"flask","status":"publish","type":"post","link":"https:\/\/aiacademy.jp\/media\/?p=57","title":{"rendered":"\u3010Python\u3011Flask\u3068\u306f\uff1fFlask\u3067Web\u958b\u767a\u306e\u57fa\u790e\u3092\u5b66\u307c\u3046\uff01"},"content":{"rendered":"<h1 id=\"i-0\">Flask\u3068\u306f<\/h1>\n<p><a href=\"https:\/\/msiz07-flask-docs-ja.readthedocs.io\/ja\/latest\/\" rel=\"nofollow noopener\" target=\"_blank\">Flask\uff08\u30d5\u30e9\u30b9\u30b3\/\u30d5\u30e9\u30b9\u30af\uff09<\/a>\u3068\u306f\u3001Python\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3001\u5c0f\u898f\u6a21\u5411\u3051\u306e\u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u306e\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<br>Web\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u306f\u3001\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3084\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3092\u63d0\u4f9b\u3057\u3001\u30a6\u30a7\u30d6\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u308f\u306a\u3044\u6642\u3088\u308a\u3082\u3088\u308a\u5bb9\u6613\u306bWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3082\u306e\u3067\u3059\u3002<br>\u3061\u306a\u307f\u306b\u3001Python\u306b\u306f\u3044\u304f\u3064\u3082\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u304c\u3042\u308a\u3001\u4f8b\u3048\u3070\u3001<a href=\"https:\/\/docs.djangoproject.com\/ja\/5.0\/\" rel=\"nofollow noopener\" target=\"_blank\">Djnago(\u30b8\u30e3\u30f3\u30b4)<\/a>\u3084<a href=\"https:\/\/trypyramid.com\/\" rel=\"nofollow noopener\" target=\"_blank\">pyramid<\/a>\u3001<a href=\"https:\/\/bottlepy.org\/docs\/dev\/\" rel=\"nofollow noopener\" target=\"_blank\">bottle<\/a>\u306a\u3069\u4ed6\u306b\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u3053\u306e\u7ae0\u3067\u306f\u3001\u5b66\u7fd2\u30b3\u30b9\u30c8\u306e\u4f4e\u3044Flask\u3092\u6271\u3063\u3066\u884c\u304d\u307e\u3059\u3002\u307e\u305f\u8fd1\u5e74\u3067\u306f\u3001<a href=\"https:\/\/www.gradio.app\/\" rel=\"nofollow noopener\" target=\"_blank\">Gradio\uff08\u30b0\u30e9\u30c7\u30a3\u30aa\uff09<\/a>\u3068\u547c\u3070\u308c\u308b\u6a5f\u68b0\u5b66\u7fd2\u30e2\u30c7\u30eb\u306e\u30c7\u30e2\u3092\u884c\u3046Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u7c21\u5358\u306b\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3082\u4eba\u6c17\u3067\u3059\u3002Flask\u306e\u57fa\u672c\u3092\u5b66\u3093\u3060\u5f8c\u306b\u3001Gradio\u3082\u5229\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><span class=\"keiko_blue keiko_green\">\u3053\u306e\u30b5\u30a4\u30c8\u306f\u3001Python\u3084\u751f\u6210AI\u306a\u3069\u3092\u5b66\u3079\u308b\u30aa\u30f3\u30e9\u30a4\u30f3\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30b9\u30af\u30fc\u30eb AI Academy Bootcamp\u304c\u904b\u55b6\u3057\u3066\u3044\u307e\u3059\u3002<\/span><\/p>\n<div id=\"sgb-css-id-4\">\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">&nbsp;<\/div>\n<\/div>\n<p><a href=\"https:\/\/aiacademy.jp\/media\/?p=3469\">\u95a2\u9023\u8a18\u4e8b\uff1aGradio\u3068\u306f\uff1f Python\u3067\u6a5f\u68b0\u5b66\u7fd2Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u30b5\u30af\u30c3\u3068\u4f5c\u308d\u3046\uff01<\/a><\/p>\n<div class=\"toc\">    <div id=\"toc_container\" class=\"sgb-toc--no-bullets js-smooth-scroll\" data-dialog-title=\"Table of Contents\">\n      <p class=\"toc_title\">\u76ee\u6b21 <\/p>\n      <ul class=\"toc_list\">  <li class=\"first\">    <a href=\"#i-0\">Flask\u3068\u306f<\/a>    <ul class=\"menu_level_1\">      <li class=\"first\">        <a href=\"#i-1\">Flask\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/a>      <\/li>      <li>        <a href=\"#i-2\">Flask\u3092\u52d5\u304b\u3057\u3066\u307f\u308b<\/a>      <\/li>      <li>        <a href=\"#i-3\">\u3010\u7121\u6599\u52d5\u753b\uff1a\u500d\u901f\u3067\u5b66\u3076\uff01\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u6cd5\uff08\u77ed\u7e2e\u7248\uff09\u3011<\/a>      <\/li>      <li>        <a href=\"#i-4\">render_template\u306b\u3088\u308b\u8aad\u307f\u8fbc\u307f<\/a>      <\/li>      <li>        <a href=\"#i-5\">html\u3067\u5165\u529b\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092python\u3067\u6271\u3046<\/a>      <\/li>      <li>        <a href=\"#i-6\">Web\u30b5\u30fc\u30d3\u30b9\u306e\u69cb\u6210\u3068API\u30b5\u30fc\u30d0\u30fc<\/a>      <\/li>      <li>        <a href=\"#i-7\">Web API (JSON API)<\/a>      <\/li>      <li class=\"last\">        <a href=\"#i-8\">\u307e\u3068\u3081<\/a>      <\/li>    <\/ul>  <\/li>  <li>    <a href=\"#i-9\">Web\u30a2\u30d7\u30ea\u306e\u958b\u767a\u3092\u3055\u3089\u306b\u6df1\u3081\u305f\u3044\u65b9\u3078<\/a>    <ul class=\"menu_level_1\">      <li class=\"first last\">        <a href=\"#i-10\">\u2728AI\u4eba\u6750\u30b3\u30fc\u30b9 \u53d7\u8b1b\u304a\u7533\u8fbc\u307f\u53d7\u4ed8\u4e2d\uff01<\/a>      <\/li>    <\/ul>  <\/li>  <li class=\"last\">    <a href=\"#i-11\">\u30aa\u30b9\u30b9\u30e1\u8a18\u4e8b<\/a>  <\/li><\/ul>\n      \n    <\/div><\/div><div class=\"toc\"><p><\/p>\n<\/div><h2 id=\"i-1\"><span style=\"color: revert; font-size: 1.4em; font-weight: revert; font-family: var(--sgb-font-family);\">Flask\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb<\/span><\/h2>\n<pre><code>pip install flask\n<\/code><\/pre>\n<p>Mac OS\u306e\u65b9\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u8d77\u52d5\u3057\u3001Windows\u306e\u65b9\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8(cmd)\u3092\u8d77\u52d5\u3057\u3001\u4e0a\u8a18\u306epip\u30b3\u30de\u30f3\u30c9\u306b\u3066flask\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br>\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u7d42\u3048\u305f\u3089\u3001\u5b9f\u969b\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u6210\u529f\u3057\u305f\u304b\u78ba\u8a8d\u3057\u307e\u3059\u3002<\/p>\n<p>\u78ba\u8a8d\u306e\u305f\u3081\u3001Python\u306e\u5bfe\u8a71\u578b\u30b7\u30a7\u30eb\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<br>\u8d77\u52d5\u3059\u308b\u306b\u306f\u3001<strong>python\u30b3\u30de\u30f3\u30c9<\/strong>\u3092\u5165\u529b&amp;\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u3001Python\u306e\u5bfe\u8a71\u578b\u30b7\u30a7\u30eb\uff08\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b7\u30a7\u30eb\uff09\u306b\u5207\u308a\u66ff\u3048\u307e\u3059\u3002<br>\u305d\u308c\u3067\u306f\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>python\n<\/code><\/pre>\n<p>Python\u306e\u5bfe\u8a71\u578b\u30b7\u30a7\u30eb\uff08\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u30b7\u30a7\u30eb\uff09\u3067\u5165\u529b&amp;\u5b9f\u884c\u3059\u308b\u90e8\u5206\u306f&gt;&gt;&gt;\u306e\u5f8c\u304b\u3089\u3067\u3059\u3002<br>\u6b21\u306e&gt;&gt;&gt;\u90e8\u5206\u306f\u5165\u529b\u3057\u3066\u306a\u304f\u3066\u5927\u4e08\u592b\u3067\u3059\u3002<\/p>\n<pre><code>&gt;&gt;&gt; import flask\n&gt;&gt;&gt; flask.__version__\n'0.12'\n<\/code><\/pre>\n<p>\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u8868\u793a\u3055\u308c\u308c\u3070\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u6210\u529f\u3067\u3059\u3002<br>\u30bf\u30fc\u30df\u30ca\u30eb\u3084\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u306f\u4e00\u65e6\u9589\u3058\u3066\u7d42\u4e86\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br>\u203b\u30bf\u30fc\u30df\u30ca\u30eb\u3084\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u7d42\u4e86\u3059\u308b\u5834\u5408\u306f\u3001\u305d\u306e\u307e\u307e\u9589\u3058\u308b\u304b\u3001exit()\u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u308b\u3053\u3068\u3067\u3082\u7d42\u4e86\u53ef\u80fd\u3067\u3059\u3002<br>\u203b\u8868\u793a\u3055\u308c\u308b\u30d0\u30fc\u30b8\u30e7\u30f3\u306f\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u6642\u671f\u306b\u3088\u3063\u3066\u30c6\u30ad\u30b9\u30c8\u3068\u7570\u306a\u308b\u5834\u5408\u304c\u3054\u3056\u3044\u307e\u3059\u3002<\/p>\n<h2 id=\"i-2\">Flask\u3092\u52d5\u304b\u3057\u3066\u307f\u308b<\/h2>\n<p>\u5b9f\u969b\u306bFlask\uff08\u30d5\u30e9\u30b9\u30af\uff09\u3092\u52d5\u304b\u3057\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<br>\u4e0b\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092flask_sample.py\u3068\u3044\u3046\u540d\u524d\u3067Desktop\uff08\u30c7\u30b9\u30af\u30c8\u30c3\u30d7\uff09\u306b\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code class=\"python\">from flask import Flask\napp = Flask(__name__, static_folder='.', static_url_path='')\n@app.route('\/')\ndef index():\n    return app.send_static_file('index.html')\n\napp.run(port=8000, debug=True)\n<\/code><\/pre>\n<p>\u203bWindows OS\u3092\u3054\u5229\u7528\u306e\u65b9\u3067\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u304c\u30a8\u30e9\u30fc\u3068\u306a\u308b\u5834\u5408\u3001<br>port\u756a\u53f7\u306e\u90e8\u5206\u3001debug\u306e\u90e8\u5206\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code class=\"python:\">app.run(port=12345, debug=False)\n<\/code><\/pre>\n<p>\u6b21\u306b\u3001index.html\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u307e\u3059\u3002<br>\u62e1\u5f35\u5b50\u306fHTML\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u306e\u3067\u3001\u300c.html\u300d\u306b\u306a\u308a\u307e\u3059\u3002<br>\u3053\u306e\u969b\u3001index.html\u3092\u4fdd\u5b58\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306fflask_sample.py\u3068\u540c\u3058\u968e\u5c64\u3067\u3042\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br>HTML\u306b\u95a2\u3057\u3066\u306f\u3001<a href=\"https:\/\/dotinstall.com\/lessons\/basic_html_v4\" rel=\"nofollow noopener\" target=\"_blank\">\u30c9\u30c3\u30c8\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u306eHTML<\/a>\u306a\u3069\u3092\u5229\u7528\u3057\u4e88\u7fd2\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"ja\"&gt;\n&lt;head&gt;\n    &lt;title&gt;\u521d\u3081\u3066\u306eFlask\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n&lt;p&gt;Flask&lt;\/p&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>\u3067\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u307e\u305f\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u4e0a\u3067\u3001flask_sample.py\u306e\u3042\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u307e\u3067<strong>cd<\/strong>\u30b3\u30de\u30f3\u30c9\u3092\u7528\u3044\u3066\u79fb\u52d5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br><strong>\uff0a\u3053\u306e\u6642\u3001\u5148\u307b\u3069Flask\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u30bf\u30fc\u30df\u30ca\u30eb\u3084\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u306f\u4e00\u65e6\u9589\u3058\u3066\u3001\u518d\u5ea6\u30bf\u30fc\u30df\u30ca\u30eb\u3082\u3057\u304f\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u3092\u8d77\u52d5\u3057\u3001cd\u30b3\u30de\u30f3\u30c9\u306b\u3088\u308a\u79fb\u52d5\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/strong><\/p>\n<p>\u79fb\u52d5\u65b9\u6cd5\u306f\u3001<a href=\"?id=126&amp;section=cd\">cd\u30b3\u30de\u30f3\u30c9<\/a>\u3092\u5229\u7528\u3057\u307e\u3059\u3002<br>Mac\u306e\u65b9\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3001Windows\u306e\u65b9\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8(cmd)\u3092\u8d77\u52d5\u3057\u307e\u3059\u3002<\/p>\n<pre><code>cd ~\/Desktop\n<\/code><\/pre>\n<p>\u3067\u79fb\u52d5\u51fa\u6765\u307e\u3059\u3002<br>\u4e0a\u8a18\u30b3\u30de\u30f3\u30c9\u306f\u3001Desktop\u306b\u4fdd\u5b58\u3057\u305fflask_sample.py\u304c\u3042\u308b\u60f3\u5b9a\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u79fb\u52d5\u51fa\u6765\u307e\u3057\u305f\u3089\u6b21\u306e\u30b3\u30de\u30f3\u30c9\u3067flask_sample.py\u3092\u5b9f\u884c\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>python flask_sample.py\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/feea37ec3866ee5561724b75ebb457b58330c573\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3130353838372f30353330386366642d313539382d653934332d353563312d6537613730363234656564612e706e67\" alt=\"\"><\/p>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u3082\u3057\u304f\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u306b\u3001\u69d8\u3005\u306a\u51fa\u529b\u304c\u3042\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u8d77\u52d5\u3057\u305f\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002<br><a href=\"localhost:8000\" rel=\"nofollow noopener\" target=\"_blank\">localhost:8000<\/a>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u4e0a\u8a18\u306e\u753b\u9762\u304c\u8868\u793a\u3055\u308c\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306b\u3001hello\u95a2\u6570\u3092\u5b9f\u88c5\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br><em>\uff0aWindows\u30e6\u30fc\u30b6\u30fc\u306e\u65b9\u3067\u3001app.run()\u306e\u5f15\u6570\u306b\u3001port\u756a\u53f7\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u3001(\u4f8b\u3048\u3070\u3001app.run(port=12345, debug=False)\u306a\u3069)\u300elocalhost:\u6570\u5b57\u300f\u306e\u6570\u5b57\u306e\u90e8\u5206\u3092\u6307\u5b9a\u3057\u305fport\u756a\u53f7\u306b\u5909\u3048\u3066\u5b9f\u884c\u3057\u76f4\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/em><\/p>\n<p>\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092<strong>app.run(port=8000, debug=True)\u306e\u4e0a\u306b\u8ffd\u52a0<\/strong>\u3057\u307e\u3059\u3002<br>\uff08<em>\u3053\u306e\u6642\u4e00\u756a\u6700\u5f8c\u306e\u884c\u306eapp.run(port=8000, debug=True)\u306e\u4e0a\u306b\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/em>\uff09<\/p>\n<pre><code>@app.route('\/hello\/&lt;name&gt;')\ndef hello(name):\n    return name\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u306f\u30d6\u30e9\u30a6\u30b6\u306eURL\u306b\u3066<a href=\"localhost:8000\/hello\/python\" rel=\"nofollow noopener\" target=\"_blank\">localhost:8000\/hello\/python<\/a><br>\u3068\u5165\u529b\u3057\u3001\u30d6\u30e9\u30a6\u30b6\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u3068\u3001\u6b21\u306e\u3088\u3046\u306b\u753b\u9762\u306b\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br>(<strong><em>\uff0a\u4e0a\u8a18\u30ea\u30f3\u30af\u3092\u98db\u3076\u3068\u74b0\u5883\u306b\u3088\u3063\u3066\u306f\u3001\u771f\u3063\u767d\u3044\u30da\u30fc\u30b8\u306b\u306a\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u305d\u306e\u5834\u5408\u30ea\u30ed\u30fc\u30c9\uff08\u518d\u8aad\u307f\u8fbc\u307f\uff09\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/em><\/strong>)<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/aiacademy.jp\/assets\/img\/flask_python.png\" alt=\"\"><\/p>\n<p>@app.route\u306e\u95a2\u6570\u5185\u306e&lt;\u30fb\u30fb\u30fb&gt;\u306e\u90e8\u5206\u306b\u4efb\u610f\u306e\u540d\u524d(\u3053\u3053\u3067\u306f)\u3092\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u3001\u305d\u306e\u540d\u79f0\u3092\u6b21\u306e\u95a2\u6570(\u3053\u3053\u3067\u306fhello\u95a2\u6570)\u306b\u3066route\u5185\u306e&lt;\u30fb\u30fb\u30fb&gt;\u3067\u8a18\u8ff0\u3057\u305f\u5024\u3092\u5f15\u6570\u3068\u3057\u3066\u5229\u7528\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<br>\u4eca\u56de\u306f\u2019\/hello\/\u2019\u3068\u3057\u307e\u3057\u305f\u304c\u3001&lt;\u30fb\u30fb\u30fb&gt;\u306e\u30fb\u30fb\u30fb\u306e\u90e8\u5206\u306f\u81ea\u7531\u306a\u540d\u79f0\u3092\u3064\u3051\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<p>\u6b21\u306b\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u8aac\u660e\u3067\u3059\u3002<br><strong>\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u306f\u3001URL\u3068Flask\u306e\u51e6\u7406\u3092\u5bfe\u5fdc\u3065\u3051\u308b\u3053\u3068\u3067\u3001URL\u3068\u95a2\u6570\u3092\u7d10\u4ed8\u3051\u308b\u3053\u3068\u304c\u51fa\u6765\u307e\u3059\u3002<\/strong><br>Flask\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u8a18\u8ff0\u3059\u308b\u306b\u306f\u3001route()\u3092\u7528\u3044\u307e\u3059\u3002<br>flask_sample.py\u306e\u5168\u4f53\u50cf\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><code>import os\nfrom flask import Flask, url_for\n\napp = Flask(__name__)\n\n# \u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\n@app.route(\"\/hello\")\ndef hello_world():\n    return \"Hello world\"\n\n@app.route(\"\/\")\ndef index():\n    return url_for(\"show_user_profile\", username=\"ai_academy\")\n\n@app.route(\"\/user\/&lt;username&gt;\")\ndef show_user_profile(username):\n    return \"UserName: \" + str(username)\n\n@app.route(\"\/post\/&lt;int:post_id&gt;\")\ndef show_post(post_id):\n    return \"Post\" + str(post_id)\n\n\nif __name__ == \"__main__\":\n    app.run(port=8000, debug=True)\n<\/code><\/pre>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u89e3\u8aac\u3092\u81f4\u3057\u307e\u3059\u3002<br>\u307e\u305a\u306f\u3001\u4f55\u3082routing\u8a2d\u5b9a\u3057\u306a\u304b\u3063\u305f\u5834\u5408\u3001show_user_profile()\u3068\u3044\u304616\u884c\u76ee\u3067\u5b9a\u7fa9\u3057\u305f\u95a2\u6570\u304c\u8d70\u308a\u307e\u3059\u3002<br>\u5f15\u6570\u3067\u306f\u3001username=\u201dai_academy\u201d\u304c\u6e21\u3055\u308c\u3001\u8868\u793a\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br>http:\/\/127.0.0.1:8000\/<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/93e80477d39f3a902d2bd2103f3d5ae23f350e6f\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f61626266353337632d653136632d636331632d623337332d6264363365616131303139362e706e67\" alt=\"\"><\/p>\n<p>\u6b21\u306b\u4ee5\u4e0b\u306eURL\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br>http:\/\/127.0.0.1:8000\/user\/AI<br>\u3053\u3053\u3067URL\u306e\u4e2d\u306b\u3042\u308b\u3001AI\u306e\u90e8\u5206\u3092\u5909\u3048\u3066\u6319\u52d5\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/3a69da4b13d934c17fa89e5366f844f66a661907\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f66396662383566632d626138332d306531362d323337342d3436333332623266336133372e706e67\" alt=\"\"><\/p>\n<p>\u6b21\u306b\u3001 http:\/\/127.0.0.1:8000\/hello \u3067\u306f\u3001Hello World!\u304c\u51fa\u529b\u3055\u308c\u308b\u306e\u3092\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/e1382f05c85c61ce36a2b45a5de124e1aa35b761\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f39623437653931322d313235662d336239662d623962392d3866353036653530393938372e706e67\" alt=\"\"><\/p>\n<p>\u6b21\u306b\u3001\u578b\u3092\u6307\u5b9a\u3057\u305fURL\u53c2\u7167\u3092\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u6570\u5024123\u3092\u4ed6\u306e\u5024\u306b\u5909\u3048\u308b\u3053\u3068\u3067\u53c2\u8003\u306b\u3067\u304d\u307e\u3059\u3002<br>URL\u306f http:\/\/127.0.0.1:8000\/post\/123 \u3092\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/e9e5b10e9a2e0b26d85de902cc18a128773d7384\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f34383237623966332d333130332d626334632d366233622d3864353238306265303436352e706e67\" alt=\"\"><\/p>\n<p>flask\u5074\u3067\u578b\u3092\u56fa\u5b9a\u3057\u3066\u3042\u308b\u306e\u3067\u3001\u9055\u3046\u578b\u306e\u3082\u306e\u3092\u5165\u308c\u308b\u3068\u30a8\u30e9\u30fc\u304c\u51fa\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br>URL\u306f http:\/\/127.0.0.1:8000\/post\/test \u3092\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/8c7fcdc2377a12cb0a951c679459ca2b87fb9fa7\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f65633564626266392d666236642d613863312d373562382d6263366462373838303161652e706e67\" alt=\"\"><\/p>\n<p>\u30b5\u30fc\u30d0\u5074\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3092Python(Flask)\u3067\u8a18\u8ff0\u3059\u308b\u3053\u3068\u3067\u3001\u52d5\u7684\u306a\u51e6\u7406\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<br>\u306a\u304a\u3001\u300c\u52d5\u7684\u306a\u52d5\u304d\u300d\u3068\u3044\u3046\u8868\u73fe\u306f\u3088\u304f\u805e\u304d\u307e\u3059\u304c\u3001\u5bfe\u7167\u7684\u306a\u3082\u306e\u3068\u3057\u3066\u3001\u300c\u9759\u7684\u306a\u52d5\u304d\u300d\u3068\u3044\u3046\u8868\u73fe\u304c\u3042\u308a\u307e\u3059\u3002<br>\u4f8b\u3048\u3070html\u30d5\u30a1\u30a4\u30eb(index.html\u7b49)\u306f\u9759\u7684\u306a\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u306e\u3067\u3001\u8a18\u8ff0\u3055\u308c\u305f\u3053\u3068\u304c\u8868\u793a\u3055\u308c\u308b\u3060\u3051\u3067\u3001\u52d5\u7684\u306a\u52d5\u304d\u306f\u3057\u307e\u305b\u3093\u3002<br>\u3053\u3061\u3089\u306b\u4f55\u304b\u3057\u3089\u306e\u5024\u3092\u3001\u30b5\u30fc\u30d0\u30fc\u5074\u304b\u3089\u51fa\u529b\u3055\u305b\u305f\u3044\u3068\u304d\u306b\u52d5\u7684\u306a\u52d5\u304d\u3092\u3055\u305b\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><\/p>\n<h2 class=\"wp-block-heading\" id=\"i-3\">\u3010\u7121\u6599\u52d5\u753b\uff1a<strong>\u500d\u901f\u3067\u5b66\u3076\uff01\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u52c9\u5f37\u6cd5\uff08\u77ed\u7e2e\u7248\uff09\u3011<\/strong><\/h2>\n<p> <\/p>\n<p>\u751f\u6210AI\u3092\u6d3b\u7528\u3057\u3066\u52b9\u7387\u7684\u306b\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u5b66\u3076\u65b9\u6cd5\u3092\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\u3002\u751f\u6210AI\u306e\u57fa\u672c\u7684\u306a\u4ed5\u7d44\u307f\u3084\u52b9\u679c\u7684\u306a\u6d3b\u7528\u6cd5\u3001\u6ce8\u610f\u70b9\u306b\u3064\u3044\u3066\u3082\u8a73\u3057\u304f\u8aac\u660e\u3002\u52c9\u5f37\u6cd5\u3068\u3068\u3082\u306b\u751f\u6210AI\u305d\u306e\u3082\u306e\u306b\u3064\u3044\u3066\u3082\u5b66\u3079\u308b\u5185\u5bb9\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002\u305c\u3072\u3054\u89a7\u304f\u3060\u3055\u3044\uff01\u3000<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/player.vimeo.com\/video\/1069835048?h=e43b17d6de&amp;dnt=1&amp;app_id=122963\" width=\"880\" height=\"495\" frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media\"><\/iframe><\/p>\n<p><\/p>\n<p><strong>\u5168\u7de8\u306f\u3001AI Academy\u516c\u5f0fLINE\u3067\u914d\u4fe1\u4e2d\u3067\u3059\u3002<\/strong><\/p>\n<p> <\/p>\n<figure class=\"wp-block-image size-full is-resized\"><a href=\"https:\/\/lin.ee\/3E4GzWk\" target=\"_blank\" rel=\"noopener nofollow\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-6799\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom.png\" alt=\"\" width=\"155\" height=\"88\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom.png 910w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom-300x170.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom-768x436.png 768w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/LINE_Buttom-520x300.png 520w\" sizes=\"auto, (max-width: 155px) 100vw, 155px\"><\/a><\/figure>\n<p><\/p>\n\n<h2 id=\"i-4\">render_template\u306b\u3088\u308b\u8aad\u307f\u8fbc\u307f<\/h2>\n<p>Flask\u3067\u306f\u3001<strong>render_template\u95a2\u6570\u3092\u4f7f\u3046\u65b9\u6cd5\u3067\u3082\u3001html\u30d5\u30a1\u30a4\u30eb\u3092\u8868\u793a\u3055\u305b\u3001html\u30d5\u30a1\u30a4\u30eb\u306b\u7c21\u5358\u306b\u5024\u3092\u5165\u308c\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/strong><br>render_template\u3092\u4f7f\u3046\u5834\u5408\u306b\u306f\u3001import\u306b\u3088\u308b\u8a18\u8ff0\u3068\u3001templates\u30d5\u30a9\u30eb\u30c0\u3092\u65b0\u305f\u306b\u4f5c\u6210\u3057\u305d\u3053\u306bhtml\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304d\u307e\u3059\u3002<br><em>render_template\u3092\u7528\u3044\u308b\u969b\u306b\u306f\u3001templates\u30d5\u30a9\u30eb\u30c0\u3092\u4f5c\u6210\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u3001\u4f5c\u6210\u3057\u3066\u3044\u306a\u3044\u3068html\u30d5\u30a1\u30a4\u30eb\u3092\u8aad\u307f\u8fbc\u3080\u3053\u3068\u304c\u51fa\u6765\u307e\u305b\u3093\u306e\u3067\u3054\u6ce8\u610f\u304f\u3060\u3055\u3044\u3002<\/em><\/p>\n<p>\u307e\u305a\u306f\u3001\u968e\u5c64\u3092\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f5c\u3063\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>- app.py(flask\u3067\u30b5\u30fc\u30d0\u30fc\u51e6\u7406\u3092\u884c\u3046python\u30d5\u30a1\u30a4\u30eb)\n- templates(HTML\u30d5\u30a1\u30a4\u30eb\u304c\u6ca2\u5c71\u5165\u308b\u30d5\u30a9\u30eb\u30c0)\n\u3000\u3000\u3000 \u2514 index.html\n    \u2514form.html\n<\/code><\/pre>\n<p>app.py\u3092\u4ee5\u4e0b\u306e\u5185\u5bb9\u3092\u8a18\u8ff0\u3057\u3001\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>from flask import Flask,render_template\n\napp = Flask(__name__)\n\n@app.route('\/')\ndef index():\n    return render_template('index.html', message=\"\u82b1\u5b50\u3055\u3093\")\n\nif __name__ == \"__main__\":\n    app.run(port=8000, debug=True)\n<\/code><\/pre>\n<p>\u203bWindows OS\u3092\u3054\u5229\u7528\u306e\u65b9\u3067\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u304c\u30a8\u30e9\u30fc\u3068\u306a\u308b\u5834\u5408\u3001<br>port\u756a\u53f7\u306e\u90e8\u5206\u3001debug\u306e\u90e8\u5206\u3092\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>app.run(port=12345, debug=False)\n<\/code><\/pre>\n<p>\u307e\u305f\u3001Jupyter Notebook\u3092\u7528\u3044\u3066Flask\u3092\u52d5\u4f5c\u3055\u305b\u308b\u5834\u5408\u3001<br>\u5408\u308f\u305b\u3066\u3001<strong>if <strong>name<\/strong> == \u201c<strong>main<\/strong>\u201c:<\/strong>\u306e\u90e8\u5206\u3092\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u6b21\u306e\u3088\u3046\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>from flask import Flask,render_template\n\napp = Flask(__name__)\n\n@app.route('\/')\ndef index():\n    return render_template('index.html', message=\"\u82b1\u5b50\u3055\u3093\")\n\napp.run(port=12345, debug=Falase)\n<\/code><\/pre>\n<p>\u7d9a\u3044\u3066\u3001templates\u30d5\u30a9\u30eb\u30c0\u5185\u306bindex.html\u3092\u4f5c\u6210\u3057\u3066\u4ee5\u4e0b\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u3057\u3001\u4fdd\u5b58\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n  &lt;title&gt;flask\u7df4\u7fd2&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;h1&gt;\u3053\u3093\u306b\u3061\u306f{{ message }}&lt;\/h1&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>\u3067\u306f\u3001\u518d\u5ea6\u30d5\u30a1\u30a4\u30eb\u306e\u69cb\u6210\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<br>\u4e0a\u8a18\u3067\u4f5c\u6210\u3057\u305f\u30b3\u30fc\u30c9\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3067\u3057\u3087\u3046\u304b?<\/p>\n<pre><code class=\"shell\">- app.py(flask\u3067\u30b5\u30fc\u30d0\u30fc\u51e6\u7406\u3092\u884c\u3046python\u30d5\u30a1\u30a4\u30eb)\n- templates(HTML\u30d5\u30a1\u30a4\u30eb\u304c\u6ca2\u5c71\u5165\u308b\u30d5\u30a9\u30eb\u30c0)\n\u3000\u3000\u3000 \u2514 index.html\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u69cb\u6210\u3067\u3042\u308c\u3070\u3001app.py\u3092\u8d77\u52d5\u3057\u52d5\u4f5c\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>Mac OS\u306e\u65b9\u306f\u3001\u30bf\u30fc\u30df\u30ca\u30eb\u3092\u8d77\u52d5\u3057\u3001Windows\u306e\u65b9\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8(cmd)\u3092\u8d77\u52d5\u3057\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>python app.py\n<\/code><\/pre>\n<p>\u305d\u306e\u5f8c\u3001\u30bf\u30fc\u30df\u30ca\u30eb\uff08\u3082\u3057\u304f\u306f\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\uff09\u306e\u65b9\u306b\u3001\u6b21\u306e\u3088\u3046\u306a\u30ed\u30b0\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u308c\u3070\u3001OK\u3067\u3059\u3002<\/p>\n<pre><code class=\"shell\"> * Serving Flask app \"app\" (lazy loading)\n * Environment: production\n   WARNING: Do not use the development server in a production environment.\n   Use a production WSGI server instead.\n * Debug mode: on\n * Running on http:\/\/127.0.0.1:8000\/ (Press CTRL+C to quit)\n * Restarting with stat\n * Debugger is active!\n * Debugger PIN: 284-231-902\n<\/code><\/pre>\n<p><a href=\"http:\/\/127.0.0.1:8000\/\" rel=\"nofollow\">http:\/\/127.0.0.1:8000\/<\/a>\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u307f\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u51fa\u529b\u304c\u3055\u308c\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/8b241c2d32436b3219918e67c738edfc2ef41bbe\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f38323638383337362d306466302d333362642d383838342d3261353437663565656462392e706e67\" alt=\"\"><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u7c21\u5358\u306b\u9759\u7684\u30d5\u30a1\u30a4\u30eb(html\u30d5\u30a1\u30a4\u30eb\u3067\u4f5c\u6210\u3057\u305f\u30da\u30fc\u30b8\u306e\u3053\u3068\uff09\u306b\u30b5\u30fc\u30d0\u30fc\u5074\u304b\u3089\u5024\u3092\u51fa\u529b\u3059\u308b\u3053\u3068\u306b\u6210\u529f\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n\n<p><\/p>\n\n\n<h2 id=\"i-5\">html\u3067\u5165\u529b\u3055\u308c\u305f\u30c7\u30fc\u30bf\u3092python\u3067\u6271\u3046<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30ed\u30b0\u30a4\u30f3\u753b\u9762\u3092\u898b\u305f\u3053\u3068\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\uff1f<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/5df0dc101e3ccd4405f636c982285fac812734bf\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f38646138636437652d646262372d633161382d363461392d3333306564623662376537372e706e67\" alt=\"\"><\/p>\n<p>\u3053\u3046\u3044\u3063\u305f\u30ed\u30b0\u30a4\u30f3\u6a5f\u80fd\u3067\u306f\u3001LoginID(\u3082\u3057\u304f\u306f\u30e6\u30fc\u30b6\u30fc\u540d\u306a\u3069)\u3068Password\u306e\u6b63\u3057\u3044\u5024\u3092\u5165\u529b\u3059\u308b\u3068\u3001\u6b21\u306e\u753b\u9762\u306b\u9077\u79fb\u3057\u3001\u6b63\u3057\u304f\u306a\u3044\u5165\u529b\u3092\u3059\u308b\u3068\u3001\u300c\u6b63\u3057\u304f\u5165\u529b\u3092\u3057\u3066\u304f\u3060\u3055\u3044\u300d\u306a\u3069\u3068\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br>\u5b9f\u73fe\u65b9\u6cd5\u3068\u3057\u3066\u306f\u3001HTML\u4e0a\u306b\u5165\u529b\u3055\u308c\u305f\u5024\u3092\u30b5\u30fc\u30d0\u30fc\u30b5\u30a4\u30c9\u306bPOST\u3067\u9001\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u305d\u306e\u5024\u304c\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u3082\u306e\u3068\u6b63\u3057\u3044\u304b\u3069\u3046\u304b\u53c2\u7167\u3059\u308b\u3053\u3068\u306b\u3088\u3063\u3066\u3001\u6a5f\u80fd\u306f\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<br><strong>POST\u3068\u306f\u3001HTTP\u901a\u4fe1\u306e\u3001\u30c7\u30fc\u30bf\u3092\u9001\u308b\u969b\u306e\u624b\u6bb5\u306e\u4e00\u3064<\/strong>\u3067\u3059\u3002<br>HTTP\u901a\u4fe1\u306b\u3064\u3044\u3066\u306f\u6df1\u304f\u306f\u3053\u3053\u3067\u306f\u89e6\u308c\u307e\u305b\u3093\u306e\u3067\u3001\u8a73\u3057\u304f\u306f\u3001<a href=\"https:\/\/viral-community.com\/other-it\/http-1873\/\" rel=\"nofollow noopener\" target=\"_blank\">\u3053\u3061\u3089<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u3067\u306f\u3001\u3069\u306e\u3088\u3046\u306b\u30c7\u30fc\u30bf\u3092flask\u5074\u306b\u9001\u308c\u3070\u826f\u3044\u306e\u3067\u3057\u3087\u3046\u304b\uff1f<br>\u30c7\u30fc\u30bf\u3092\u9001\u308b\u969b\u306b\u306f\u3001form\u30bf\u30b0\u306e\u4e2d\u306binput\u30bf\u30b0\u3092\u5165\u308c\u308c\u3070OK\u3067\u3059\u3002\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n  &lt;title&gt;form\u7df4\u7fd2&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;form method=\"POST\"&gt;\n    &lt;input type=\"text\" name=\"id\" placeholder=\"userID\"&gt;\n    &lt;input type=\"password\" name=\"pwd\" placeholder=\"Password\"&gt;\n    &lt;input type=\"submit\" value=\"\u9001\u4fe1\"&gt;\n  &lt;\/form&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;\n<\/code><\/pre>\n<p>\u3053\u306e\u30d5\u30a1\u30a4\u30eb\u3092form.html\u306a\u3069\u3067\u51fa\u529b\u3092\u3055\u305b\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/4f8fd38fc7231cc4d484538665bb71145a247336\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f65386139643934332d616631612d623638392d663435662d3363636431633466323566332e706e67\" alt=\"\"><\/p>\n<p>\u6b21\u306b\u3001\u3053\u3061\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u53d7\u3051\u53d6\u3063\u305f\u30c7\u30fc\u30bf\u3092python\u3067\u6271\u3048\u308b\u3088\u3046\u306b\u3057\u307e\u3057\u3087\u3046\u3002<br>flask\u3067\u4f5c\u308b\u306e\u3067\u3001<strong>templates\u30d5\u30a9\u30eb\u30c0<\/strong>\u306b\u4eca\u4f5c\u6210\u3057\u305fform.html\u3092\u5165\u308c\u3066\u304f\u3060\u3055\u3044\u3002<br>\u3055\u3089\u306b\u3001\u305d\u306erender_templates\u306e\u4e0a\u306e\u968e\u5c64\u306blogin.py\u3068\u3044\u3046\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u308a\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u307e\u305f\u73fe\u72b6\u306e\u69cb\u6210\u306f\u6b21\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre><code class=\"shell\">- app.py(flask\u3067\u30b5\u30fc\u30d0\u30fc\u51e6\u7406\u3092\u884c\u3046python\u30d5\u30a1\u30a4\u30eb)\n- login.py(\u4eca\u4f5c\u6210\u3057\u305flogin.py)\n- templates(HTML\u30d5\u30a1\u30a4\u30eb\u304c\u6ca2\u5c71\u5165\u308b\u30d5\u30a9\u30eb\u30c0)\n\u3000\u3000\u3000 \u2514 index.html\n<\/code><\/pre>\n<p>app.py\u306f\u5148\u307b\u3069\u4f5c\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u306e\u3067\u3001\u3053\u306e\u5f8c\u306f\u4f7f\u7528\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>\u6b21\u306e\u30b3\u30fc\u30c9\u306f\u3053\u308c\u304b\u3089\u4f5c\u6210\u3059\u308blogin.py\u306e\u4e2d\u8eab\u3067\u3059\u3002<\/p>\n<pre><code>from flask import Flask, request,render_template\n\napp = Flask(__name__)\n\n# login\u51e6\u7406\u3067\u3059\n@app.route('\/', methods=['GET', 'POST'])\ndef form():\n    # \uff12\u56de\u76ee\u4ee5\u964d\u30c7\u30fc\u30bf\u304c\u9001\u3089\u308c\u3066\u304d\u305f\u6642\u306e\u51e6\u7406\u3067\u3059\n    if request.method == 'POST':\n        print(\"POST\u3055\u308c\u305fID\u306f\uff1f\" + str(request.form['id']))\n        print(\"POST\u3055\u308c\u305fPASSWORD\u306f\uff1f\" + str(request.form['pwd']))\n        return render_template('form.html')\n    # \uff11\u56de\u76ee\u306e\u30c7\u30fc\u30bf\u304c\u4f55\u3082\u9001\u3089\u308c\u3066\u3053\u306a\u304b\u3063\u305f\u6642\u306e\u51e6\u7406\u3067\u3059\u3002\n    else:\n        return render_template('form.html')\n\n# \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u52d5\u304b\u3059\u305f\u3081\u306e\u304a\u307e\u3058\u306a\u3044\nif __name__ == \"__main__\":\n    app.run(port = 8000, debug=True)\n<\/code><\/pre>\n<p>\u3053\u3053\u3067\u3001\u3053\u306elogin.py\u3092\u5148\u307b\u3069\u3068\u540c\u3058\u65b9\u6cd5\u3067\u5b9f\u884c\u3057\u3001\u8d77\u52d5\u3057\u3066\u307e\u3057\u3087\u3046\u3002<br>\u305d\u306e\u5f8c\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u753b\u9762<a href=\"http:\/\/127.0.0.1:8000\/\" rel=\"nofollow\">http:\/\/127.0.0.1:8000\/<\/a>\u3067\u306f\u3001\u6b21\u306e\u3088\u3046\u306a\u8868\u793a\u306b\u306a\u308a\u307e\u3059\u3002<br>\u305d\u306e\u753b\u9762\u306e\u30c6\u30ad\u30b9\u30c8\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u4e2d\u306b\u3001\u4f55\u304b\u3057\u3089\u306e\u5024\u3092\u5165\u308c\u3066\u9001\u4fe1\u30dc\u30bf\u30f3\u3092\u62bc\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/f235387d739cefc004383e956f93a3d9fdf7a849\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f65363930383237332d336262302d343536392d333132302d6163626461666135613034372e706e67\" alt=\"\"><\/p>\n<p>\u30bf\u30fc\u30df\u30ca\u30eb\u3084\u30b3\u30de\u30f3\u30c9\u30d7\u30ed\u30f3\u30d7\u30c8\u4e0a\u3067\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u51fa\u529b\u304c\u3055\u308c\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/cad48be35f8e376469124a9ff7e70c3c33defd0d\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3137313731352f61613763343333302d353634642d396639662d366561652d3635313839363635343662352e706e67\" alt=\"\"><\/p>\n<p>\u3053\u308c\u3067\u3001HTML\u306b\u5165\u529b\u3055\u308c\u305f\u5024\u3082python\u3067\u6271\u3048\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n\n<h2 id=\"i-6\">Web\u30b5\u30fc\u30d3\u30b9\u306e\u69cb\u6210\u3068API\u30b5\u30fc\u30d0\u30fc<\/h2>\n<p>\u8fd1\u5e74Web\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u308b\u4e0a\u3067\u3001\u5e7e\u3064\u304b\u7570\u306a\u308b\u5f79\u5272\u3092\u6301\u3063\u305f\u30b5\u30fc\u30d0\u69cb\u6210\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<br>\u4f8b\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u7ba1\u7406\u3059\u308bDB\u30b5\u30fc\u30d0\u3084\u3001API\u30b5\u30fc\u30d0\u30fc\u3001\u307e\u305f\u306fWeb\u30b5\u30fc\u30d0\u30fc\u3084\u753b\u50cf\u30b5\u30fc\u30d0\u306a\u3069\u3067\u69cb\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br>API\u30b5\u30fc\u30d0\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089HTTP\u3082\u3057\u304f\u306fHTTPS\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u3068\u308a\u3001\u305d\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u5f93\u3063\u3066\u51e6\u7406\u3092\u884c\u3044\u3001DB\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u60c5\u5831\u3092\u53d7\u3051\u53d6\u308a\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u8fd4\u3057\u307e\u3059\u3002<\/p>\n<h2 id=\"i-7\">Web API (JSON API)<\/h2>\n<p>\u3053\u3053\u3067\u306f\u3001Flask\u3092\u4f7f\u3063\u3066Web API\u3092\u4f5c\u3063\u3066\u307f\u307e\u3059\u3002<br>\u307e\u305a\u306f\u30a4\u30e1\u30fc\u30b8\u3092\u3057\u3066\u9802\u304d\u305f\u3044\u306e\u3067\u3001\u7c21\u5358\u306a\u3082\u306e\u3092\u4f5c\u3063\u3066\u307f\u307e\u3059\u3002<br>\u30d5\u30a1\u30a4\u30eb\u540d\u306f\u4efb\u610f\u3067\u69cb\u3044\u307e\u305b\u3093\u3002\uff08login_api.py\u306a\u3069\u597d\u304d\u306a\u540d\u524d\u3067\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\uff09<\/p>\n<pre><code>from flask import Flask\nimport flask\n\napp = Flask(__name__, static_folder='.', static_url_path='')\n\n@app.route('\/')\ndef index():\n    return app.send_static_file('index.html')\n\n@app.route(\"\/mypage\")\ndef mypage():\n    # login = False\n    login = True\n    if login is False:\n        return flask.jsonify({\n            \"code\" : 400,\n            \"msg\"  : \"Bad Request\"\n        })\n\n    user_data = {\"user_name\": \"ai_academy\"}\n    return flask.jsonify({\n        \"code\": 200,\n        \"msg\" : \"OK\",\n        \"result\": user_data\n    })\n\n\nif __name__ == \"__main__\":\n    app.run(port=8000, debug=True)\n<\/code><\/pre>\n<p>\u4e0a\u8a18\u30b3\u30fc\u30c9\u3092\u8a18\u8ff0\u51fa\u6765\u307e\u3057\u305f\u3089\u3001\u4ee5\u4e0b\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><code>python login_api.py\n<\/code><\/pre>\n<p>\u5909\u6570login\u306e\u521d\u671f\u72b6\u614b\u304cTrue\u3067\u3059\u306e\u3067\u3001\u3053\u3053\u3067\u306f\u65e2\u306b\u30ed\u30b0\u30a4\u30f3\u3092\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u610f\u5473\u3057\u3066\u3044\u307e\u3059\u3002<br>\u3067\u3059\u306e\u3067\u3001\u30ed\u30b0\u30a4\u30f3\u6210\u529f\u3057\u305f\u3053\u3068\u3092\u610f\u5473\u3059\u308bjson\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/9f2a0f1d849cd0bdb3869ad46ea5859813a67752\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3130353838372f61356434386538652d356631332d666138632d613530652d6137393139626563346162312e706e67\" alt=\"\"><\/p>\n<p>\u3067\u306f\u3001\u5909\u6570login\u306e\u5024\u3092False\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/camo.qiitausercontent.com\/8713bc564aea77dd5c7c22a4766f0f0036e93e7b\/68747470733a2f2f71696974612d696d6167652d73746f72652e73332e616d617a6f6e6177732e636f6d2f302f3130353838372f64323763333462652d383935632d326261622d353235642d3339393330663935316438322e706e67\" alt=\"\"><\/p>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001JSON\u306e\u51fa\u529b\u304c\u5909\u308f\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<br>\u4e0a\u8a18\u30d7\u30ed\u30b0\u30e9\u30e0\u5185\u3067flask.jsonify\u3068\u3044\u3046\u306e\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u304c\u3001<br>\u3053\u308c\u306fPython\u306e\u8f9e\u66f8\u578b\u3092JSON\u306e\u6587\u5b57\u5217\u306b\u5909\u63db\u3057\u3001\u5fc5\u8981\u306a\u30ec\u30b9\u30dd\u30f3\u30b9\u30d8\u30c3\u30c0\u30fc\u7b49\u3082\u81ea\u52d5\u3067\u8a2d\u5b9a\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<h2 id=\"i-8\">\u307e\u3068\u3081<\/h2>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Flask\u3068\u306f\u4f55\u304b\uff1f\u307e\u305fFlask\u306e\u57fa\u790e\u3092\u5b66\u3073\u3001HTML\u306b\u30c7\u30fc\u30bf\u3092\u3069\u306e\u3088\u3046\u306b\u6e21\u3059\u304b\u3001\u3069\u306e\u3088\u3046\u306bHTML\u3067\u5165\u529b\u3055\u308c\u305f\u5024\u3092\u6271\u3046\u304b\u3092\u5b66\u3073\u307e\u3057\u305f\u3002<br>\u672c\u8a18\u4e8b\u3067\u5b66\u3093\u3060Flask\u3068\u5408\u308f\u305b\u3066\u3001\u3053\u306e\u8a18\u4e8b\u3067\u306f\u89e3\u8aac\u3057\u3066\u304a\u308a\u307e\u305b\u3093\u304c\u3001HTML\/CSS\/JavaScript\u3092\u5408\u308f\u305b\u308b\u3053\u3068\u3067Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u3053\u3068\u304c\u53ef\u80fd\u3067\u3059\u3002<br>Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u5236\u4f5c\u3092\u3057\u3066\u307f\u305f\u65b9\u306f\u3001\u662f\u975eWeb\u958b\u767a\u306b\u30c1\u30e3\u30ec\u30f3\u30b8\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n<h1 class=\"wp-block-heading\" id=\"i-9\">Web\u30a2\u30d7\u30ea\u306e\u958b\u767a\u3092\u3055\u3089\u306b\u6df1\u3081\u305f\u3044\u65b9\u3078<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"i-10\">\u2728AI\u4eba\u6750\u30b3\u30fc\u30b9 \u53d7\u8b1b\u304a\u7533\u8fbc\u307f\u53d7\u4ed8\u4e2d\uff01<\/h2>\n\n\n\n<p><a href=\"https:\/\/aiacademy.jp\/bootcamp\">AI Academy Bootcamp<\/a> \u3067\u306fAI\u30fb\u30c7\u30fc\u30bf\u30b5\u30a4\u30a8\u30f3\u30b9\u3001\u6a5f\u68b0\u5b66\u7fd2\u3001Web\u30a2\u30d7\u30ea\u958b\u767a\u306e\u5b9f\u8df5\u529b\u3092\u9ad8\u3081\u308b\u5168\uff16\u30b3\u30fc\u30b9\u7d0450\u6642\u9593\u4ee5\u4e0a\u306e\u52d5\u753b\u304c\u898b\u653e\u984c\uff01AI\u306e\u5b66\u7fd2\u306b\u5fc5\u9808\u306ePython\u306e\u5b66\u7fd2\u304b\u3089\u59cb\u307e\u308a\u3001IT\u30ea\u30c6\u30e9\u30b7\u30fc\u3001LLM\u5b66\u7fd2\u306a\u3069\u3001\u76ee\u7684\u306b\u5fdc\u3058\u305f\u5e45\u5e83\u3044\u5206\u91ce\u3092\u30ab\u30d0\u30fc\u3057\u3066\u3044\u307e\u3059\u3002LINE\u516c\u5f0f\u3067\u306f\u3001\u304a\u5f97\u306a\u5272\u5f15\u30af\u30fc\u30dd\u30f3\u3082\u30d7\u30ec\u30bc\u30f3\u30c8\u3057\u3066\u3044\u307e\u3059\uff01<\/p>\n\n\n\n<p><strong>\u5358\u72ec\u3067\u5b66\u3076\u3088\u308a\u3001\u5168\u30b3\u30fc\u30b9\u3092\u4e00\u6c17\u306b\u5b66\u3076\u3053\u3068\u3067\u5f97\u3089\u308c\u308b\u300c\u5b66\u7fd2\u30b7\u30ca\u30b8\u30fc\u52b9\u679c\u300d\u304c\u7279\u9577\u3002<\/strong><br>\u57fa\u790e\u304b\u3089\u5fdc\u7528\u307e\u3067\u3001\u30c7\u30fc\u30bf\u5206\u6790\u3068AI\u958b\u767a\u306e\u30b9\u30ad\u30eb\u3092\u52b9\u7387\u3088\u304f\u8eab\u306b\u3064\u3051\u3089\u308c\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/lin.ee\/3E4GzWk\" target=\"_blank\" rel=\" noreferrer noopener nofollow\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"349\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-1024x349.png\" alt=\"\" class=\"wp-image-7228\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-1024x349.png 1024w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-300x102.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-768x261.png 768w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-1536x523.png 1536w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-2048x697.png 2048w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2019\/11\/\u30af\u30fc\u30dd\u30f3Media06-940x320.png 940w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\"><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h1 class=\"wp-block-heading\" id=\"i-11\"><a href=\"https:\/\/aiacademy.jp\/media\/?p=117\">\u30aa\u30b9\u30b9\u30e1\u8a18\u4e8b<\/a><\/h1>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/aiacademy.jp\/media\/?p=117\"><img loading=\"lazy\" decoding=\"async\" width=\"920\" height=\"473\" src=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-15.42.46.png\" alt=\"\" class=\"wp-image-2075\" srcset=\"https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-15.42.46.png 920w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-15.42.46-300x154.png 300w, https:\/\/aiacademy.jp\/media\/wp-content\/uploads\/2022\/02\/\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8-2022-02-14-15.42.46-768x395.png 768w\" sizes=\"auto, (max-width: 920px) 100vw, 920px\"><\/a><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Flask\u3068\u306f Flask\uff08\u30d5\u30e9\u30b9\u30b3\/\u30d5\u30e9\u30b9\u30af\uff09\u3068\u306f\u3001Python\u306eWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3001\u5c0f\u898f\u6a21\u5411\u3051\u306e\u7c21\u5358\u306aWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u308b\u306e\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002Web\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3068\u306f\u3001\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3084\u30a6\u30a7\u30d6\u30a2 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":6876,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[85],"tags":[],"class_list":{"0":"post-57","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"_links":{"self":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/57","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=57"}],"version-history":[{"count":66,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions"}],"predecessor-version":[{"id":7308,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/posts\/57\/revisions\/7308"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=\/wp\/v2\/media\/6876"}],"wp:attachment":[{"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=57"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=57"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aiacademy.jp\/media\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=57"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}