{"id":436,"date":"2020-05-29T21:01:41","date_gmt":"2020-05-29T13:01:41","guid":{"rendered":"https:\/\/hophd.wordpress.com\/?p=436"},"modified":"2023-08-11T18:26:50","modified_gmt":"2023-08-11T10:26:50","slug":"django-basics","status":"publish","type":"post","link":"https:\/\/104.es\/index.php\/2020\/05\/29\/django-basics\/","title":{"rendered":"\u4f7f\u7528Django\u67b6\u7ad9\u6240\u9700\u4e4b\u57fa\u790e"},"content":{"rendered":"\n<p>Django\u662f\u5728Python\u793e\u7fa4\u4e2d\u975e\u5e38\u53d7\u5230\u6b61\u8fce\u7684\u7db2\u9801\u6846\u67b6\uff0c\u5b83\u6700\u5927\u7684\u7279\u8272\u662f\u5b89\u88dd\u4e4b\u5f8c\u5373\u5e6b\u6211\u5011\u5efa\u7acb\u51fa\u4e86\u4e00\u500b\u73fe\u4ee3\u5316\u7db2\u9801\u90fd\u9700\u8981\u7684\u529f\u80fd\u6a21\u7d44\uff0c\u53ea\u8981\u9075\u5faa\u9019\u500b\u6846\u67b6\u7684\u908f\u8f2f\uff0c\u5c31\u53ef\u4ee5\u5728\u5f88\u5feb\u7684\u6642\u9593\u5efa\u7acb\u51fa\u4e00\u500b\u5be6\u7528\u7684\u7db2\u7ad9\u3002\u4f46\u662f\uff0c\u4e5f\u56e0\u70ba\u5b83\u6709\u81ea\u5df1\u7684\u300c\u908f\u8f2f\u300d\uff0c\u6240\u4ee5\u5c0d\u4e00\u4e9b\u521d\u5b78\u8005\u4f86\u8aaa\uff0c\u7b97\u662f\u9032\u5165\u9580\u6abb\u8f03\u9ad8\u7684\u4e00\u7a2e\u7db2\u7ad9\u6846\u67b6\u3002<\/p>\n\n\n\n<p>\u60f3\u8981\u5b78\u7fd2Django\uff0c\u9664\u4e86\u8981\u5c0d\u65bcPython\u8a9e\u8a00\u6709\u6240\u77ad\u89e3\u4e4b\u5916\uff0c\u4ee5\u4e0b\u4e5f\u662f\u4e00\u4e9b\u4f60\u9700\u8981\u719f\u6089\u7684\u76f8\u95dc\u6280\u8853\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>HTML\/CSS\u8a9e\u6cd5<\/li><li>Bootstrap\u6846\u67b6\u57fa\u790e <\/li><li>JavaScript\u57fa\u790e <\/li><li>virtualenv\u6216\u76f8\u985e\u4f3c\u7684Python\u865b\u64ec\u74b0\u5883<\/li><li>Git\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236<\/li><li>Windows\u7684\u547d\u4ee4\u63d0\u793a\u5b57\u5143\u64cd\u4f5c\u6216\u662fMacOS\u7684\u7aef\u7d42\u6a5f\u64cd\u4f5c<\/li><\/ul>\n\n\n\n<p>\u5176\u4e2d\uff0c\u67b6\u8a2d\u7db2\u7ad9\u672c\u4f86\u5c31\u9700\u8981\u6709\u4e00\u4e9b\u7528\u4f86\u986f\u793a\u8cc7\u8a0a\u7684\u7db2\u9801\uff0c\u5982\u4f55\u8b93\u9019\u4e9b\u7db2\u9801\u4ee5\u9069\u7576\u7684\u6392\u7248\u986f\u793a\u51fa\u4f86\u81ea\u7136\u9700\u8981\u719f\u6089HTML\u7684\u4f7f\u7528\uff0c\u518d\u52a0\u4e0a\u4e00\u4e9bCSS\u7684\u6280\u5de7\uff0c\u8a2d\u8a08\u51fa\u4f86\u7684\u7db2\u9801\u5c31\u6703\u6bd4\u8f03\u9806\u773c\u3002\u6709\u6642\u5019\u70ba\u4e86\u8b93\u7db2\u9801\u5f88\u5feb\u5730\u5c31\u6709\u4e00\u4e9b\u7f8e\u89c0\u7684\u5143\u4ef6\u800c\u4e0d\u60f3\u8981\u518d\u50b7\u795e\u8a2d\u8a08CSS\u6a23\u5f0f\uff0c\u5927\u90e8\u4efd\u7684\u7db2\u9801\u958b\u767c\u8005\u90fd\u6703\u5c0e\u5165Bootstrap\u3002<\/p>\n\n\n\n<p>JavaScript\u7684\u76ee\u7684\u662f\u70ba\u4e86\u8b93\u6709\u4e9b\u8cc7\u6599\u7684\u986f\u793a\u7531\u524d\u7aef\u7684\u700f\u89bd\u5668\u4f86\u5b8c\u6210\uff0c\u8b93\u5f8c\u7aef\u7684Python\u7a0b\u5f0f\u53ef\u4ee5\u5c11\u5beb\u4e00\u4e9b\uff0c\u4e5f\u8b93\u986f\u793a\u7684\u6548\u679c\u53ef\u4ee5\u6bd4\u8f03\u5e73\u9806\uff0c\u4e0d\u8981\u52d5\u4e0d\u52d5\u5c31\u91cd\u65b0\u6574\u7406\u7db2\u9801\uff0c\u5982\u679c\u80fd\u5920\u719f\u6089jQuery\u9019\u985e\u7684\u524d\u7aef\u6846\u67b6\uff0c\u5f8c\u7aef\u7684\u7a0b\u5f0f\u5c31\u53ef\u4ee5\u5c11\u5beb\u4e00\u4e9b\u3002<\/p>\n\n\n\n<p>Python\u6700\u8b93\u4eba\u559c\u6b61\u7684\u5176\u4e2d\u4e00\u500b\u7279\u9ede\u5c31\u662f\u8c50\u5bcc\u591a\u5143\u7684\u6a21\u7d44\u548c\u5957\u4ef6\uff0c\u53ea\u8981\u4f7f\u7528pip install\uff0c\u5c31\u53ef\u4ee5\u8f15\u6613\u5730\u5b89\u88dd\u4f86\u81ea\u65bc\u7db2\u8def\u7684\u5404\u5f0f\u6a21\u7d44\uff0c\u4f46\u4e5f\u56e0\u70ba\u5982\u6b64\uff0c\u5982\u679c\u4e0d\u4f9d\u64da\u5c08\u6848\u4f86\u5340\u5206\u5404\u7a2e\u6a21\u7d44\u7684\u5b89\u88dd\u74b0\u5883\uff0c\u5c31\u6703\u9020\u6210\u539f\u751f\u74b0\u5883\u5b89\u88dd\u4e86\u4e00\u5806\u4e0d\u5c6c\u65bc\u67d0\u4e00\u5c08\u6848\u7684\u6a21\u7d44\uff0c\u8b93\u74b0\u5883\u592a\u904e\u65bc\u64c1\u816b\uff0c\u4e5f\u6709\u53ef\u80fd\u6703\u9020\u6210\u90e8\u4efd\u6a21\u7d44\u56e0\u4e0d\u76f8\u5bb9\u800c\u5c0e\u81f4\u885d\u7a81\u3002\u56e0\u6b64\uff0c\u7fd2\u6163\u4e0a\uff0c\u7576\u6211\u5011\u5728\u958b\u59cb\u4e00\u500b\u65b0\u5c08\u6848\u7684\u6642\u5019\uff0c\u5c31\u6703\u5148\u5efa\u7acb\u4e00\u500b\u4e7e\u6de8\u7684\u865b\u64ec\u74b0\u5883\uff0c\u8b93\u6bcf\u4e00\u500b\u5c08\u6848\u7684Python\u57f7\u884c\u74b0\u5883\u90fd\u80fd\u5920\u76f8\u4e92\u9694\u96e2\uff0c\u4ee5\u6539\u5584\u524d\u8ff0\u8aaa\u660e\u7684\u554f\u984c\u3002<\/p>\n\n\n\n<p>\u7db2\u7ad9\u5f80\u5f80\u4e0d\u6703\u7531\u4e00\u500b\u4eba\u5f9e\u982d\u505a\u5230\u5c3e\uff0c\u73fe\u4ee3\u7684\u7a0b\u5f0f\u5c08\u6848\u90fd\u6703\u5229\u7528\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7cfb\u7d71\u4f86\u9032\u884c\u5718\u968a\u5408\u4f5c\uff0c\u800c\u5176\u4e2dGit\u5c31\u662f\u5206\u6563\u5f0f\u7248\u672c\u63a7\u5236\u7684\u4e3b\u6d41\uff0c\u5c31\u7b97\u662f\u4e00\u4eba\u5c08\u6848\uff0c\u900f\u904e\u7248\u672c\u63a7\u5236\u4e5f\u53ef\u4ee5\u8b93\u81ea\u5df1\u80fd\u5920\u66f4\u8f15\u6613\u5730\u5728\u4e0d\u540c\u7684\u96fb\u8166\u4e4b\u9593\u9032\u884c\u540c\u4e00\u500b\u5c08\u6848\u7684\u958b\u767c\u5de5\u4f5c\u3002<\/p>\n\n\n\n<p>\u6240\u6709\u7684\u7db2\u7ad9\u6700\u7d42\u90fd\u662f\u5e0c\u671b\u80fd\u5920\u5728\u4f3a\u670d\u5668\u4e0a\u57f7\u884c\uff0cLinux\u7cfb\u7d71\u7121\u7591\u662f\u6700\u9069\u5408\u57f7\u884cPython\/Django\u7684\u74b0\u5883\uff0c\u5728Windows\u6216\u662fMacOS\u4e0b\u5982\u679c\u80fd\u5920\u719f\u6089\u547d\u4ee4\u5217\u7684\u64cd\u4f5c\uff0c\u65e5\u5f8c\u5728\u90e8\u7f72\u7db2\u7ad9\u7684\u6642\u5019\u5c07\u6703\u66f4\u5f97\u5fc3\u61c9\u624b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Django\u662f\u5728Python\u793e\u7fa4\u4e2d\u975e\u5e38\u53d7\u5230\u6b61\u8fce\u7684\u7db2\u9801\u6846\u67b6\uff0c\u5b83\u6700\u5927\u7684\u7279\u8272\u662f\u5b89\u88dd\u4e4b\u5f8c\u5373\u5e6b\u6211\u5011\u5efa\u7acb\u51fa\u4e86\u4e00\u500b\u73fe\u4ee3\u5316\u7db2\u9801\u90fd\u9700\u8981\u7684\u529f\u80fd\u6a21\u7d44\uff0c\u53ea\u8981\u9075\u5faa\u9019\u500b\u6846\u67b6\u7684\u908f\u8f2f\uff0c\u5c31\u53ef\u4ee5\u5728\u5f88\u5feb\u7684\u6642\u9593\u5efa\u7acb\u51fa\u4e00\u500b\u5be6\u7528\u7684\u7db2\u7ad9\u3002\u4f46\u662f\uff0c\u4e5f\u56e0\u70ba\u5b83\u6709\u81ea\u5df1\u7684\u300c\u908f\u8f2f\u300d\uff0c\u6240\u4ee5\u5c0d\u4e00\u4e9b\u521d\u5b78\u8005\u4f86\u8aaa\uff0c\u7b97\u662f\u9032\u5165\u9580\u6abb\u8f03\u9ad8\u7684\u4e00\u7a2e\u7db2\u7ad9\u6846\u67b6\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[6,15],"tags":[],"class_list":["post-436","post","type-post","status-publish","format-standard","hentry","category-django","category-python"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/436","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/comments?post=436"}],"version-history":[{"count":1,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/436\/revisions"}],"predecessor-version":[{"id":2945,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/posts\/436\/revisions\/2945"}],"wp:attachment":[{"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/media?parent=436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/categories?post=436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/104.es\/index.php\/wp-json\/wp\/v2\/tags?post=436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}