{"id":1208,"date":"2024-11-26T19:14:33","date_gmt":"2024-11-26T11:14:33","guid":{"rendered":"https:\/\/gemmartdesign.com\/?p=1208"},"modified":"2024-11-30T01:50:50","modified_gmt":"2024-11-29T17:50:50","slug":"python-post17","status":"publish","type":"post","link":"https:\/\/gemmartdesign.com\/?p=1208","title":{"rendered":"Python\u554f\u984c\u7d00\u9304#17-\u7db2\u7ad9\u4e0a\u50b3\u5230Heroku\u7121\u6cd5\u6b63\u5e38\u904b\u4f5c"},"content":{"rendered":"\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-6f3c296329a310c4ec4b8858acb7fc91\" style=\"color:#ff8a65\">\u672c\u5468\u76ee\u6a19<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Flask \u7db2\u7ad9\u958b\u767c<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-d378f6d1ee3ff41f6cf438efcd397311\" style=\"color:#ff8a65\">\u4efb\u52d9<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u57fa\u790e\u74b0\u5883\u5efa\u7f6e<\/li>\n\n\n\n<li>Heroku \u96f2\u7aef\u4e3b\u6a5f\u6559\u5b78<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading has-text-color has-link-color wp-elements-4ff4e1ba3503f9246295601b9b47d959\" style=\"color:#ff8a65\">\u5c08\u6848\u7df4\u7fd2<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f38\u5165git commit -am &#8220;make it better&#8221;\u986f\u793a\u4ee5\u4e0b\u8cc7\u8a0a<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Author identity unknown\n\n*** Please tell me who you are.\n\nRun\n\n  git config --global user.email \"you@example.com\"\n  git config --global user.name \"Your Name\"\n\nto set your account's default identity.\nOmit --global to set the identity only in this repository.<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u7e7c\u7e8c\u8f38\u5165git push heroku main\u986f\u793a\u932f\u8aa4<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>error: src refspec main does not match any\nerror: failed to push some refs to 'https:\/\/git.heroku.com\/gemma-python.git'<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">ChatGPT\u986f\u793a\u4e0b\u5217\u539f\u56e0<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>main\u5206\u652f\u4e0d\u5b58\u5728 \u7db2\u8def\u6559\u5b78\u5f0fmaster<\/li>\n\n\n\n<li>\u6c92\u6709\u63d0\u4ea4\u4ee3\u78bc\u5230\u672c\u5730\u4efb\u4f55\u5206\u4e4b<\/li>\n\n\n\n<li>\u672a\u8a2d\u5b9a\u9060\u7aef\u5132\u5b58\u5eab\u6216\u5206\u4e4b<\/li>\n\n\n\n<li>Heroku\u5132\u5b58\u521d\u59cb\u5316\u554f\u984c<\/li>\n<\/ul>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6211\u7684\u89e3\u6c7a\u65b9\u6cd5<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">\u5148\u8b1b\u7d50\u8ad6: Heroku\u7db2\u7ad9\u5df2\u53d6\u6d88\u514d\u8cbb\uff0c\u53ef\u4ee5\u8f49\u79fb\u81f3Pythonanywhere<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6c92\u627e\u5230\u5982\u4f55\u4f7f\u7528VS Code\u904b\u884cPythonanywhere<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u514d\u8cbb\u7248\u7121\u6cd5\u81ea\u5df1\u5275\u8cc7\u6599\u593e\u548c\u6a94\u6848\uff0c\u53ea\u80fd\u6e2c\u8a66\u4e0a\u50b3Code\u5f8c\u7db2\u7ad9\u53ef\u4ee5\u6b63\u5e38\u904b\u4f5c<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17-1.jpg\" alt=\"\" class=\"wp-image-1280\" srcset=\"https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17-1.jpg 800w, https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17-1-300x169.jpg 300w, https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17-1-768x432.jpg 768w, https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17-1-585x329.jpg 585w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9a5f1: \u5148\u78ba\u8a8d\u8a2d\u5b9a\u6a94\u7121\u554f\u984c<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u6aa2\u67e5Procfile\u8f38\u5165\u932f\u5b57\uff0c\u66f4\u6b63\u5f8c\u91cd\u65b0\u8f38\u5165git commit -am &#8220;make it better&#8221;\u4f9d\u7136\u6709\u554f\u984c<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9a5f2: \u78ba\u8a8d\u5206\u652f\u540d\u7a31<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f38\u5165git branch\uff0c\u6c92\u6709\u986f\u793a\u4efb\u4f55\u6771\u897f\uff0c\u4ee3\u8868\u6c92\u6709\u8a2d\u5b9a\u5230\u5206\u652f\u540d\u7a31<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9a5f3: \u8a2d\u5b9a\u5206\u652f\u540d\u7a31<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f38\u5165git branch -M main<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9a5f4: \u78ba\u8a8d HEAD \u662f\u5426\u6307\u5411\u67d0\u500b\u5206\u652f<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f38\u5165cat .git\/HEAD \u78ba\u5b9a\u5230main<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ref: refs\/heads\/main<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u91cd\u8907\u8a2d\u5b9a\u6b65\u9a5f\u4f9d\u7136\u986f\u793a*** Please tell me who you are.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9a5f5: \u8a2d\u5b9a\u540d\u5b57<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>git config --global user.name \"Gemma\"\n&gt;&gt; git config --global user.email \"yabahong@gmail.com\"<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f38\u5165git config &#8211;global &#8211;list \u78ba\u8a8d\u5df2\u767b\u9304\u540d\u5b57\u8ddf\u4fe1\u7bb1<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>user.name=Gemma\nuser.email=yabahong@gmail.com<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u518d\u6b21\u5617\u8a66git commit -m &#8220;Your commit message&#8221;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6c92\u6709\u986f\u793a*** Please tell me who you are.<\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u6b65\u9a5f6: \u6e2c\u8a66git push heroku main<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u9019\u4e4b\u524d\u53ef\u4ee5\u5148\u6aa2\u67e5\u81ea\u5df1\u7684\u5206\u652f\u540d\u7a31git branch\u986f\u793a\u540d\u7a31\uff0c\u6211\u7684\u986f\u793amian<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u5f6d\u5f6d\u8001\u5e2b\u7e73\u5b78\u5f71\u7247\u70bamaster\uff0c\u6240\u4ee5\u4e5f\u53ef\u80fd\u662f\u5206\u652f\u540d\u7a31\u7684\u554f\u984c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&#91;main (root-commit) 0267e69] Your commit message\n 4 files changed, 57 insertions(+)\n create mode 100644 Procfile\n create mode 100644 app.py\n create mode 100644 requirements.txt\n create mode 100644 tontime.txt\n#(\u4ee5\u4e0b\u7701\u7565)<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">\u7d50\u679c: \u51fa\u73feApplication Error<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u7a0b\u5f0f\u53ef\u4ee5\u8dd1\uff0c\u4f46\u8dd1\u51fa\u4f86\u7db2\u5740\u6709\u554f\u984c<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f49\u79fb\u5230Pythonanywhere\u5df2\u53ef\u4ee5\u6210\u529f\u5c55\u793a\u7db2\u7ad9<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"800\" height=\"450\" src=\"https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17.jpg\" alt=\"\" class=\"wp-image-1279\" srcset=\"https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17.jpg 800w, https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17-300x169.jpg 300w, https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17-768x432.jpg 768w, https:\/\/gemmartdesign.com\/wp-content\/uploads\/2024\/11\/python-post17-585x329.jpg 585w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u5468\u76ee\u6a19 &nbsp;Flask \u7db2\u7ad9\u958b\u767c \u4efb\u52d9 \u5c08\u6848\u7df4\u7fd2 &hellip;<\/p>\n","protected":false},"author":1,"featured_media":1279,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","pagelayer_contact_templates":[],"_pagelayer_content":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[9],"tags":[],"class_list":["post-1208","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/posts\/1208","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1208"}],"version-history":[{"count":6,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/posts\/1208\/revisions"}],"predecessor-version":[{"id":1286,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/posts\/1208\/revisions\/1286"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=\/wp\/v2\/media\/1279"}],"wp:attachment":[{"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1208"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1208"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gemmartdesign.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1208"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}