{"id":49730,"date":"2023-12-24T21:45:50","date_gmt":"2023-01-27T18:33:39","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/"},"modified":"2024-05-04T15:13:29","modified_gmt":"2024-05-04T07:13:29","slug":"%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/","title":{"rendered":"\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86Django3.0\u7684\u5f02\u6b65\u670d\u52a1\u5668"},"content":{"rendered":"<h1>\u5e8f\u8a00<\/h1>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8d06913a08637a6d22d7\/1-0.jpeg\" alt=\"maxresdefault.jpg\" \/><\/div>\n<p>\u4e09\u5929\u524d\uff0cDjango 3.0 \u6b63\u5f0f\u53d1\u5e03\u4e86\u3002<br \/>\n\u53d1\u5e03\u8282\u70b9\u94fe\u63a5<br \/>\n\u5728\u4f17\u591a\u6539\u52a8\u4e2d\uff0c\u6211\u5bf9\u589e\u52a0 ASGI \u7684\u652f\u6301\u975e\u5e38\u611f\u5174\u8da3\uff0c<br \/>\n\u6211\u771f\u7684\u60f3\u4eb2\u81ea\u8bd5\u7528\u4e00\u4e0b\u3002<\/p>\n<h4>\u88dc\u5145\u4e00\u4e0b\uff1aASGI\u662f\u4ec0\u9ebc\uff1f<\/h4>\n<pre class=\"post-pre\"><code>ASGI\uff08\u975e\u540c\u671f\u30b5\u30fc\u30d0\u30fc\u30b2\u30fc\u30c8\u30a6\u30a7\u30a4\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\uff09\u306f\u3001WSGI\u306e\u7cbe\u795e\u7684\u306a\u5f8c\u7d99\u8005\u3067\u3042\u308a\u3001\u975e\u540c\u671f\u5bfe\u5fdc\u306ePython Web\u30b5\u30fc\u30d0\u30fc\u3001\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3001\u304a\u3088\u3073\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u9593\u306e\u6a19\u6e96\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30a4\u30b9\u3092\u63d0\u4f9b\u3059\u308b\u3053\u3068\u3092\u76ee\u7684\u3068\u3057\u3066\u3044\u307e\u3059\u3002\r\n\r\nWSGI\u304c\u540c\u671fPython\u30a2\u30d7\u30ea\u306e\u6a19\u6e96\u3092\u63d0\u4f9b\u3057\u305f\u306e\u306b\u5bfe\u3057\u3001ASGI\u306f\u3001WSGI\u306e\u4e0b\u4f4d\u4e92\u63db\u6027\u306e\u5b9f\u88c5\u3068\u8907\u6570\u306e\u30b5\u30fc\u30d0\u30fc\u3068\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u5099\u3048\u305f\u975e\u540c\u671f\u30a2\u30d7\u30ea\u3068\u540c\u671f\u30a2\u30d7\u30ea\u306e\u4e21\u65b9\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002\r\n<\/code><\/pre>\n<p>\u6587\u6863\u94fe\u63a5<\/p>\n<h1>\u5168\u65b0\u7684\u9879\u76ee<\/h1>\n<p>\u6211\u5c06\u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u6d4b\u8bd5\u7684\u865a\u62df\u73af\u5883\u3002<\/p>\n<pre class=\"post-pre\"><code> mkvirtualenv django3.0\r\n<\/code><\/pre>\n<p>\u5b89\u88c5Django<\/p>\n<pre class=\"post-pre\"><code> pip3 <span class=\"nb\">install <\/span>django\r\n<\/code><\/pre>\n<p>\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u786e\u8ba4Django3.0\u5df2\u7ecf\u5b89\u88c5\u597d\u3002<\/p>\n<pre class=\"post-pre\"><code>(django3.0) ~ $ pip3 list\r\nPackage    Version\r\n---------- -------\r\nasgiref    3.2.3  \r\nDjango     3.0    \r\npip        19.3.1 \r\npytz       2019.3 \r\nsetuptools 42.0.2 \r\nsqlparse   0.3.0  \r\nwheel      0.33.6\r\n<\/code><\/pre>\n<p>\u6211\u4eec\u968f\u610f\u521b\u5efa\u4e00\u4e2a\u65b0\u9879\u76ee\uff0c\u7136\u540e\u542f\u52a8\u670d\u52a1\u5668\u770b\u770b\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">mkdir <\/span>django-test\r\n<span class=\"o\">&amp;&amp;<\/span>\r\ndjango-admin startproject newtest\r\n<span class=\"o\">&amp;&amp;<\/span>\r\n<span class=\"nb\">cd <\/span>newtest\/\r\n<span class=\"o\">&amp;&amp;<\/span>\r\npython3 manage.py runserver\r\n<\/code><\/pre>\n<p>\u6211\u5011\u8a66\u8457\u5c07\u8a2a\u5b58\u53d68000\u756a\uff0c\u60a8\u5c07\u80fd\u5920\u770b\u5230\u719f\u6089\u7684\u706b\u7bad\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8d06913a08637a6d22d7\/16-0.jpeg\" alt=\"UNADJUSTEDNONRAW_thumb_38.jpg\" \/><\/div>\n<h1>\u6211\u4eec\u6765\u770b\u4e00\u4e0b\u516c\u5f0f\u6587\u6863\u3002<\/h1>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8d06913a08637a6d22d7\/18-0.jpeg\" alt=\"2019-12-05 19.17\u306e\u30a4\u30e1\u30fc\u30b7\u3099.jpg\" \/><\/div>\n<pre class=\"post-pre\"><code>How to deploy with ASGI\u00b6\r\nAs well as WSGI, Django also supports deploying on ASGI, the emerging Python standard for asynchronous web servers and applications.\r\n\r\nDjango\u2019s startproject management command sets up a default ASGI configuration for you, which you can tweak as needed for your project, and direct any ASGI-compliant application server to use.\r\n\r\nDjango includes getting-started documentation for the following ASGI servers:\r\n\r\nHow to use Django with Daphne\r\nHow to use Django with Uvicorn\r\nThe application object\u00b6\r\nLike WSGI, ASGI has you supply an application callable which the application server uses to communicate with your code. It\u2019s commonly provided as an object named application in a Python module accessible to the server.\r\n\r\nThe startproject command creates a file &lt;project_name&gt;\/asgi.py that contains such an application callable.\r\n\r\nIt\u2019s not used by the development server (runserver), but can be used by any ASGI server either in development or in production.\r\n\r\nASGI servers usually take the path to the application callable as a string; for most Django projects, this will look like myproject.asgi:application.\r\n\r\nWarning\r\n\r\nWhile Django\u2019s default ASGI handler will run all your code in a synchronous thread, if you choose to run your own async handler you must be aware of async-safety.\r\n\r\nDo not call blocking synchronous functions or libraries in any async code. Django prevents you from doing this with the parts of Django that are not async-safe, but the same may not be true of third-party apps or Python libraries.\r\n\r\nConfiguring the settings module\u00b6\r\nWhen the ASGI server loads your application, Django needs to import the settings module \u2014 that\u2019s where your entire application is defined.\r\n\r\nDjango uses the DJANGO_SETTINGS_MODULE environment variable to locate the appropriate settings module. It must contain the dotted path to the settings module. You can use a different value for development and production; it all depends on how you organize your settings.\r\n\r\nIf this variable isn\u2019t set, the default asgi.py sets it to mysite.settings, where mysite is the name of your project.\r\n\r\nApplying ASGI middleware\u00b6\r\nTo apply ASGI middleware, or to embed Django in another ASGI application, you can wrap Django\u2019s application object in the asgi.py file. For example:\r\n\r\nfrom some_asgi_library import AmazingMiddleware\r\napplication = AmazingMiddleware(application)\r\n<\/code><\/pre>\n<p>Link<br \/>\n\u94fe\u63a5<\/p>\n<h4>\u603b\u4e4b\u53ef\u4ee5\u6982\u62ec\u4e3a<\/h4>\n<p>python manage.py runserver\u3067\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5\u3057\u3066\u306f\u3044\u3051\u306a\u3044\u3001\u3044\u3064\u3082\u306ewsgi\u306e\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30b5\u30fc\u30d0\u30fc\u8d77\u52d5\u6642\u306bDaphne\u304bUvicorn\u4f7f\u7528\u3059\u308b\u3053\u3068\u304a\u52e7\u3081\u3057\u307e\u3059\u3002<\/p>\n<p>\u8ba9\u6211\u4eec\u6253\u5f00\u5b98\u65b9\u94fe\u63a5\u6765\u770b\u770bDaphne\u662f\u4ec0\u4e48\u3002<\/p>\n<pre class=\"post-pre\"><code>How to use Django with Daphne\u00b6\r\nDaphne is a pure-Python ASGI server for UNIX, maintained by members of the Django project. It acts as the reference server for ASGI.\r\n\r\nInstalling Daphne\u00b6\r\nYou can install Daphne with pip:\r\n\r\npython -m pip install daphne\r\nRunning Django in Daphne\u00b6\r\nWhen Daphne is installed, a daphne command is available which starts the Daphne server process. At its simplest, Daphne needs to be called with the location of a module containing an ASGI application object, followed by what the application is called (separated by a colon).\r\n\r\nFor a typical Django project, invoking Daphne would look like:\r\n\r\ndaphne myproject.asgi:application\r\nThis will start one process listening on 127.0.0.1:8000. It requires that your project be on the Python path; to ensure that run this command from the same directory as your manage.py file.\r\n<\/code><\/pre>\n<p>\u4ee5\u4e0b\u662f\u5c06\u5176\u7ffb\u8bd1\u6210\u4e2d\u6587\u7684\u7248\u672c\uff1a<br \/>\n&#8211; \u4f7f\u7528pip\u5b89\u88c5daphne<br \/>\n&#8211; \u8fd0\u884cdaphne myproject.asgi:application\u542f\u52a8ASGI\u670d\u52a1\u5668<br \/>\n&#8211; \u8bbf\u95ee127.0.0.1:8000<\/p>\n<p>\u8ba9\u6211\u4eec\u8bd5\u8bd5\u770b<\/p>\n<h1>\u542f\u52a8ASGI\u670d\u52a1\u5668<\/h1>\n<p>\u5b89\u88c5Daphne<\/p>\n<pre class=\"post-pre\"><code> pip3 install daphne\r\n<\/code><\/pre>\n<p>\u542f\u52a8\u670d\u52a1\u5668<\/p>\n<pre class=\"post-pre\"><code>daphne [\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d].asgi:application\r\n<\/code><\/pre>\n<p>\u5f53\u6211\u8bbf\u95ee\u4e868000\u6b21\u540e\uff0c\u53c8\u770b\u5230\u4e86\u706b\u7bad\uff0c\u5c3d\u7ba1\u6587\u5b57\u7565\u6709\u4e0d\u540c\u3002<\/p>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8d06913a08637a6d22d7\/33-0.jpeg\" alt=\"2019-12-05 19.59\u306e\u30a4\u30e1\u30fc\u30b7\u3099.jpg\" \/><\/div>\n<h1>WebSocket\u6d4b\u8bd5<\/h1>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8d06913a08637a6d22d7\/35-0.jpeg\" alt=\"UNADJUSTEDNONRAW_mini_3b.jpg\" \/><\/div>\n<p>\u6536\u5230\u4e86\u9519\u8bef\u4ee3\u7801500\uff0c\u9519\u8bef\u4fe1\u606f\u5982\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code>2019-12-05 11:02:09,533 ERROR    Exception inside application: Django can only handle ASGI\/HTTP connections, not websocket.\r\n  File \"\/Envs\/django3.0\/lib\/python3.7\/site-packages\/daphne\/cli.py\", line 30, in asgi\r\n    await self.app(scope, receive, send)\r\n  File \"\/Envs\/django3.0\/lib\/python3.7\/site-packages\/django\/core\/handlers\/asgi.py\", line 146, in __call__\r\n    % scope['type']\r\n  Django can only handle ASGI\/HTTP connections, not websocket.\r\n<\/code><\/pre>\n<p>\u8ba9\u6211\u4eec\u770b\u770b asgi.py \u7684\u7b2c 146 \u884c\uff0c\u4f3c\u4e4e\u6709\u4e9b\u5185\u5bb9\u3002<\/p>\n<pre class=\"post-pre\"><code>\r\n <span class=\"k\">async<\/span> <span class=\"k\">def<\/span> <span class=\"nf\">__call__<\/span><span class=\"p\">(<\/span><span class=\"bp\">self<\/span><span class=\"p\">,<\/span> <span class=\"n\">scope<\/span><span class=\"p\">,<\/span> <span class=\"n\">receive<\/span><span class=\"p\">,<\/span> <span class=\"n\">send<\/span><span class=\"p\">):<\/span>\r\n        <span class=\"s\">\"\"\"\r\n        Async entrypoint - parses the request and hands off to get_response.\r\n        \"\"\"<\/span>\r\n        <span class=\"c1\"># Serve only HTTP connections.\r\n<\/span>        <span class=\"c1\"># FIXME: Allow to override this.\r\n<\/span>        <span class=\"k\">if<\/span> <span class=\"n\">scope<\/span><span class=\"p\">[<\/span><span class=\"s\">'type'<\/span><span class=\"p\">]<\/span> <span class=\"o\">!=<\/span> <span class=\"s\">'http'<\/span><span class=\"p\">:<\/span>\r\n            <span class=\"k\">raise<\/span> <span class=\"nb\">ValueError<\/span><span class=\"p\">(<\/span>\r\n                <span class=\"s\">'Django can only handle ASGI\/HTTP connections, not %s.'<\/span>\r\n                <span class=\"o\">%<\/span> <span class=\"n\">scope<\/span><span class=\"p\">[<\/span><span class=\"s\">'type'<\/span><span class=\"p\">]<\/span>\r\n            <span class=\"p\">)<\/span>\r\n        <span class=\"c1\"># Receive the HTTP request body as a stream object.\r\n<\/span>        <span class=\"k\">try<\/span><span class=\"p\">:<\/span>\r\n            <span class=\"n\">body_file<\/span> <span class=\"o\">=<\/span> <span class=\"k\">await<\/span> <span class=\"bp\">self<\/span><span class=\"p\">.<\/span><span class=\"n\">read_body<\/span><span class=\"p\">(<\/span><span class=\"n\">receive<\/span><span class=\"p\">)<\/span>\r\n        <span class=\"k\">except<\/span> <span class=\"n\">RequestAborted<\/span><span class=\"p\">:<\/span>\r\n            <span class=\"k\">return<\/span>\r\n        <span class=\"c1\"># Request is complete and can be served.\r\n<\/span>        <span class=\"n\">set_script_prefix<\/span><span class=\"p\">(<\/span><span class=\"bp\">self<\/span><span class=\"p\">.<\/span><span class=\"n\">get_script_prefix<\/span><span class=\"p\">(<\/span><span class=\"n\">scope<\/span><span class=\"p\">))<\/span>\r\n<\/code><\/pre>\n<p>\u8bf7\u6ce8\u610f\u4ee5\u4e0b\u4e24\u884c\u7684\u8bc4\u8bba\u3002<\/p>\n<pre class=\"post-pre\"><code> # Serve only HTTP connections.\r\n # FIXME: Allow to override this.\r\n<\/code><\/pre>\n<h3>\u76ee\u524d\u53ea\u5141\u8bb8HTTP\u901a\u4fe1\u3002\u8bf7\u6839\u636e\u9700\u8981\u81ea\u884c\u4fee\u6b63\uff01<\/h3>\n<h1>\u6700\u7ec8<\/h1>\n<p>\u4ee5\u4e0b\u662f\u53ef\u80fd\u7684\u539f\u56e0\u7684\u63a8\u6d4b\u3002<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">\u591a\u5206\u79c1\u306fDjango\u306e\u3053\u3068\u307e\u305f\u308f\u304b\u3063\u3066\u3044\u306a\u3044<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Websocket\u3067\u306f\u306a\u304f\u3066\u3001\u4ed6\u306e\u624b\u6bb5\u3067ASGI\u901a\u4fe1\u3092\u5b9f\u73fe\u3057\u3066\u3044\u308b<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">ASGI\u306e\u5b8c\u5168\u30b5\u30dd\u30fc\u30c8\u306f\u3053\u308c\u304b\u3089<\/ul>\n<p>\u5982\u679c\u60f3\u8981\u5728\u5f53\u524d\u7684Django 3.0\u7248\u672c\u4e2d\u4f7f\u7528WebSocket\uff0c\u5efa\u8bae\u4f7f\u7528django-channels\u5305\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e8f\u8a00 \u4e09\u5929\u524d\uff0cDjango 3.0 \u6b63\u5f0f\u53d1\u5e03\u4e86\u3002 \u53d1\u5e03\u8282\u70b9\u94fe\u63a5 \u5728\u4f17\u591a\u6539\u52a8\u4e2d\uff0c\u6211\u5bf9\u589e\u52a0 ASGI \u7684\u652f\u6301\u975e\u5e38\u611f [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-49730","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>\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86Django3.0\u7684\u5f02\u6b65\u670d\u52a1\u5668 - 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\/\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86django3-0\u7684\u5f02\u6b65\u670d\u52a1\u5668\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86Django3.0\u7684\u5f02\u6b65\u670d\u52a1\u5668\" \/>\n<meta property=\"og:description\" content=\"\u5e8f\u8a00 \u4e09\u5929\u524d\uff0cDjango 3.0 \u6b63\u5f0f\u53d1\u5e03\u4e86\u3002 \u53d1\u5e03\u8282\u70b9\u94fe\u63a5 \u5728\u4f17\u591a\u6539\u52a8\u4e2d\uff0c\u6211\u5bf9\u589e\u52a0 ASGI \u7684\u652f\u6301\u975e\u5e38\u611f [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86django3-0\u7684\u5f02\u6b65\u670d\u52a1\u5668\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-27T18:33:39+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-04T07:13:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8d06913a08637a6d22d7\/1-0.jpeg\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \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\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/\",\"name\":\"\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86Django3.0\u7684\u5f02\u6b65\u670d\u52a1\u5668 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-01-27T18:33:39+00:00\",\"dateModified\":\"2024-05-04T07:13:29+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86Django3.0\u7684\u5f02\u6b65\u670d\u52a1\u5668\"}]},{\"@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\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86Django3.0\u7684\u5f02\u6b65\u670d\u52a1\u5668 - 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\/\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86django3-0\u7684\u5f02\u6b65\u670d\u52a1\u5668\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86Django3.0\u7684\u5f02\u6b65\u670d\u52a1\u5668","og_description":"\u5e8f\u8a00 \u4e09\u5929\u524d\uff0cDjango 3.0 \u6b63\u5f0f\u53d1\u5e03\u4e86\u3002 \u53d1\u5e03\u8282\u70b9\u94fe\u63a5 \u5728\u4f17\u591a\u6539\u52a8\u4e2d\uff0c\u6211\u5bf9\u589e\u52a0 ASGI \u7684\u652f\u6301\u975e\u5e38\u611f [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86django3-0\u7684\u5f02\u6b65\u670d\u52a1\u5668\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-01-27T18:33:39+00:00","article_modified_time":"2024-05-04T07:13:29+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8d06913a08637a6d22d7\/1-0.jpeg"}],"author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/","name":"\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86Django3.0\u7684\u5f02\u6b65\u670d\u52a1\u5668 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-01-27T18:33:39+00:00","dateModified":"2024-05-04T07:13:29+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u6211\u4eb2\u8eab\u4f53\u9a8c\u4e86Django3.0\u7684\u5f02\u6b65\u670d\u52a1\u5668"}]},{"@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\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e4%ba%b2%e8%ba%ab%e4%bd%93%e9%aa%8c%e4%ba%86django3-0%e7%9a%84%e5%bc%82%e6%ad%a5%e6%9c%8d%e5%8a%a1%e5%99%a8%e3%80%82\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/49730","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\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=49730"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/49730\/revisions"}],"predecessor-version":[{"id":99075,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/49730\/revisions\/99075"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=49730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=49730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=49730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}