{"id":49284,"date":"2023-01-25T12:55:39","date_gmt":"2023-12-01T10:28:32","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/"},"modified":"2024-04-29T11:25:39","modified_gmt":"2024-04-29T03:25:39","slug":"%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/","title":{"rendered":"\u4ece\u5934\u5b66\u4e60Django 2 &#8211; \u4fee\u6539\u8bbe\u7f6e.py\u6587\u4ef6"},"content":{"rendered":"<h1>\u5f53\u524d\u7684\u60c5\u51b5<\/h1>\n<p>\u597d\u5427\uff0c\u4e0a\u6b21\u6211\u4eec\u603b\u7b97\u5728\u6d4f\u89c8\u5668\u4e0a\u663e\u793a\u6210\u529f\u4e86\u3002<\/p>\n<pre class=\"post-pre\"><code>  dev\/django\r\n<span class=\"gd\">- \u2514\u2500\u2500\u2500 mysite\r\n<\/span>          \u251c\u2500\u2500\u2500 manage.py\r\n          \u251c\u2500\u2500\u2500 myapp\r\n          \u2502       \u251c\u2500\u2500\u2500 migrations\r\n          \u2502       \u2502       \u2514\u2500\u2500\u2500__init__.py\r\n          \u2502       \u251c\u2500\u2500\u2500 __init__.py\r\n          \u2502       \u251c\u2500\u2500\u2500 admin.py\r\n          \u2502       \u251c\u2500\u2500\u2500 apps.py\r\n          \u2502       \u251c\u2500\u2500\u2500 models.py\r\n          \u2502       \u251c\u2500\u2500\u2500 tests.py\r\n          \u2502       \u2514\u2500\u2500\u2500 views.py\r\n<span class=\"gd\">-         \u2514\u2500\u2500\u2500 mysite\r\n<\/span>                  \u251c\u2500\u2500\u2500 __init__.py\r\n                  \u251c\u2500\u2500\u2500 asgi.py\r\n                  \u251c\u2500\u2500\u2500 settings.py\r\n                  \u251c\u2500\u2500\u2500 urls.py\r\n                  \u2514\u2500\u2500\u2500 wsgi.py\r\n<\/code><\/pre>\n<p>\u7531\u4e8emysite\u6709\u91cd\u590d\u5e76\u4e14\u53d8\u5f97\u6df7\u4e71\uff0c\u6240\u4ee5\u6682\u65f6\u91cd\u5efa\u5b83\u3002<br \/>\n\u6839\u636e\u9700\u8981\u8fdb\u884ccd\u64cd\u4f5c\u3002\u5982\u679c\u60f3\u8981\u5411\u4e0a\u4e00\u4e2a\u5c42\u7ea7\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528cd ..\/\u3002<\/p>\n<pre class=\"post-pre\"><code>dev\/django\/mysite&gt; cd ..\/\r\ndev\/django&gt;\r\n<\/code><\/pre>\n<h2>\u5220\u9664\u76ee\u5f55<\/h2>\n<p>\u53ef\u4ee5\u5728\u60f3\u8981\u5220\u9664\u7684\u76ee\u5f55\u4e2d\u4f7f\u7528rm\u5220\u9664\u3002<\/p>\n<pre class=\"post-pre\"><code>dev\/django&gt;rm mysite\r\n\r\n\u78ba\u8a8d\r\nC:\\Users\\cloud\\dev\\django\\mysite \u306e\u9805\u76ee\u306b\u306f\u5b50\u304c\u3042\u308a\u3001Recurse \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u7d9a\u884c\u3057\u305f\u5834\u5408\u3001\u9805\u76ee\u3068\u5171\u306b\u3059\u3079\u3066\u306e\u5b50\u304c\u524a\u9664\u3055\u308c\u307e\u3059\u3002\u7d9a\u884c\u3057\u307e\u3059\u304b?\r\n[Y] \u306f\u3044(Y)  [A] \u3059\u3079\u3066\u7d9a\u884c(A)  [N] \u3044\u3044\u3048(N)  [L] \u3059\u3079\u3066\u7121\u8996(L)  [S] \u4e2d\u65ad(S)  [?] \u30d8\u30eb\u30d7 (\u65e2\u5b9a\u5024\u306f \"Y\"):\r\n<\/code><\/pre>\n<p>\u7136\u540e\u8fd9\u6b21\u7531\u4e8e\u76ee\u5f55\u4e0d\u4e3a\u7a7a\uff0c\u6240\u4ee5\u4f1a\u5f39\u51fa\u786e\u8ba4\uff08\u8b66\u544a\uff09\u63d0\u793a\u3002\u60a8\u53ef\u4ee5\u8f93\u5165 Y \u6765\u5220\u9664\u76ee\u5f55\u3002<\/p>\n<pre class=\"post-pre\"><code>  dev\/django&gt;rm mysite\r\n\r\n  \u78ba\u8a8d\r\n  C:\\Users\\cloud\\dev\\django\\mysite \u306e\u9805\u76ee\u306b\u306f\u5b50\u304c\u3042\u308a\u3001Recurse \u30d1\u30e9\u30e1\u30fc\u30bf\u30fc\u304c\u6307\u5b9a\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3067\u3057\u305f\u3002\u7d9a\u884c\u3057\u305f\u5834\u5408\u3001\u9805\u76ee\u3068\u5171\u306b\u3059\u3079\u3066\u306e\u5b50\u304c\u524a\u9664\u3055\u308c\u307e\u3059\u3002\u7d9a\u884c\u3057\u307e\u3059\u304b?\r\n  [Y] \u306f\u3044(Y)  [A] \u3059\u3079\u3066\u7d9a\u884c(A)  [N] \u3044\u3044\u3048(N)  [L] \u3059\u3079\u3066\u7121\u8996(L)  [S] \u4e2d\u65ad(S)  [?] \u30d8\u30eb\u30d7 (\u65e2\u5b9a\u5024\u306f \"Y\"): \r\n<span class=\"gi\">+ Y\r\n<\/span>\r\n  dev\/django&gt;\r\n<\/code><\/pre>\n<p>\u987a\u4fbf\u8bf4\u4e00\u4e0b\uff0c\u5982\u679c\u6dfb\u52a0 -R\uff0c\u53ef\u4ee5\u5728\u4e0d\u8be2\u95ee\u786e\u8ba4\u7684\u60c5\u51b5\u4e0b\u5220\u9664\u3002<\/p>\n<pre class=\"post-pre\"><code>dev\/django&gt;rm mysite -R\r\ndev\/django&gt;\r\n<\/code><\/pre>\n<h2>\u91cd\u65b0\u521b\u5efa\u76ee\u5f55<\/h2>\n<p>\u53ea\u9700\u8981\u91cd\u590d\u4e0a\u6b21\u505a\u8fc7\u7684\u5185\u5bb9\u3002<\/p>\n<p>\u7136\u800c\uff0c\u6240\u521b\u5efa\u7684\u76ee\u5f55\u540d\u79f0\u548c\u5c42\u6b21\u4e0e\u4e0a\u6b21\u4e0d\u540c\u3002<\/p>\n<pre class=\"post-pre\"><code>  dev\/django\r\n  \u2514\u2500\u2500\u2500 mysite\r\n          \u251c\u2500\u2500\u2500 manage.py\r\n<span class=\"gi\">+         \u251c\u2500\u2500\u2500 config\r\n<\/span>          \u2502       \u251c\u2500\u2500\u2500 __init__.py\r\n          \u2502       \u251c\u2500\u2500\u2500 asgi.py\r\n          \u2502       \u251c\u2500\u2500\u2500 settings.py\r\n          \u2502       \u251c\u2500\u2500\u2500 urls.py\r\n          \u2502       \u2514\u2500\u2500\u2500 wsgi.py\r\n          \u251c\u2500\u2500\u2500 myapp\r\n          \u2502       \u251c\u2500\u2500\u2500 migrations\r\n          \u2502       \u2502       \u2514\u2500\u2500\u2500__init__.py\r\n          \u2502       \u251c\u2500\u2500\u2500 __init__.py\r\n          \u2502       \u251c\u2500\u2500\u2500 admin.py\r\n          \u2502       \u251c\u2500\u2500\u2500 apps.py\r\n          \u2502       \u251c\u2500\u2500\u2500 models.py\r\n          \u2502       \u251c\u2500\u2500\u2500 tests.py\r\n          \u2502       \u2514\u2500\u2500\u2500 views.py\r\n<span class=\"gi\">+         \u251c\u2500\u2500\u2500 static\r\n+         \u2514\u2500\u2500\u2500 templates\r\n<\/span>\r\n<\/code><\/pre>\n<h3>\u521b\u5efa\u76ee\u5f55<\/h3>\n<p>\u6839\u636e\u9700\u8981\uff0c\u5728\u76ee\u5f55\u4e0b\u4f7f\u7528 &#8220;mkdir&#8221; \u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a &#8220;\u4f5c\u6210\u3059\u308b\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u540d&#8221; \u7684\u6587\u4ef6\u5939\u3002<\/p>\n<pre class=\"post-pre\"><code>dev\/django&gt; mkdir mysite\r\n\r\n\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\uff1a C:\\Users\\dev\\django\r\n\r\nMode   LastWriteTime Length Name\r\n----   ------------- ------ ----\r\nd----- 1601\/01\/01     00:00 mysite\r\n\r\ndev\/django&gt;\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>  dev\/django\r\n<span class=\"gi\">+ \u2514\u2500\u2500\u2500 mysite\r\n<\/span><\/code><\/pre>\n<p>\u79fb\u52a8\u5230\u521a\u521b\u5efa\u7684\u76ee\u5f55\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code>dev\/django&gt; cd mysite\r\ndev\/django\/mysite&gt;\r\n<\/code><\/pre>\n<h3>\u521b\u5efa\u9879\u76ee\u3002<\/h3>\n<p>\u5f00\u59cb\u9879\u76ee \u5efa\u7acb\u76ee\u5f55\u540d\u79f0 \u5efa\u7acb\u5c42\u6b21<br \/>\n\u4e0e\u4e0a\u6b21\u4e0d\u540c\u4e4b\u5904\u5728\u4e8e\u63d0\u4f9b\u4e86\u5efa\u7acb\u5c42\u6b21\u7684\u53c2\u6570\u3002<br \/>\n. \u8868\u793a\u5f53\u524d\u5c42\u6b21\u3002\u5982\u679c\u8f93\u5165 mkdir .\/aaa\uff0c\u5219\u5728\u5f53\u524d\u5c42\u6b21\u4e0b\u521b\u5efa\u540d\u4e3a aaa \u7684\u6587\u4ef6\u5939\u3002<\/p>\n<pre class=\"post-pre\"><code>dev\/django\/mysite&gt; django-admin startproject config .\r\ndev\/django\/mysite&gt;\r\n<\/code><\/pre>\n<p>\u53c8\u6216\u8005 hu\u00f2 zh\u011b)<\/p>\n<pre class=\"post-pre\"><code>dev\/django\/mysite&gt; py -m django startproject config .\r\ndev\/django\/mysite&gt;\r\n<\/code><\/pre>\n<p>\u867d\u7136\u6ca1\u6709\u53d6\u5f97\u6210\u529f\uff0c\u4f46\u76ee\u5f55\u6301\u7eed\u589e\u52a0\u7740\u3002<\/p>\n<pre class=\"post-pre\"><code>  dev\/django\r\n  \u2514\u2500\u2500\u2500 mysite\r\n<span class=\"gi\">+         \u251c\u2500\u2500\u2500 manage.py\r\n+         \u2514\u2500\u2500\u2500 config\r\n+                 \u251c\u2500\u2500\u2500 __init__.py\r\n+                 \u251c\u2500\u2500\u2500 asgi.py\r\n+                 \u251c\u2500\u2500\u2500 settings.py\r\n+                 \u251c\u2500\u2500\u2500 urls.py\r\n+                 \u2514\u2500\u2500\u2500 wsgi.py\r\n<\/span><\/code><\/pre>\n<h3>\u521b\u5efa\u9759\u6001\u548c\u6a21\u677f\u6587\u4ef6\u5939\u3002<\/h3>\n<p>\u5728\u540c\u4e00\u4e2a\u5c42\u4e2d\uff0c\u4e5f\u8981\u521b\u5efa\u4e00\u4e2a\u9759\u6001(static)\u548c\u6a21\u677f(templates)\u6587\u4ef6\u5939\u3002<\/p>\n<pre class=\"post-pre\"><code>dev\/django\/mysite&gt;mkdir static\r\ndev\/django\/mysite&gt;mkdir templates\r\n<\/code><\/pre>\n<p>\u9759\u6001\u6587\u4ef6\u5939\uff0c\u7528\u4e8e\u5b58\u50a8CSS\u3001JavaScript\u3001\u56fe\u7247\u7b49\u9759\u6001\u6587\u4ef6\u3002<\/p>\n<p>\u6a21\u677f\u6587\u4ef6\u593e\uff0c\u7528\u65bc\u5b58\u653eHTML\u3002<\/p>\n<pre class=\"post-pre\"><code>  dev\/django\r\n  \u2514\u2500\u2500\u2500 mysite\r\n          \u251c\u2500\u2500\u2500 manage.py\r\n          \u251c\u2500\u2500\u2500 config\r\n          \u2502       \u251c\u2500\u2500\u2500 __init__.py\r\n          \u2502       \u251c\u2500\u2500\u2500 asgi.py\r\n          \u2502       \u251c\u2500\u2500\u2500 settings.py\r\n          \u2502       \u251c\u2500\u2500\u2500 urls.py\r\n          \u2502       \u2514\u2500\u2500\u2500 wsgi.py\r\n<span class=\"gi\">+         \u251c\u2500\u2500\u2500 static\r\n+         \u2514\u2500\u2500\u2500 templates\r\n<\/span><\/code><\/pre>\n<h3>\u521b\u5efa\u7f51\u7edc\u5e94\u7528\u7a0b\u5e8f<\/h3>\n<pre class=\"post-pre\"><code>dev\/django\/mysite&gt; py manage.py startapp myapp\r\ndev\/django\/mysite&gt;\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code>  dev\/django\r\n  \u2514\u2500\u2500\u2500 mysite\r\n          \u251c\u2500\u2500\u2500 manage.py\r\n          \u251c\u2500\u2500\u2500 config\r\n          \u2502       \u251c\u2500\u2500\u2500 __init__.py\r\n          \u2502       \u251c\u2500\u2500\u2500 asgi.py\r\n          \u2502       \u251c\u2500\u2500\u2500 settings.py\r\n          \u2502       \u251c\u2500\u2500\u2500 urls.py\r\n          \u2502       \u2514\u2500\u2500\u2500 wsgi.py\r\n<span class=\"gi\">+         \u251c\u2500\u2500\u2500 myapp\r\n+         \u2502       \u251c\u2500\u2500\u2500 migrations\r\n+         \u2502       \u2502       \u2514\u2500\u2500\u2500__init__.py\r\n+         \u2502       \u251c\u2500\u2500\u2500 __init__.py\r\n+         \u2502       \u251c\u2500\u2500\u2500 admin.py\r\n+         \u2502       \u251c\u2500\u2500\u2500 apps.py\r\n+         \u2502       \u251c\u2500\u2500\u2500 models.py\r\n+         \u2502       \u251c\u2500\u2500\u2500 tests.py\r\n+         \u2502       \u2514\u2500\u2500\u2500 views.py\r\n<\/span>          \u251c\u2500\u2500\u2500 static\r\n          \u2514\u2500\u2500\u2500 templates\r\n<\/code><\/pre>\n<h2>\u66f4\u6539\u8bbe\u7f6e<\/h2>\n<p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6 config\/settings.py\u3002<\/p>\n<h3>\u8bed\u8a00<\/h3>\n<p>\u5c06LANGUAGE_CODE\u4ece&#8217;en-us&#8217;\u66f4\u6539\u4e3a&#8217;ja&#8217;\u3002<br \/>\n\u4f60\u53ef\u4ee5\u6eda\u52a8\u67e5\u627e\uff0c\u4f46\u7528Ctrl + F\u641c\u7d22\u4f1a\u66f4\u65b9\u4fbf\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gd\">- LANGUAGE_CODE = 'en-us'\r\n<\/span><span class=\"gi\">+ LANGUAGE_CODE = 'ja'\r\n<\/span><\/code><\/pre>\n<h3>\u65f6\u533a<\/h3>\n<p>\u5c06 TIME_ZONE \u4ece &#8216;UTC&#8217; \u66f4\u6539\u4e3a &#8216;Asia\/Tokyo&#8217;\u3002<br \/>\n\u5b83\u4f4d\u4e8e\u521a\u521a\u7f16\u8f91\u7684 LANGUAGE_CODE \u7684\u4e0b\u65b9\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gd\">- TIME_ZONE = 'UTC'\r\n<\/span><span class=\"gi\">+ TIME_ZONE = 'Asia\/Tokyo'\r\n<\/span><\/code><\/pre>\n<h3>\u8bf7\u53c2\u8003\u4ee5\u4e0b\u9009\u9879\u3002<\/h3>\n<p>\u5c06\u5148\u524d\u521b\u5efa\u7684\u9759\u6001\u548c\u6a21\u677f\u6587\u4ef6\u5939\u6ce8\u518c\u4e3a\u5f15\u7528\u76ee\u5f55\u3002<\/p>\n<pre class=\"post-pre\"><code>  TEMPLATES = [\r\n      {\r\n          'BACKEND': 'django.template.backends.django.DjangoTemplates',\r\n<span class=\"gd\">-         'DIRS': [],\r\n<\/span><span class=\"gi\">+         'DIRS': [Path(BASE_DIR) \/ 'templates'],\r\n<\/span>          'APP_DIRS': True,\r\n          'OPTIONS': {\r\n              'context_processors': [\r\n                  'django.template.context_processors.debug',\r\n                  'django.template.context_processors.request',\r\n                  'django.contrib.auth.context_processors.auth',\r\n                  'django.contrib.messages.context_processors.messages',\r\n              ],\r\n          },\r\n      },\r\n  ]\r\n  \r\n ~~~~~~~~~~~~~~~~~~~~\r\n  \r\n  STATIC_URL = 'static\/'\r\n<span class=\"gi\">+ STATIC_ROOT = Path(BASE_DIR) \/ 'static'\r\n<\/span><\/code><\/pre>\n<h3>\u6ce8\u518c\u521b\u5efa\u7684\u5e94\u7528\u7a0b\u5e8f<\/h3>\n<p>\u6ce8\u518c\u6211\u7684\u5e94\u7528\u7a0b\u5e8fmyapp\u3002<\/p>\n<pre class=\"post-pre\"><code>  INSTALLED_APPS = [\r\n      'django.contrib.admin',\r\n      'django.contrib.auth',\r\n      'django.contrib.contenttypes',\r\n      'django.contrib.sessions',\r\n      'django.contrib.messages',\r\n      'django.contrib.staticfiles',\r\n<span class=\"gi\">+     'myapp',\r\n<\/span>  ]\r\n<\/code><\/pre>\n<p>\u53ef\u4ee5\u53ea\u5728\u672b\u5c3e\u6dfb\u52a0\u5373\u53ef\uff0c\u5373\u4f7f\u4ee5\u201c\u3067\u201d\u7ed3\u5c3e\u4e5f\u6ca1\u95ee\u9898\u3002<\/p>\n<h2>\u786e\u8ba4\u542f\u52a8<\/h2>\n<p>\u786e\u8ba4\u662f\u5426\u901a\u8fc7runserver\u542f\u52a8<\/p>\n<pre class=\"post-pre\"><code>dev\/django\/mysite&gt; py manage.py runserver\r\n<\/code><\/pre>\n<p>\u5f53\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee http:\/\/127.0.0.1:8000\/ \u5e76\u663e\u793a\u51fa\u6765\u65f6\uff0c\u8868\u793a\u4e00\u5207\u6b63\u5e38\u3002<\/p>\n<h1>\u4ece\u96f6\u5f00\u59cb\u7684Django\u7cfb\u5217\uff0c\u771f\u7684\u5417\uff1f<\/h1>\n<p>\u4e0b\u4e00\u6b21\u7684\u5e94\u7528\u7a0b\u5e8f\u521b\u5efa\u7bc7<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f53\u524d\u7684\u60c5\u51b5 \u597d\u5427\uff0c\u4e0a\u6b21\u6211\u4eec\u603b\u7b97\u5728\u6d4f\u89c8\u5668\u4e0a\u663e\u793a\u6210\u529f\u4e86\u3002 dev\/django &#8211; \u2514\u2500\u2500\u2500 mysite \u251c\u2500\u2500 [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-49284","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"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>\u4ece\u5934\u5b66\u4e60Django 2 - \u4fee\u6539\u8bbe\u7f6e.py\u6587\u4ef6 - Blog - Silicon Cloud<\/title>\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\/\u4ece\u5934\u5b66\u4e60django-2-\u4fee\u6539\u8bbe\u7f6e-py\u6587\u4ef6\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u4ece\u5934\u5b66\u4e60Django 2 - \u4fee\u6539\u8bbe\u7f6e.py\u6587\u4ef6\" \/>\n<meta property=\"og:description\" content=\"\u5f53\u524d\u7684\u60c5\u51b5 \u597d\u5427\uff0c\u4e0a\u6b21\u6211\u4eec\u603b\u7b97\u5728\u6d4f\u89c8\u5668\u4e0a\u663e\u793a\u6210\u529f\u4e86\u3002 dev\/django - \u2514\u2500\u2500\u2500 mysite \u251c\u2500\u2500 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u4ece\u5934\u5b66\u4e60django-2-\u4fee\u6539\u8bbe\u7f6e-py\u6587\u4ef6\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-12-01T10:28:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-29T03:25:39+00:00\" \/>\n<meta name=\"author\" content=\"\u65b0, \u97f5\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u65b0, \u97f5\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \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%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/\",\"name\":\"\u4ece\u5934\u5b66\u4e60Django 2 - \u4fee\u6539\u8bbe\u7f6e.py\u6587\u4ef6 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-12-01T10:28:32+00:00\",\"dateModified\":\"2024-04-29T03:25:39+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%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\":\"\u4ece\u5934\u5b66\u4e60Django 2 &#8211; \u4fee\u6539\u8bbe\u7f6e.py\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\/4ba4019495123db3038fd0809e6959c9\",\"name\":\"\u65b0, \u97f5\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g\",\"caption\":\"\u65b0, \u97f5\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%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":"\u4ece\u5934\u5b66\u4e60Django 2 - \u4fee\u6539\u8bbe\u7f6e.py\u6587\u4ef6 - Blog - Silicon Cloud","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\/\u4ece\u5934\u5b66\u4e60django-2-\u4fee\u6539\u8bbe\u7f6e-py\u6587\u4ef6\/","og_locale":"zh_CN","og_type":"article","og_title":"\u4ece\u5934\u5b66\u4e60Django 2 - \u4fee\u6539\u8bbe\u7f6e.py\u6587\u4ef6","og_description":"\u5f53\u524d\u7684\u60c5\u51b5 \u597d\u5427\uff0c\u4e0a\u6b21\u6211\u4eec\u603b\u7b97\u5728\u6d4f\u89c8\u5668\u4e0a\u663e\u793a\u6210\u529f\u4e86\u3002 dev\/django - \u2514\u2500\u2500\u2500 mysite \u251c\u2500\u2500 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u4ece\u5934\u5b66\u4e60django-2-\u4fee\u6539\u8bbe\u7f6e-py\u6587\u4ef6\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-12-01T10:28:32+00:00","article_modified_time":"2024-04-29T03:25:39+00:00","author":"\u65b0, \u97f5","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u65b0, \u97f5","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/","name":"\u4ece\u5934\u5b66\u4e60Django 2 - \u4fee\u6539\u8bbe\u7f6e.py\u6587\u4ef6 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-12-01T10:28:32+00:00","dateModified":"2024-04-29T03:25:39+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/4ba4019495123db3038fd0809e6959c9"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%e6%96%87%e4%bb%b6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%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":"\u4ece\u5934\u5b66\u4e60Django 2 &#8211; \u4fee\u6539\u8bbe\u7f6e.py\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\/4ba4019495123db3038fd0809e6959c9","name":"\u65b0, \u97f5","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d484b6c6e4ae82e8a9efea989e1d2af46d9b6ef128101e63b18f559fca0ae627?s=96&d=mm&r=g","caption":"\u65b0, \u97f5"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yunxin\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e4%bb%8e%e5%a4%b4%e5%ad%a6%e4%b9%a0django-2-%e4%bf%ae%e6%94%b9%e8%ae%be%e7%bd%ae-py%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\/49284","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\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=49284"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/49284\/revisions"}],"predecessor-version":[{"id":84988,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/49284\/revisions\/84988"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=49284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=49284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=49284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}