{"id":8947,"date":"2018-12-24T16:39:42","date_gmt":"2018-12-24T08:39:42","guid":{"rendered":"http:\/\/4563.org\/?p=8947"},"modified":"2019-07-23T03:03:50","modified_gmt":"2019-07-22T19:03:50","slug":"%e5%a6%b9%e5%a6%b9%e6%ba%90%e7%a0%81-%e7%88%ac%e8%99%ab94imm%e6%a8%a1%e6%9d%bf","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=8947","title":{"rendered":"\u59b9\u59b9\u6e90\u7801\/\u722c\u866b@94imm\u6a21\u677f"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-8948\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2018\/12\/20181224_083925.jpg\" alt=\"\" width=\"1583\" height=\"737\" \/><\/p>\n<p>\u7a0b\u5e8f\u7b80\u5355\uff0c\u4e3b\u8981\u529f\u80fd\u5b8c\u5584\u3002\u65b0\u624b\u6559\u7a0b\u3002<\/p>\n<p>git\u5730\u5740\uff1ahttps:\/\/git.coding.net\/zxy_coding\/94imm.git<\/p>\n<p>\u6f14\u793a\u5730\u5740\uff1a\u6a21\u677f1 https:\/\/www.94imm.com\u3001 \u6a21\u677f2 http:\/\/www.livemz.com<\/p>\n<p>1.\u73af\u5883\u9700\u6c42Python3.6.5\u3001mysql5.7\u3001nginx(\u53ef\u9009)\u3002\u7cfb\u7edf\u7248\u672c\u63a8\u8350centos7 64\u4f4d<br \/>\n2.\u73af\u5883\u642d\u5efa<br \/>\npython3.6.5\u53c2\u8003 http:\/\/blog.51cto.com\/wenguonideshou\/2083301\uff0c\u8f6f\u94fe\u5730\u5740\u6709\u95ee\u9898\uff0c\u6ce8\u610f\u770b\u56de\u590d<br \/>\nmysql5.7\u5b89\u88c5\uff0c\u53c2\u8003https:\/\/blog.csdn.net\/qq_38663729\/article\/details\/79327305<br \/>\npython-dev\u5b89\u88c5\uff0c\u53c2\u8003https:\/\/blog.csdn.net\/default7\/article\/details\/73368665<br \/>\n\u5b89\u88c5\u7a0b\u5e8f\u4f9d\u8d56\uff0c\u8fdb\u5165\u7a0b\u5e8f\u76ee\u5f55\uff0c\u8f93\u5165\uff1apip3 install -r requirements.txt<br \/>\n3.\u7a0b\u5e8f\u5b89\u88c5<br \/>\n\u4fee\u6539silumz\u4e0bsettings.py\u6587\u4ef6\u4e2d\u6570\u636e\u5e93\u7684\u914d\u7f6e<br \/>\nDATABASES = {<br \/>\n&#8216;default&#8217;: {<br \/>\n&#8216;ENGINE&#8217;: &#8216;django.db.backends.mysql&#8217;,<br \/>\n&#8216;NAME&#8217;: &#8216;xxxx&#8217;,<br \/>\n&#8216;USER&#8217;: &#8216;root&#8217;,<br \/>\n&#8216;PASSWORD&#8217;: &#8216;xxxx&#8217;,<br \/>\n&#8216;HOST&#8217;: &#8216;127.0.0.1&#8217;,<br \/>\n&#8216;PORT&#8217;: &#8216;3306&#8217;,<br \/>\n}<br \/>\n}<br \/>\n\u521b\u5efa\u76f8\u5e94\u6570\u636e\u5e93\uff0c\u5bfc\u5165\u7a0b\u5e8f\u76ee\u5f55\u4e0b\u7684sql\u6587\u4ef6<br \/>\n\u4fee\u6539nginx\u914d\u7f6e\u6587\u4ef6\uff08centos7 \/etc\/nginx\/nginx.conf\uff09<br \/>\n\u914d\u7f6e\u6587\u4ef6\u7684server\u4e2d\u7684location\u5b57\u6bb5\u5982\u4e0b\u4fee\u6539<br \/>\nlocation \/ {<br \/>\nproxy_pass http:\/\/127.0.0.1:8000;<br \/>\nindex index.html index.htm;<br \/>\n}<br \/>\n\u91cd\u542fnginx\uff0c\u8bbf\u95ee\u7f51\u7ad9\u5373\u53ef<br \/>\n4.\u4fee\u6539\u722c\u866b\u4e2d\u7684\u6570\u636e\u5e93\u5730\u5740<br \/>\ndb = pymysql.connect(&#8220;127.0.0.1&#8221;, &#8220;root&#8221;, &#8220;xxxx&#8221;, &#8220;xxxx&#8221;)<br \/>\n5.\u542f\u52a8\u7a0b\u5e8f<br \/>\n\u8fdb\u5165\u7a0b\u5e8f\u76ee\u5f55\uff0cuwsgi &#8211;ini uwsgi.ini<br \/>\n6.\u6a21\u677f\u4fee\u6539<br \/>\n\u4fee\u6539silumz\u4e0bsettings\u6587\u4ef6\u4e2d\u7684\u6a21\u677f\u914d\u7f6e<br \/>\nTEMPLATES = [<br \/>\n{<br \/>\n&#8216;BACKEND&#8217;: &#8216;django.template.backends.django.DjangoTemplates&#8217;,<br \/>\n&#8216;DIRS&#8217;: [os.path.join(BASE_DIR, &#8216;templates&#8217;+&#8221;\/&#8221;+&#8221;94imm&#8221;)]<br \/>\n94imm\u4e3a\u6a21\u677f\u540d<br \/>\n\u6a21\u677f\u6587\u4ef6\u4f4d\u4e8etemplates\u6587\u4ef6\u5939\u4e0b\uff0c\u4fee\u6539\u76f8\u5e94\u9875\u9762<br \/>\n7.\u5176\u4ed6\u914d\u7f6e<br \/>\n\u5c06\u6a21\u677f\u76ee\u5f55\u4e0b\u7684pagination.html\u6587\u4ef6\u653e\u5165python\u5b89\u88c5\u76ee\u5f55\u7684\/site-packages\/dj_pagination\/templates\/pagination\/\u4e0b<br \/>\n\uff08centos7 \/usr\/lib\/python3.6\/site-packages\/dj_pagination\/templates\/pagination\uff09<br \/>\n8.\u5907\u6ce8\u8bf4\u660e<br \/>\n\u5176\u4ed6\u7cfb\u7edf\u8bf7\u81ea\u884c\u767e\u5ea6mysql python3.6.5 nginx\u7684\u5b89\u88c5\u65b9\u6cd5\uff0c\u7a0b\u5e8f\u5b89\u88c5\u65b9\u6cd5\u76f8\u540c<\/p>\n<p>\u4f86\u6e90:https:\/\/www.hostloc.com\/thread-507774-1-1.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7a0b\u5e8f\u7b80\u5355\uff0c\u4e3b\u8981\u529f\u80fd\u5b8c\u5584\u3002\u65b0\u624b\u6559\u7a0b\u3002&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/8947"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8947"}],"version-history":[{"count":2,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/8947\/revisions"}],"predecessor-version":[{"id":8950,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/8947\/revisions\/8950"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8947"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8947"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8947"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}