{"id":7654,"date":"2024-11-14T09:48:47","date_gmt":"2024-11-14T01:48:47","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7654\/"},"modified":"2024-11-14T09:48:47","modified_gmt":"2024-11-14T01:48:47","slug":"django-%e9%a1%b9%e7%9b%ae%e8%bf%90%e8%a1%8c%e6%97%b6%e9%81%87%e5%88%b0django-core-exceptions-improperlyconfigured%e9%94%99%e8%af%af%ef%bc%8c%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7654\/","title":{"rendered":"Django \u9879\u76ee\u8fd0\u884c\u65f6\u9047\u5230\u201cdjango.core.exceptions.ImproperlyConfigured\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173111940311474.jpg\" class=\"aligncenter\" title=\"Django \u9879\u76ee\u8fd0\u884c\u65f6\u9047\u5230\u201cdjango.core.exceptions.ImproperlyConfigured\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" alt=\"Django \u9879\u76ee\u8fd0\u884c\u65f6\u9047\u5230\u201cdjango.core.exceptions.ImproperlyConfigured\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u63d2\u56fe\" \/><\/p>\n<p>\u5f53\u5728\u8fd0\u884c Django \u9879\u76ee\u65f6\u9047\u5230\u201cdjango.core.exceptions.ImproperlyConfigured\u201d\u9519\u8bef\u65f6\uff0c\u8fd9\u8868\u660e Django \u65e0\u6cd5\u5bfc\u5165\u5176\u9884\u671f\u7684\u6570\u636e\u5e93\u540e\u7aef\u3002<\/p>\n<p>\u5728\u7ed9\u5b9a\u7684\u4ee3\u7801\u4e2d\uff0c\u9519\u8bef\u6d88\u606f\u6307\u51fa Django \u65e0\u6cd5\u5bfc\u5165\u201cdjango.db.backends.\u201d\uff0c\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u4ee5\u4e0b\u539f\u56e0\u4e4b\u4e00\uff1a<\/p>\n<ul>\n<li>\u4f7f\u7528\u9519\u8bef\u7684 Python \u7248\u672c\uff1a\u8bf7\u6ce8\u610f\uff0c\u9519\u8bef\u8f93\u51fa\u663e\u793a\u4f7f\u7528\u7684\u662f Python 3.8.6\uff0c\u800c\u9879\u76ee\u4e2d\u6307\u5b9a\u7684\u662f Python 3.7.4\u3002\u8bf7\u786e\u4fdd\u5728\u6b63\u786e\u7684 Python \u73af\u5883\u4e2d\u8fd0\u884c\u9879\u76ee\u3002<\/li>\n<li>\u7f3a\u5c11 MySQL \u9a71\u52a8\uff1a\u786e\u4fdd\u5df2\u5b89\u88c5 MySQL \u5ba2\u6237\u7aef\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u9879\u76ee\u7684 PYTHONPATH \u4e2d\u3002\u60a8\u53ef\u80fd\u9700\u8981\u4f7f\u7528 pip \u547d\u4ee4\u5b89\u88c5 mysqlclient \u5305\u3002<\/li>\n<li>Django \u914d\u7f6e\u9519\u8bef\uff1a\u5728 settings.py \u6587\u4ef6\u4e2d\uff0c\u68c0\u67e5\u6570\u636e\u5e93\u8bbe\u7f6e\u662f\u5426\u6b63\u786e\u3002\u786e\u4fdd\u5df2\u6b63\u786e\u6307\u5b9a\u201cENGINE\u201d\u3001\u201cOPTIONS\u201d\u548c\u201cNAME\u201d\u3002<\/li>\n<\/ul>\n<p>\u8981\u89e3\u51b3\u6b64\u9519\u8bef\uff0c\u8bf7\u91c7\u53d6\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ol>\n<li>\u68c0\u67e5\u60a8\u7684 Python \u73af\u5883\u4ee5\u786e\u4fdd\u6b63\u5728\u4f7f\u7528\u6b63\u786e\u7684\u7248\u672c\uff08Python 3.7.4\uff09\u3002<\/li>\n<li>\u5b89\u88c5 MySQL \u5ba2\u6237\u7aef\uff08\u5982\u679c\u5c1a\u672a\u5b89\u88c5\uff09\u5e76\u5c06\u5176\u6dfb\u52a0\u5230 PYTHONPATH\u3002<\/li>\n<li>\u68c0\u67e5 settings.py \u6587\u4ef6\u4e2d\u7684\u6570\u636e\u5e93\u8bbe\u7f6e\u5e76\u786e\u4fdd\u6b63\u786e\u65e0\u8bef\u3002<\/li>\n<\/ol>\n<p>\u5b8c\u6210\u8fd9\u4e9b\u6b65\u9aa4\u540e\uff0c\u5e94\u91cd\u65b0\u8fd0\u884c Django \u9879\u76ee\uff0c\u9519\u8bef\u5e94\u8be5\u6d88\u5931\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fDjango \u9879\u76ee\u8fd0\u884c\u65f6\u9047\u5230\u201cdjango.core.exceptions.ImproperlyConfigured\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u5728\u8fd0\u884c Django \u9879\u76ee\u65f6\u9047\u5230\u201cdjango.core.exceptions.ImproperlyConfigured\u201d\u9519\u8bef\u65f6\uff0c\u8fd9\u8868\u660e Django \u65e0\u6cd5\u5bfc\u5165\u5176\u9884\u671f\u7684\u6570\u636e\u5e93\u540e\u7aef\u3002 \u5728\u7ed9\u5b9a\u7684\u4ee3\u7801\u4e2d\uff0c\u9519\u8bef\u6d88\u606f\u6307\u51fa Django \u65e0\u6cd5\u5bfc\u5165\u201cdjango.db.backends.\u201d\uff0c\u8fd9\u53ef\u80fd\u662f\u56e0\u4e3a\u4ee5\u4e0b\u539f\u56e0\u4e4b\u4e00\uff1a \u4f7f\u7528\u9519\u8bef\u7684 Python \u7248\u672c\uff1a\u8bf7\u6ce8\u610f\uff0c\u9519\u8bef\u8f93\u51fa\u663e\u793a\u4f7f\u7528\u7684\u662f Python 3.8.6\uff0c\u800c\u9879\u76ee\u4e2d\u6307\u5b9a\u7684\u662f Python 3.7.4\u3002\u8bf7\u786e\u4fdd\u5728\u6b63\u786e\u7684 Python \u73af\u5883\u4e2d\u8fd0\u884c\u9879\u76ee\u3002 \u7f3a\u5c11 MySQL \u9a71\u52a8\uff1a\u786e\u4fdd\u5df2\u5b89\u88c5 MySQL \u5ba2\u6237\u7aef\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u9879\u76ee\u7684 PYTHONPATH \u4e2d\u3002\u60a8\u53ef\u80fd\u9700\u8981\u4f7f\u7528 pip \u547d\u4ee4\u5b89\u88c5 mysqlclient \u5305\u3002 Django \u914d\u7f6e\u9519\u8bef\uff1a\u5728 settings.py \u6587\u4ef6\u4e2d\uff0c\u68c0\u67e5\u6570\u636e\u5e93\u8bbe\u7f6e\u662f\u5426\u6b63\u786e\u3002\u786e\u4fdd\u5df2\u6b63\u786e\u6307\u5b9a\u201cENGINE\u201d\u3001\u201cOPTIONS\u201d\u548c\u201cNAME\u201d\u3002 \u8981\u89e3\u51b3\u6b64\u9519\u8bef\uff0c\u8bf7\u91c7\u53d6\u4ee5\u4e0b\u6b65\u9aa4\uff1a \u68c0\u67e5\u60a8\u7684 Python \u73af\u5883\u4ee5\u786e\u4fdd\u6b63\u5728\u4f7f\u7528\u6b63\u786e\u7684\u7248\u672c\uff08Python 3.7.4\uff09\u3002 \u5b89\u88c5 MySQL \u5ba2\u6237\u7aef\uff08\u5982\u679c\u5c1a\u672a\u5b89\u88c5\uff09\u5e76\u5c06\u5176\u6dfb\u52a0\u5230 PYTHONPATH\u3002 \u68c0\u67e5 settings.py \u6587\u4ef6\u4e2d\u7684\u6570\u636e\u5e93\u8bbe\u7f6e\u5e76\u786e\u4fdd\u6b63\u786e\u65e0\u8bef\u3002 \u5b8c\u6210\u8fd9\u4e9b\u6b65\u9aa4\u540e\uff0c\u5e94\u91cd\u65b0\u8fd0\u884c Django \u9879\u76ee\uff0c\u9519\u8bef\u5e94\u8be5\u6d88\u5931\u3002 \u4ee5\u4e0a\u5c31\u662fDjango \u9879\u76ee\u8fd0\u884c\u65f6\u9047\u5230\u201cdjango.core.exceptions.ImproperlyConfigured\u201d\u9519\u8bef\uff0c\u5982\u4f55\u89e3\u51b3\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u7f51\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-7654","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=7654"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7654\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}