{"id":28809,"date":"2024-01-31T21:13:27","date_gmt":"2023-12-09T09:05:26","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/"},"modified":"2025-08-12T10:12:52","modified_gmt":"2025-08-12T02:12:52","slug":"%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/","title":{"rendered":"\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6"},"content":{"rendered":"<p>\u6211\u4f7f\u7528Python + Django\u8fdb\u884c\u4e86\u4e0e\u6b64\u9875\u9762\u7c7b\u4f3c\u7684\u64cd\u4f5c\uff0c\u5373CSV\u6587\u4ef6\u4e0b\u8f7d\/\u4e0a\u4f20\u3002<\/p>\n<p>The following is an option for paraphrasing the phrase &#8220;\u9055\u3044\u306f&#8221; (The difference is) in Chinese:<\/p>\n<p>\u533a\u522b\u5728\u4e8e  <\/p>\n<blockquote><p>\u64cd\u4f5c\u7cfb\u7edf\u4e3aArch Linux<br \/>\n\u6570\u636e\u5e93\u4e3aMariaDB<br \/>\n\u5e93\u4e3adjango-bootstrap4<br \/>\ncsv\u6587\u4ef6\u7684\u5b57\u7b26\u7f16\u7801\u4e3autf-8\u3002<\/p><\/blockquote>\n<p>\u4ee3\u7801\u5b58\u653e\u5728GitHub\u4e0a\u3002<br \/>\nekzemplaro\/django_csv_upload_download<\/p>\n<p>\u6b65\u9aa4<\/p>\n<p>1\uff09\u5b89\u88c5\u56fe\u4e66\u9986<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">sudo <\/span>pip <span class=\"nb\">install <\/span>django-bootstrap4\r\n<\/code><\/pre>\n<p>2) \u51c6\u5907 MariaDB<\/p>\n<blockquote><p>\u7528\u6237\u540d\uff1adjango<br \/>\n\u5bc6\u7801\uff1atiger123<br \/>\n\u6570\u636e\u5e93\uff1adjango_csv<\/p><\/blockquote>\n<pre class=\"post-pre\"><code>MariaDB [(none)]&gt; create user django@localhost identified by 'tiger123';\r\nMariaDB [(none)]&gt; select user,host from mysql.user;\r\nMariaDB [(none)]&gt; create database django_csv;\r\nMariaDB [(none)]&gt; grant all on django_csv.* to django@localhost;\r\n<\/code><\/pre>\n<p>3) \u4eceGitHub\u590d\u5236<\/p>\n<pre class=\"post-pre\"><code>git clone https:\/\/github.com\/ekzemplaro\/django_csv_upload_download\r\n<\/code><\/pre>\n<p>4) \u521b\u5efa\u6570\u636e\u5e93  <\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">cd <\/span>proj01\r\npython manage.py makemigrations csvdownload\r\npython manage.py migrate\r\npython manage.py createsuperuser\r\n<\/code><\/pre>\n<p>5\uff09\u542f\u52a8\u5f00\u53d1\u670d\u52a1\u5668<\/p>\n<pre class=\"post-pre\"><code>python manage.py runserver\r\n<\/code><\/pre>\n<p>6) \u4f7f\u7528\u6d4f\u89c8\u5668\u8bbf\u95ee http:\/\/127.0.0.1:8000\/<\/p>\n<p>7) \u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5c06\u4e0b\u4e00\u4e2a\u6587\u4ef6\u4e0a\u4f20<\/p>\n<pre class=\"post-pre\"><code>102,\u793e\u9577\r\n103,\u90e8\u9577\r\n104,\u8ab2\u9577\r\n<\/code><\/pre>\n<p>\u6211\u5728\u4e0b\u4e00\u4e2a\u7248\u672c\u4e2d\u8fdb\u884c\u4e86\u786e\u8ba4\u3002<\/p>\n<pre class=\"post-pre\"><code>$ python --version\r\nPython 3.9.7\r\n$ python -m django --version\r\n3.1.4\r\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u4f7f\u7528Python + Django\u8fdb\u884c\u4e86\u4e0e\u6b64\u9875\u9762\u7c7b\u4f3c\u7684\u64cd\u4f5c\uff0c\u5373CSV\u6587\u4ef6\u4e0b\u8f7d\/\u4e0a\u4f20\u3002 The followi [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[227],"class_list":["post-28809","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-227"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5173\u4e8e\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528django\u4e0a\u4f20\u548c\u4e0b\u8f7dcsv\u6587\u4ef6\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6\" \/>\n<meta property=\"og:description\" content=\"\u5173\u4e8e\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6\u7684\u6280\u672f\u6587\u7ae0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528django\u4e0a\u4f20\u548c\u4e0b\u8f7dcsv\u6587\u4ef6\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-09T09:05:26+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-12T02:12:52+00:00\" \/>\n<meta name=\"author\" content=\"\u79d1, \u9896\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u79d1, \u9896\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/\",\"name\":\"\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-12-09T09:05:26+00:00\",\"dateModified\":\"2025-08-12T02:12:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\"},\"description\":\"\u5173\u4e8e\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6\u7684\u6280\u672f\u6587\u7ae0\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e\",\"name\":\"\u79d1, \u9896\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g\",\"caption\":\"\u79d1, \u9896\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6 - Blog - Silicon Cloud","description":"\u5173\u4e8e\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6\u7684\u6280\u672f\u6587\u7ae0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528django\u4e0a\u4f20\u548c\u4e0b\u8f7dcsv\u6587\u4ef6\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6","og_description":"\u5173\u4e8e\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6\u7684\u6280\u672f\u6587\u7ae0","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4f7f\u7528django\u4e0a\u4f20\u548c\u4e0b\u8f7dcsv\u6587\u4ef6\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-09T09:05:26+00:00","article_modified_time":"2025-08-12T02:12:52+00:00","author":"\u79d1, \u9896","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u79d1, \u9896","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/","name":"\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-12-09T09:05:26+00:00","dateModified":"2025-08-12T02:12:52+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e"},"description":"\u5173\u4e8e\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6\u7684\u6280\u672f\u6587\u7ae0","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u4f7f\u7528Django\u4e0a\u4f20\u548c\u4e0b\u8f7dCSV\u6587\u4ef6"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/8ca01ba7f7362ad4edb7da206a12f29e","name":"\u79d1, \u9896","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8a6fb3cc7ba2f69d2189ba532aec4633ea7ed75ac0af162ec367cb3abc0fb2af?s=96&d=mm&r=g","caption":"\u79d1, \u9896"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keying\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bd%bf%e7%94%a8django%e4%b8%8a%e4%bc%a0%e5%92%8c%e4%b8%8b%e8%bd%bdcsv%e6%96%87%e4%bb%b6\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28809","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=28809"}],"version-history":[{"count":1,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28809\/revisions"}],"predecessor-version":[{"id":81302,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/28809\/revisions\/81302"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=28809"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=28809"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=28809"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}