{"id":80676,"date":"2020-05-10T16:48:10","date_gmt":"2020-05-10T08:48:10","guid":{"rendered":"http:\/\/4563.org\/?p=80676"},"modified":"2020-05-10T16:48:10","modified_gmt":"2020-05-10T08:48:10","slug":"%e6%89%a7%e8%a1%8cget_wsgi_application-%e4%b9%8b%e5%90%8e%e6%80%bb%e6%98%af%e8%bf%94%e5%9b%9e%e9%94%99%e8%af%af%e7%9a%84python%e7%89%88%e6%9c%ac%e8%b7%af%e5%be%84","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=80676","title":{"rendered":"\u6267\u884cget_wsgi_application() \u4e4b\u540e\u603b\u662f\u8fd4\u56de\u9519\u8bef\u7684PYTHON\u7248\u672c\u8def\u5f84"},"content":{"rendered":"\n<p>  \t\t\t\t\t<strong>ZHT5178<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3>\u6267\u884cget_wsgi_application() \u4e4b\u540e\u603b\u662f\u8fd4\u56de\u9519\u8bef\u7684PYTHON\u7248\u672c\u8def\u5f84<\/h3>\n<p>  \t\t\u6267\u884cget_wsgi_application() \u4e4b\u540e\u603b\u662f\u8fd4\u56de\u9519\u8bef\u7684PYTHON\u7248\u672c\u8def\u5f84\uff0c\u8bf7\u95ee\u8fd9\u4e2a\u600e\u4e48\u89e3\u51b3\uff1f<\/p>\n<p>   application = get_wsgi_application()<br \/>  File &quot;\/usr\/lib\/python2.7\/site-packages\/django\/core\/wsgi.py&quot;, line 14, in get_wsgi_application<br \/>  &nbsp; &nbsp; return WSGIHandler()<br \/>  File &quot;\/usr\/lib\/python2.7\/site-packages\/django\/core\/handlers\/wsgi.py&quot;, line 153, in __init__<br \/>  &nbsp; &nbsp; self.load_middleware()<br \/>  File &quot;\/usr\/lib\/python2.7\/site-packages\/django\/core\/handlers\/base.py&quot;, line 80, in load_middleware<br \/>  &nbsp; &nbsp; middleware = import_string(middleware_path)<br \/>  File &quot;\/usr\/lib\/python2.7\/site-packages\/django\/utils\/module_loading.py&quot;, line 20, in import_string<br \/>  &nbsp; &nbsp; module = import_module(module_path)<br \/>  File &quot;\/usr\/lib64\/python2.7\/importlib\/__init__.py&quot;, line 37, in import_module<br \/>  &nbsp; &nbsp; __import__(name)<br \/>  ImportError: No module named corsheaders.middleware<br \/>  unable to load app 0 (mountpoint=&#8221;) (callable not found or import error)<br \/>  *** no app loaded. going in full dynamic mode ***<br \/>  *** uWSGI is running in multiple interpreter mode ***<br \/>  spawned uWSGI worker 1 (and the only) (pid: 2380, cores: 2)<\/p>\n<p>  \u60f3\u8981\u548c\u5b9d\u5854\u5171\u5b58\uff0c\u5b9d\u5854\u662fPY2.7\uff0c\u7a0b\u5e8f\u90fd\u662f\u8981\u6c423.6+\uff0c\u771f\u7684\u662f\u5f88\u9ebb\u70e6\uff0c\u5751\u592a\u591a\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4f3c\u6bdb\u975e\u6bdb<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tpython2\u548cpython3\u53ef\u4ee5\u5e76\u5b58\u7684\u5427~~\u88c5\u4e00\u4e2apython3..\u4f7f\u7528\u7684\u65f6\u5019\u5199python3 ..pip3.\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>ZHT5178<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4f3c\u6bdb\u975e\u6bdb \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-5-10 16:49<br \/>  python2\u548cpython3\u53ef\u4ee5\u5e76\u5b58\u7684\u5427~~\u88c5\u4e00\u4e2apython3..\u4f7f\u7528\u7684\u65f6\u5019\u5199python3 ..pip3.<\/p>\n<p> \u662f\u53ef\u5171\u5b58\uff0c\u4f46\u662f\u6211\u5b89\u88c5\u4e00\u4e2a3+\u7684\u7a0b\u5e8f\uff0c\u7a0b\u5e8f\u8bfb\u5230get_wsgi_application()\u540e\uff0c\u8fd4\u56de\u7684\u6267\u884c\u7ed3\u679c\u90fd\u662fPY2\u7684\u73af\u5883\uff0c\u8fd0\u884c uwsgi &#8211;python-version \u4e00\u76f4\u662f\u5b9d\u5854\u76842.7.5<\/p>\n<p>  https:\/\/cdn.jsdelivr.net\/gh\/hishis\/forum-master\/public\/images\/patch.gif\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>\u4f3c\u6bdb\u975e\u6bdb<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\tZHT5178 \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-5-10 16:53<br \/>  \u662f\u53ef\u5171\u5b58\uff0c\u4f46\u662f\u6211\u5b89\u88c5\u4e00\u4e2a3+\u7684\u7a0b\u5e8f\uff0c\u7a0b\u5e8f\u8bfb\u5230get_wsgi_application()\u540e\uff0c\u8fd4\u56de\u7684\u6267\u884c\u7ed3\u679c\u90fd\u662fPY2\u7684\u73af\u5883\uff0c &#8230;<\/p>\n<p> https:\/\/blog.51cto.com\/leizhu\/2065394<\/p>\n<p>  \u770b\u770b\u8fd9\u4e2a\u80fd\u89e3\u51b3\u4e0d\t\t\t\t<\/p>\n<p>  \t\t\t\t\t<strong>ZHT5178<\/strong>  \t\t\t\t\u5927\u4f6c\u6709\u8bdd\u8bf4 : \t<\/p>\n<h3><\/h3>\n<p>  \t\t\u4f3c\u6bdb\u975e\u6bdb \u5927\u4f6c\u6709\u8bdd\u8bf4 : 2020-5-10 16:55<br \/>  https:\/\/blog.51cto.com\/leizhu\/2065394<\/p>\n<p>  \u770b\u770b\u8fd9\u4e2a\u80fd\u89e3\u51b3\u4e0d<\/p>\n<p> \u5148\u8c22\u8c22\u5927\u4f6c\uff0c\u6211\u53bb\u8bd5\u4e00\u4e0b<\/p>\n<p>  https:\/\/cdn.jsdelivr.net\/gh\/hishis\/forum-master\/public\/images\/patch.gif\t\t\t  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>ZHT5178 \u5927\u4f6c\u6709\u8bdd\u8bf4 : \u6267&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\/80676"}],"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=80676"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/80676\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=80676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=80676"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=80676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}