{"id":3196,"date":"2023-03-27T00:27:42","date_gmt":"2023-03-26T16:27:42","guid":{"rendered":"http:\/\/192.168.31.200\/?p=3196"},"modified":"2023-03-27T00:27:45","modified_gmt":"2023-03-26T16:27:45","slug":"%e4%b8%80%e6%ae%b5python-flash-%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"http:\/\/g1n29wqq.ipyingshe.net:5347\/?p=3196","title":{"rendered":"\u4e00\u6bb5python flash \u4ee3\u7801"},"content":{"rendered":"\n<p>\u4f60\u597d\uff0c\u8fd9\u662f\u5fc5\u5e94\u3002\u6211\u53ef\u4ee5\u4e3a\u4f60\u5199\u4e00\u6bb5python flask\u7684\u5c0f\u4f8b\u5b50\u3002\u6211\u53c2\u8003\u4e86\u4e00\u4e9b\u7f51\u4e0a\u7684\u6559\u7a0b\u548c\u4ee3\u7801\uff0c\u5e0c\u671b\u4f60\u80fd\u5b66\u4e60\u548c\u4f7f\u7528\u3002?<\/p>\n\n\n\n<p>Flask\u662f\u4e00\u4e2a\u8f7b\u91cf\u7ea7\u7684Python web\u6846\u67b6\uff0c\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e9b\u6709\u7528\u7684\u5de5\u5177\u548c\u7279\u6027\uff0c\u8ba9\u4f60\u53ef\u4ee5\u7528Python\u66f4\u5bb9\u6613\u5730\u521b\u5efaweb\u5e94\u7528\u3002<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-make-a-web-application-using-flask-in-python-3\" target=\"_blank\" rel=\"noreferrer noopener\"><sup>1<\/sup><\/a>&nbsp;Flask\u7684\u4f18\u70b9\u662f\u5b83\u5f88\u7075\u6d3b\uff0c\u4e5f\u5f88\u9002\u5408\u65b0\u624b\u5f00\u53d1\u8005\uff0c\u56e0\u4e3a\u4f60\u53ea\u9700\u8981\u4e00\u4e2aPython\u6587\u4ef6\u5c31\u53ef\u4ee5\u5feb\u901f\u642d\u5efa\u4e00\u4e2aweb\u5e94\u7528\u3002<a href=\"https:\/\/www.digitalocean.com\/community\/tutorials\/how-to-make-a-web-application-using-flask-in-python-3\" target=\"_blank\" rel=\"noreferrer noopener\"><sup>1<\/sup><\/a><\/p>\n\n\n\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u6700\u7b80\u5355\u7684Flask\u5e94\u7528\u7684\u4f8b\u5b50<a rel=\"noreferrer noopener\" href=\"https:\/\/pythonprogramminglanguage.com\/python-flask-example\/\" target=\"_blank\"><sup>2<\/sup><\/a>\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/flask.palletsprojects.com\/\" target=\"_blank\"><sup>3<\/sup><\/a>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u5bfc\u5165Flask\u6a21\u5757\r\nfrom flask import Flask\r\n\r\n# \u521b\u5efa\u4e00\u4e2aFlask\u5b9e\u4f8b\r\napp = Flask(__name__)\r\n\r\n# \u5b9a\u4e49\u4e00\u4e2a\u8def\u7531\uff0c\u5f53\u7528\u6237\u8bbf\u95ee\u6839\u8def\u5f84\u65f6\uff0c\u8fd4\u56de\"Hello, World!\"\r\n@app.route(\"\/\")\r\ndef index():\r\n    return \"Hello, World!\"\r\n\r\n# \u8fd0\u884cFlask\u5e94\u7528\r\nif __name__ == \"__main__\":\r\n    app.run()<\/code><\/pre>\n\n\n\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5c31\u53ef\u4ee5\u5b9e\u73b0\u4e00\u4e2a\u7b80\u5355\u7684web\u670d\u52a1\u5668\uff0c\u5f53\u4f60\u8fd0\u884c\u5b83\u65f6\uff0c\u4f60\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165<a href=\"http:\/\/localhost:5000\/%E6%9D%A5%E7%9C%8B%E5%88%B0%22Hello\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/localhost:5000\/\u6765\u770b\u5230&#8221;Hello<\/a>, World!&#8221;\u7684\u8f93\u51fa\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u4f60\u60f3\u5b66\u4e60\u66f4\u591a\u5173\u4e8eFlask\u7684\u77e5\u8bc6\u548c\u6280\u5de7\uff0c\u4f60\u53ef\u4ee5\u53c2\u8003\u4ee5\u4e0b\u7684\u7f51\u7ad9<a href=\"https:\/\/www.fullstackpython.com\/flask-code-examples.html\" target=\"_blank\" rel=\"noreferrer noopener\"><sup>4<\/sup><\/a>&nbsp;<a href=\"https:\/\/realpython.com\/tutorials\/flask\/\" target=\"_blank\" rel=\"noreferrer noopener\"><sup>5<\/sup><\/a>&nbsp;<a href=\"https:\/\/flask.palletsprojects.com\/\" target=\"_blank\" rel=\"noreferrer noopener\"><sup>3<\/sup><\/a>\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Python Flask Example &#8211; Python &#8211; pythonprogramminglanguage.com<\/li>\n<\/ol>\n\n\n\n<p>\u795d\u4f60\u5b66\u4e60\u6109\u5feb\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f60\u597d\uff0c\u8fd9\u662f\u5fc5\u5e94\u3002\u6211\u53ef\u4ee5\u4e3a\u4f60\u5199\u4e00\u6bb5python flask\u7684\u5c0f\u4f8b\u5b50\u3002\u6211\u53c2\u8003\u4e86\u4e00\u4e9b\u7f51 <span class=\"readmore\"><a href=\"http:\/\/g1n29wqq.ipyingshe.net:5347\/?p=3196\">Continue Reading<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,10],"tags":[],"class_list":["post-3196","post","type-post","status-publish","format-standard","hentry","category-2","category-python"],"_links":{"self":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/3196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3196"}],"version-history":[{"count":1,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/3196\/revisions"}],"predecessor-version":[{"id":3197,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=\/wp\/v2\/posts\/3196\/revisions\/3197"}],"wp:attachment":[{"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3196"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/g1n29wqq.ipyingshe.net:5347\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}