{"id":7627,"date":"2024-11-14T15:53:28","date_gmt":"2024-11-14T07:53:28","guid":{"rendered":"https:\/\/fwq.ai\/blog\/7627\/"},"modified":"2024-11-14T15:53:28","modified_gmt":"2024-11-14T07:53:28","slug":"pycharm%e4%b8%8bdjango%e8%bf%9e%e6%8e%a5mysql%e6%95%b0%e6%8d%ae%e5%ba%93%ef%bc%8c%e6%89%a7%e8%a1%8cmakemigrations%e5%90%8e%e4%b8%ba%e4%bd%95%e6%b2%a1%e6%9c%89%e5%88%9b%e5%bb%ba%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/7627\/","title":{"rendered":"Pycharm\u4e0bDjango\u8fde\u63a5MySQL\u6570\u636e\u5e93\uff0c\u6267\u884cmakemigrations\u540e\u4e3a\u4f55\u6ca1\u6709\u521b\u5efa\u6570\u636e\u8868\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173106289676528.jpg\" class=\"aligncenter\" title=\"Pycharm\u4e0bDjango\u8fde\u63a5MySQL\u6570\u636e\u5e93\uff0c\u6267\u884cmakemigrations\u540e\u4e3a\u4f55\u6ca1\u6709\u521b\u5efa\u6570\u636e\u8868\uff1f\u63d2\u56fe\" alt=\"Pycharm\u4e0bDjango\u8fde\u63a5MySQL\u6570\u636e\u5e93\uff0c\u6267\u884cmakemigrations\u540e\u4e3a\u4f55\u6ca1\u6709\u521b\u5efa\u6570\u636e\u8868\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u4e0bDjango\u4e0eMySQL\u8fde\u63a5\u95ee\u9898\uff1a\u6267\u884cmakemigrations\u540e\u6570\u636e\u5e93\u8868\u672a\u521b\u5efa<\/strong><\/p>\n<p>\u5bf9\u4e8e\u5728pycharm\u4e2d\u4f7f\u7528Django\u8fde\u63a5MySQL\u6570\u636e\u5e93\u65f6\uff0c\u6267\u884c\u201c3 manage.py makemigrations\u201d\u547d\u4ee4\u540e\u6570\u636e\u5e93\u8868\u6ca1\u6709\u521b\u5efa\u6210\u529f\u7684\u7591\u60d1\uff0c\u4ee5\u4e0b\u89e3\u51b3\u65b9\u6848\u53ef\u80fd\u6709\u6240\u5e2e\u52a9\uff1a<\/p>\n<p><strong>\u73af\u5883\u4fe1\u606f\uff1a<\/strong><\/p>\n<ul>\n<li>\u7cfb\u7edf\uff1aWin10<\/li>\n<li>Python\u7248\u672c\uff1a3.8.6<\/li>\n<li>Django\u7248\u672c\uff1a3.2.19<\/li>\n<li> client\u7248\u672c\uff1a2.1.1<\/li>\n<li>mysql\u7248\u672c\uff1a0.0.3<\/li>\n<\/ul>\n<p><strong>\u95ee\u9898\u63cf\u8ff0\uff1a<\/strong><\/p>\n<p>\u5df2\u5b8c\u6210\u9879\u76ee\u7684app\u6ce8\u518c\u548c\u6570\u636e\u5e93\u914d\u7f6e\uff0c\u5e76\u5728pycharm\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4e86\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<ul>\n<li>python3 manage.py makemigrations<\/li>\n<li>python3 manage.py migrate<\/li>\n<\/ul>\n<p>\u4f46\u5e76\u672a\u5728MySQL\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u6570\u636e\u8868\u3002<\/p>\n<p><strong>\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p>\u5206\u6790\u547d\u4ee4\u8f93\u51fa\u4fe1\u606f\uff0c\u53d1\u73b0\u7cfb\u7edf\u5b9e\u9645\u8fd0\u884c\u7684\u547d\u4ee4\u5e76\u975e\u201cpython3 manage.py\u201d\uff0c\u800c\u662f\u76f4\u63a5\u6307\u5411\u4e86Windows\u81ea\u5e26\u7684Python 3\uff0c\u5bfc\u81f4\u547d\u4ee4\u65e0\u6548\u3002\u5c1d\u8bd5\u76f4\u63a5\u8f93\u5165\u201cpython\u201d\uff0c\u5373\u53ef\u6210\u529f\u6253\u5f00Python IDLE\u3002<\/p>\n<p>\u56e0\u6b64\uff0c\u5bf9\u4e8e\u5df2\u7ecf\u901a\u8fc7\u5b89\u88c5\u5305\u65b9\u5f0f\u5b89\u88c5Python\u7684\u7528\u6237\uff0c\u5728\u4f7f\u7528pycharm\u65f6\u65e0\u9700\u518d\u4f7f\u7528\u201cpython3\u201d\u524d\u7f00\uff0c\u76f4\u63a5\u8f93\u5165\u201cpython\u201d\u5373\u53ef\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef\uff1a<\/p>\n<ul>\n<li>python manage.py makemigrations<\/li>\n<li>python manage.py migrate<\/li>\n<\/ul>\n<p>\u6b64\u65f6\uff0c\u76f8\u5173\u6570\u636e\u8868\u5c06\u5728MySQL\u6570\u636e\u5e93\u4e2d\u6210\u529f\u521b\u5efa\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fPycharm\u4e0bDjango\u8fde\u63a5MySQL\u6570\u636e\u5e93\uff0c\u6267\u884cmakemigrations\u540e\u4e3a\u4f55\u6ca1\u6709\u521b\u5efa\u6570\u636e\u8868\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>\u4e0bDjango\u4e0eMySQL\u8fde\u63a5\u95ee\u9898\uff1a\u6267\u884cmakemigrations\u540e\u6570\u636e\u5e93\u8868\u672a\u521b\u5efa \u5bf9\u4e8e\u5728pycharm\u4e2d\u4f7f\u7528Django\u8fde\u63a5MySQL\u6570\u636e\u5e93\u65f6\uff0c\u6267\u884c\u201c3 manage.py makemigrations\u201d\u547d\u4ee4\u540e\u6570\u636e\u5e93\u8868\u6ca1\u6709\u521b\u5efa\u6210\u529f\u7684\u7591\u60d1\uff0c\u4ee5\u4e0b\u89e3\u51b3\u65b9\u6848\u53ef\u80fd\u6709\u6240\u5e2e\u52a9\uff1a \u73af\u5883\u4fe1\u606f\uff1a \u7cfb\u7edf\uff1aWin10 Python\u7248\u672c\uff1a3.8.6 Django\u7248\u672c\uff1a3.2.19 client\u7248\u672c\uff1a2.1.1 mysql\u7248\u672c\uff1a0.0.3 \u95ee\u9898\u63cf\u8ff0\uff1a \u5df2\u5b8c\u6210\u9879\u76ee\u7684app\u6ce8\u518c\u548c\u6570\u636e\u5e93\u914d\u7f6e\uff0c\u5e76\u5728pycharm\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4e86\u4ee5\u4e0b\u547d\u4ee4\uff1a python3 manage.py makemigrations python3 manage.py migrate \u4f46\u5e76\u672a\u5728MySQL\u6570\u636e\u5e93\u4e2d\u521b\u5efa\u6570\u636e\u8868\u3002 \u89e3\u51b3\u65b9\u6848 \u5206\u6790\u547d\u4ee4\u8f93\u51fa\u4fe1\u606f\uff0c\u53d1\u73b0\u7cfb\u7edf\u5b9e\u9645\u8fd0\u884c\u7684\u547d\u4ee4\u5e76\u975e\u201cpython3 manage.py\u201d\uff0c\u800c\u662f\u76f4\u63a5\u6307\u5411\u4e86Windows\u81ea\u5e26\u7684Python 3\uff0c\u5bfc\u81f4\u547d\u4ee4\u65e0\u6548\u3002\u5c1d\u8bd5\u76f4\u63a5\u8f93\u5165\u201cpython\u201d\uff0c\u5373\u53ef\u6210\u529f\u6253\u5f00Python IDLE\u3002 \u56e0\u6b64\uff0c\u5bf9\u4e8e\u5df2\u7ecf\u901a\u8fc7\u5b89\u88c5\u5305\u65b9\u5f0f\u5b89\u88c5Python\u7684\u7528\u6237\uff0c\u5728\u4f7f\u7528pycharm\u65f6\u65e0\u9700\u518d\u4f7f\u7528\u201cpython3\u201d\u524d\u7f00\uff0c\u76f4\u63a5\u8f93\u5165\u201cpython\u201d\u5373\u53ef\u3002\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef\uff1a python manage.py makemigrations python manage.py migrate \u6b64\u65f6\uff0c\u76f8\u5173\u6570\u636e\u8868\u5c06\u5728MySQL\u6570\u636e\u5e93\u4e2d\u6210\u529f\u521b\u5efa\u3002 \u4ee5\u4e0a\u5c31\u662fPycharm\u4e0bDjango\u8fde\u63a5MySQL\u6570\u636e\u5e93\uff0c\u6267\u884cmakemigrations\u540e\u4e3a\u4f55\u6ca1\u6709\u521b\u5efa\u6570\u636e\u8868\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-7627","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7627","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=7627"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/7627\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=7627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=7627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=7627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}