{"id":49280,"date":"2023-12-10T16:30:04","date_gmt":"2022-12-30T19:04:28","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/"},"modified":"2024-05-04T12:58:25","modified_gmt":"2024-05-04T04:58:25","slug":"%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/","title":{"rendered":"[\u9488\u5bf9\u521d\u5b66\u8005] \u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\u5305\u7ba1\u7406\u7b49\uff0c\u5168\u9762\u89e3\u91ca\u8bf4\u660e"},"content":{"rendered":"<h2>\u8bd7\u6b4c\u662f\u4ec0\u4e48\uff1f<\/h2>\n<p>\u6b63\u5982\u516c\u5f0f\u6587\u4ef6\u6240\u8ff0\uff0cPoetry\u662f\u7ba1\u7406Python\u8f6f\u4ef6\u5305\u7684\u5de5\u5177\u3002\u901a\u8fc7\u4f7f\u7528Poetry\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u6839\u636e\u7248\u672c\u66f4\u65b0\u548c\u5b89\u88c5\u4e0e\u8f6f\u4ef6\u5305\u76f8\u5173\u7684\u5176\u4ed6\u8f6f\u4ef6\u5305\u3002\u4f7f\u7528Poetry\u5b89\u88c5\u7684\u8f6f\u4ef6\u5305\u4f4d\u4e8eVirtualenv\u73af\u5883\u4e2d\uff0c\u56e0\u6b64\u5728\u6267\u884c\u4e0e\u8f6f\u4ef6\u5305\u76f8\u5173\u7684\u547d\u4ee4\u65f6\uff0c\u5e94\u901a\u8fc7Poetry\u8fdb\u884c\u64cd\u4f5c\uff08\u540e\u9762\u4f1a\u8be6\u7ec6\u4ecb\u7ecd\uff09\u3002<\/p>\n<blockquote><p>\u8bd7\u6b4c\u662fPython\u4e2d\u7684\u4f9d\u8d56\u7ba1\u7406\u548c\u6253\u5305\u5de5\u5177\u3002\u5b83\u5141\u8bb8\u60a8\u58f0\u660e\u9879\u76ee\u6240\u4f9d\u8d56\u7684\u5e93\uff0c\u5e76\u4e3a\u60a8\u7ba1\u7406\uff08\u5b89\u88c5\/\u66f4\u65b0\uff09\u5b83\u4eec\u3002\u8bd7\u6b4c\u63d0\u4f9b\u9501\u6587\u4ef6\u4ee5\u786e\u4fdd\u53ef\u91cd\u590d\u5b89\u88c5\uff0c\u5e76\u53ef\u4ee5\u6784\u5efa\u60a8\u7684\u9879\u76ee\u8fdb\u884c\u5206\u53d1\u3002<\/p><\/blockquote>\n<h2>\u8bd7\u6b4c\u7684\u5b89\u88c5<\/h2>\n<p>\u8bf7\u6267\u884c\u4e0b\u9762\u516c\u5f0f\u4e2d\u63d0\u5230\u7684\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">curl -sSL https:\/\/install.python-poetry.org | python3 -\r\n<\/span><\/code><\/pre>\n<p>\u6839\u636e\u60c5\u51b5\uff0c\u5c06\u663e\u793a\u5982\u4e0b\u5185\u5bb9\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">curl -sSL https:\/\/install.python-poetry.org | python3 -\r\nRetrieving Poetry metadata\r\n\r\n<\/span><span class=\"gp\">#<\/span> Welcome to Poetry!\r\n<span class=\"go\">\r\nThis will download and install the latest version of Poetry,\r\na dependency and package manager for Python.\r\n\r\nIt will add the `poetry` command to Poetry's bin directory, located at:\r\n\r\n<\/span><span class=\"gp\">\/Users\/&lt;\u30e6\u30fc\u30b6\u540d&gt;<\/span>\/.local\/bin\r\n<span class=\"go\">\r\nYou can uninstall at any time by executing this script with the --uninstall option,\r\nand these changes will be reverted.\r\n\r\nInstalling Poetry (1.2.0): Done\r\n\r\nPoetry (1.2.0) is installed now. Great!\r\n\r\n<\/span><span class=\"gp\">To get started you need Poetry's bin directory (\/Users\/&lt;\u30e6\u30fc\u30b6\u540d&gt;<\/span>\/.local\/bin<span class=\"o\">)<\/span> <span class=\"k\">in <\/span>your <span class=\"sb\">`<\/span>PATH<span class=\"sb\">`<\/span>\r\n<span class=\"go\">environment variable.\r\n\r\n<\/span><span class=\"gp\">Add `export PATH=\"\/Users\/&lt;\u30e6\u30fc\u30b6\u540d&gt;<\/span>\/.local\/bin:<span class=\"nv\">$PATH<\/span><span class=\"s2\">\"<\/span><span class=\"sb\">`<\/span> to your shell configuration file.\r\n\r\n<span class=\"gp\">Alternatively, you can call Poetry explicitly with `\/Users\/&lt;\u30e6\u30fc\u30b6\u540d&gt;<\/span>\/.local\/bin\/poetry<span class=\"sb\">`<\/span><span class=\"nb\">.<\/span>\r\n<span class=\"go\">\r\nYou can test that everything is set up by executing:\r\n\r\n`poetry --version`\r\n<\/span><\/code><\/pre>\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">export PATH=\"\/Users\/&lt;\u30e6\u30fc\u30b6\u540d&gt;<\/span>\/.local\/bin:<span class=\"nv\">$PATH<\/span><span class=\"s2\">\"\r\n<\/span><\/code><\/pre>\n<p>\u6267\u884c\u540e\uff0c\u5c06\u4ee5\u4e0b\u5185\u5bb9\u6dfb\u52a0\u5230.zshrc\u6587\u4ef6\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nb\">export <\/span><span class=\"nv\">PATH<\/span><span class=\"o\">=<\/span><span class=\"s2\">\"<\/span><span class=\"nv\">$HOME<\/span><span class=\"s2\">\/.local\/bin:<\/span><span class=\"nv\">$PATH<\/span><span class=\"s2\">\"<\/span>\r\n<\/code><\/pre>\n<p>\u5173\u95ed\u7ec8\u7aef\u540e\u91cd\u65b0\u542f\u52a8\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry --version\r\n<\/span><\/code><\/pre>\n<p>\u8f93\u5165&#8221;\u3068&#8221;\uff0c\u7136\u540e\u51fa\u73b0\u7248\u672c\u4fe1\u606f\u5373\u7b97\u6210\u529f\uff01<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">Poetry (version 1.2.1)\r\n<\/span><\/code><\/pre>\n<h2>\u54e6-\u6211\u7684-zsh<\/h2>\n<p>\u5982\u679c\u5728oh-my-zsh\u4e2d\u5b89\u88c5poetry\u63d2\u4ef6\uff0c\u5c06\u4f1a\u4e30\u5bcc\u547d\u4ee4\u8865\u5168\u529f\u80fd\u3002\u9996\u5148\uff0c\u8f93\u5165\u4ee5\u4e0b\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"gp\">mkdir $<\/span>ZSH_CUSTOM\/plugins\/poetry\r\n<span class=\"gp\">poetry completions zsh &gt;<\/span> <span class=\"nv\">$ZSH_CUSTOM<\/span>\/plugins\/poetry\/_poetry\r\n<\/code><\/pre>\n<p>\u5c06poetry\u6dfb\u52a0\u5230.zshrc\u6587\u4ef6\u7684plugins\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code>plugins<span class=\"o\">(<\/span>\r\n\tpoetry\r\n\t...\r\n\t<span class=\"o\">)<\/span>\r\n<\/code><\/pre>\n<div><img decoding=\"async\" class=\"post-images\" title=\"\" src=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8a79913a08637a6ca0d6\/21-0.png\" alt=\"\u30b9\u30af\u30ea\u30fc\u30f3\u30b7\u30e7\u30c3\u30c8 2022-10-07 16.59.01.png\" \/><\/div>\n<h2>\u4e3b\u8981\u547d\u4ee4<\/h2>\n<p>\u4ee5\u4e0b\u662f\u4e3b\u8981\u7684\u547d\u4ee4\u5217\u4e3e\u3002<\/p>\n<h3>\u65b0\u5efa\u9879\u76ee<\/h3>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry new\r\n<\/span><\/code><\/pre>\n<h3>\u5c06Poetry\u5f15\u5165\u73b0\u6709\u9879\u76ee\u3002<\/h3>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry init\r\n<\/span><\/code><\/pre>\n<p>\u6267\u884c\u6b64\u64cd\u4f5c\u540e\uff0c\u60a8\u53ef\u4ee5\u5728\u73b0\u6709\u9879\u76ee\u4e2d\u4f7f\u7528Poetry\u3002\u4f8b\u5982\uff0c\u5982\u679c\u662fDjango\u9879\u76ee\uff0c\u5219\u9700\u8981\u5c06\u9879\u76ee\u540d\u79f0\u6307\u5b9a\u4e3a[tool.poetry]\u7684name\u624d\u80fd\u6b63\u5e38\u8fd0\u884c\u7a0b\u5e8f\uff0c\u6240\u4ee5\u9700\u8981\u6ce8\u610f\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nn\">[tool.poetry]<\/span>\r\n<span class=\"py\">name<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"&lt;\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u540d&gt;\"<\/span>\r\n<span class=\"py\">version<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"0.0.1\"<\/span>\r\n<span class=\"py\">description<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"\"<\/span>\r\n<span class=\"py\">authors<\/span> <span class=\"p\">=<\/span> <span class=\"p\">[<\/span><span class=\"s\">\"shun198 &lt;\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9&gt;\"<\/span><span class=\"p\">]<\/span>\r\n<span class=\"py\">readme<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"README.md\"<\/span>\r\n<\/code><\/pre>\n<h2>pyproject.toml\u548cpoetry.lock<\/h2>\n<p>\u4f7f\u7528Poetry\u5b89\u88c5\u6216\u66f4\u65b0\u8f6f\u4ef6\u5305\u65f6<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">pyproject.toml<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">poetry.lock<\/ul>\n<p>\u5728\u8fd9\u91cc\u63d0\u5230<\/p>\n<h2>\u8bd7\u6b4c\u7684\u547d\u4ee4\u5217\u8868<\/h2>\n<h3>\u6dfb\u52a0\u5957\u9910<\/h3>\n<pre class=\"post-pre\"><code>poetry add\u3000&lt;\u30d1\u30c3\u30b1\u30fc\u30b8\u540d&gt;\r\n<\/code><\/pre>\n<p>\u5982\u679c\u6307\u5b9a\u5b89\u88c5\u8f6f\u4ef6\u5305\uff0c\u5219\u4f1a\u4e00\u540c\u5b89\u88c5\u76f8\u5173\u8f6f\u4ef6\u5305\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry add redis\r\nUsing version ^4.3.4 for redis\r\n\r\nUpdating dependencies\r\nResolving dependencies... (0.9s)\r\n\r\nWriting lock file\r\n\r\nPackage operations: 6 installs, 0 updates, 0 removals\r\n\r\n  \u2022 Installing pyparsing (3.0.9)\r\n  \u2022 Installing wrapt (1.14.1)\r\n  \u2022 Installing async-timeout (4.0.2)\r\n  \u2022 Installing deprecated (1.2.13)\r\n  \u2022 Installing packaging (21.3)\r\n  \u2022 Installing redis (4.3.4)\r\n<\/span><\/code><\/pre>\n<h4>\u5c06\u5b89\u88c5\u5305\u5206\u5f00\u4e3a\u751f\u4ea7\u73af\u5883\u548c\u5f00\u53d1\u73af\u5883\u4f7f\u7528\u7684\u4e24\u4e2a\u7248\u672c\u3002<\/h4>\n<p>\u4e0d\u7528\u62c5\u5fc3\uff0cPoetry\u53ef\u4ee5\u8ba9\u60a8\u6309\u7ec4\u5b89\u88c5\u8f6f\u4ef6\u5305\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e2a\u9009\u9879\uff1a<\/p>\n<ul class=\"post-ul\">\n<li style=\"list-style-type: none;\">\n<ul class=\"post-ul\">Pytest\u95a2\u9023\u306e\u3082\u306e<\/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\">formatter<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<ul class=\"post-ul\">django-debug-toolbar\u306a\u3069\u30c7\u30d0\u30c3\u30b0\u7528<\/ul>\n<p>\u5c06\u8bf8\u5982dev\u7b49\u7684\u7a0b\u5e8f\u5305\u653e\u7f6e\u5728\u5f00\u53d1\u73af\u5883\u7ec4\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nn\">[tool.poetry.dependencies]<\/span>\r\n<span class=\"py\">python<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^3.10\"<\/span>\r\n<span class=\"py\">Django<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^4.1.2\"<\/span>\r\n<span class=\"py\">djangorestframework<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^3.14.0\"<\/span>\r\n<span class=\"py\">drf-spectacular<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^0.24.2\"<\/span>\r\n<span class=\"py\">mysqlclient<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^2.1.1\"<\/span>\r\n<span class=\"py\">gunicorn<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^20.1.0\"<\/span>\r\n<span class=\"py\">drf-nested-routers<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^0.93.4\"<\/span>\r\n<span class=\"py\">celery<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^5.2.7\"<\/span>\r\n<span class=\"py\">django-celery-beat<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^2.4.0\"<\/span>\r\n<span class=\"py\">redis<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^4.3.4\"<\/span>\r\n<span class=\"py\">django-cors-headers<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^3.13.0\"<\/span>\r\n<span class=\"py\">Authlib<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^1.1.0\"<\/span>\r\n<span class=\"py\">django-filter<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^22.1\"<\/span>\r\n<span class=\"py\">boto3<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^1.26.22\"<\/span>\r\n<span class=\"py\">django-ses<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^3.2.2\"<\/span>\r\n<span class=\"py\">django-storages<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^1.13.1\"<\/span>\r\n\r\n<span class=\"nn\">[tool.poetry.group.dev.dependencies]<\/span>\r\n<span class=\"py\">pytest<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^7.1.3\"<\/span>\r\n<span class=\"py\">pytest-cov<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^4.0.0\"<\/span>\r\n<span class=\"py\">pytest-django<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^4.5.2\"<\/span>\r\n<span class=\"py\">pytest-sugar<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^0.9.6\"<\/span>\r\n<span class=\"py\">pytest-xdist<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^3.0.2\"<\/span>\r\n<span class=\"py\">django-debug-toolbar<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^3.8.1\"<\/span>\r\n<span class=\"py\">pytest-custom-exit-code<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^0.3.0\"<\/span>\r\n<span class=\"py\">pytest-html<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^3.2.0\"<\/span>\r\n<span class=\"py\">allure-pytest<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^2.12.0\"<\/span>\r\n<span class=\"py\">black<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^22.10.0\"<\/span>\r\n<span class=\"py\">isort<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^5.11.4\"<\/span>\r\n<span class=\"py\">django-extensions<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^3.2.1\"<\/span>\r\n<\/code><\/pre>\n<h4>\u5f53\u8981\u5728\u7279\u5b9a\u7684\u7fa4\u4f53\u4e2d\u5b89\u88c5\u8f6f\u4ef6\u5305\u65f6\u3002<\/h4>\n<pre class=\"post-pre\"><code>poetry add &lt;\u30d1\u30c3\u30b1\u30fc\u30b8\u540d&gt; --group &lt;\u30b0\u30eb\u30fc\u30d7\u540d&gt;\r\n<\/code><\/pre>\n<p>\u6211\u6253\u7b97\u5c06pylint-django\u63d2\u4ef6\u6dfb\u52a0\u5230\u5f00\u53d1\u73af\u5883\u7684dev\u7ec4\u4e2d\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry add pylint-django --group dev\r\n<\/span><\/code><\/pre>\n<p>\u90a3\u4e48\uff0cpylint-django\u5c06\u5b89\u88c5\u5728dev\u7ec4\u4e2d\uff0c\u5177\u4f53\u5982\u4e0b\uff1a<\/p>\n<pre class=\"post-pre\"><code><span class=\"nn\">[tool.poetry.group.dev.dependencies]<\/span>\r\n<span class=\"py\">pylint-django<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"^2.5.3\"<\/span>\r\n<\/code><\/pre>\n<p>\u6b64\u5916\uff0c\u60a8\u8fd8\u53ef\u4ee5\u5728 [tool.poetry.group.dev.dependencies] \u4e0b\u76f4\u63a5\u6dfb\u52a0\u7528\u4e8e\u5f00\u53d1\u7684\u8f6f\u4ef6\u5305<\/p>\n<h3>\u5b89\u88c5\u8f6f\u4ef6\u5305<\/h3>\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u5c06\u5b89\u88c5\u6240\u6709\u7684\u8f6f\u4ef6\u5305\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry install\r\n<\/span><\/code><\/pre>\n<p>\u6b64\u5916\uff0c\u60a8\u4e5f\u53ef\u4ee5\u6309\u7167\u7ec4\u522b\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n<h4>\u5f53\u4f60\u53ea\u60f3\u8981\u5b89\u88c5\u7279\u5b9a\u7684\u7fa4\u4f53\u65f6<\/h4>\n<pre class=\"post-pre\"><code>poetry install --only &lt;\u30b0\u30eb\u30fc\u30d7\u540d&gt;\r\n<\/code><\/pre>\n<p>\u60a8\u4e5f\u53ef\u4ee5\u6307\u5b9a\u591a\u4e2a\u8f6f\u4ef6\u5305\uff0c\u5982\u4e0b\u6240\u793a\u3002<\/p>\n<pre class=\"post-pre\"><code>poetry install --only test,docs\r\n<\/code><\/pre>\n<h4>\u9664\u4e86\u7279\u5b9a\u7684\u7fa4\u7ec4\u5916\u5b89\u88c5\u5305\u65f6<\/h4>\n<pre class=\"post-pre\"><code>poetry install --without &lt;\u30b0\u30eb\u30fc\u30d7\u540d&gt;\r\n<\/code><\/pre>\n<p>\u4f8b\u5982\uff0c\u5728Stg\u73af\u5883\u548cPrd\u73af\u5883\u4e2d\uff0c\u6211\u8ba4\u4e3a\u4e0d\u9700\u8981\u5b89\u88c5\u8bf8\u5982Pytest\u548cdjango-debug-toolbar\u4e4b\u7c7b\u7684\u6d4b\u8bd5\u548c\u8c03\u8bd5\u5de5\u5177\u5305\u3002<br \/>\n\u60a8\u4e5f\u53ef\u4ee5\u5c06\u6d4b\u8bd5\u548c\u8c03\u8bd5\u5de5\u5177\u5305\u653e\u5165dev\u7ec4\uff0c\u5e76\u5728\u9664dev\u4e4b\u5916\u7684\u7ec4\u4e2d\u5b89\u88c5\u5176\u4ed6\u5305\u6765\u4f7f\u7528\u3002<\/p>\n<pre class=\"post-pre\"><code>poetry install --without dev\r\n<\/code><\/pre>\n<h3>\u66f4\u65b0\u8f6f\u4ef6\u5305<\/h3>\n<pre class=\"post-pre\"><code>poetry update &lt;\u30d1\u30c3\u30b1\u30fc\u30b8\u540d&gt;\r\n<\/code><\/pre>\n<h3>\u5220\u9664\u8f6f\u4ef6\u5305<\/h3>\n<pre class=\"post-pre\"><code>poetry remove &lt;\u30d1\u30c3\u30b1\u30fc\u30b8\u540d&gt;\r\n<\/code><\/pre>\n<p>\u53e6\u5916\uff0c\u60a8\u4e5f\u53ef\u4ee5\u76f4\u63a5\u4ecepyproject.toml\u6587\u4ef6\u4e2d\u5220\u9664\u5305\u4ee5\u5b9e\u73b0\u5220\u9664\u3002<\/p>\n<h3>\u8bd7\u6b4c\u81ea\u6211\u66f4\u65b0<\/h3>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry self update\r\n<\/span><\/code><\/pre>\n<h2>\u901a\u8fc7\u8bd7\u6b4c\u5b9e\u65bd\u547d\u4ee4<\/h2>\n<pre class=\"post-pre\"><code>poetry run &lt;\u30b3\u30de\u30f3\u30c9&gt;\r\n<\/code><\/pre>\n<p>\u4f7f\u7528Django\u6216\u5176\u4ed6Web\u6846\u67b6\u65f6\uff0c\u9700\u8981\u901a\u8fc7Poetry\u4e2d\u7684Python\u6765\u6267\u884c\u547d\u4ee4\uff0c\u56e0\u6b64\u9700\u8981\u5148\u8f93\u5165 &#8220;poetry run&#8221;\uff0c\u7136\u540e\u518d\u8f93\u5165\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry run python manage.py makemigrations\r\n<\/span><\/code><\/pre>\n<h2>\u663e\u793a\u5305\u7684\u5217\u8868\u3001\u7248\u672c\u548c\u8be6\u7ec6\u4fe1\u606f<\/h2>\n<h3>\u5217\u8868\u5c55\u793a<\/h3>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry show\r\n<\/span><\/code><\/pre>\n<p>\u6267\u884c\u6b64\u547d\u4ee4\u5c06\u663e\u793a\u5df2\u5b89\u88c5\u8f6f\u4ef6\u5305\u7684\u5217\u8868\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">Django              4.1.2  A high-level Python web framework that encourages rapid development and clean, pragmatic design.\r\ndjangorestframework 3.14.0 Web APIs for Django, made easy.\r\ndrf-nested-routers  0.93.4 Nested resources for the Django Rest Framework\r\n<\/span><\/code><\/pre>\n<h3>\u5c55\u793a\u7ec6\u8282<\/h3>\n<p>\u6307\u5b9a\u5305\u540d\u540e\u5c06\u663e\u793a\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n<pre class=\"post-pre\"><code>poetry show &lt;\u30d1\u30c3\u30b1\u30fc\u30b8\u540d&gt;\r\n<\/code><\/pre>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry show gunicorn\r\n name         : gunicorn                  \r\n version      : 20.1.0                    \r\n description  : WSGI HTTP Server for UNIX \r\n\r\ndependencies\r\n<\/span><span class=\"gp\"> - setuptools &gt;<\/span><span class=\"o\">=<\/span>3.0\r\n<\/code><\/pre>\n<h2>poetry.lock\u548cpyproject.toml\u7684\u540c\u6b65<\/h2>\n<p>\u66f4\u65b0 poetry.lock \u548c pyproject.toml \u4f7f\u5b83\u4eec\u4fdd\u6301\u4e00\u81f4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry lock\r\n<\/span><\/code><\/pre>\n<h2>\u786e\u8ba4Poetry\u7684\u8def\u5f84<\/h2>\n<pre class=\"post-pre\"><code><span class=\"go\">poetry env info\r\n<\/span><\/code><\/pre>\n<p>\u6267\u884c\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u786e\u8ba4\u672c\u5730\u548c\u865a\u62df\u73af\u5883\u4e2dPython\u7684PATH\u3002\u5728\u5bb9\u5668\u4e2d\u8fdb\u884c\u8fdc\u7a0b\u8c03\u8bd5\u65f6\uff0c\u5fc5\u987b\u5c06Python\u89e3\u91ca\u5668\u6307\u5b9a\u4e3aPoetry\u7684\u8def\u5f84\uff0c\u5426\u5219\u65e0\u6cd5\u8fd0\u884c\uff0c\u6240\u4ee5\u6211\u7ecf\u5e38\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"go\">Virtualenv\r\nPython:         3.10.5\r\nImplementation: CPython\r\nPath:           \/Users\/shun\/Library\/Caches\/pypoetry\/virtualenvs\/api-vJJX1F0w-py3.10\r\nExecutable:     \/Users\/shun\/Library\/Caches\/pypoetry\/virtualenvs\/api-vJJX1F0w-py3.10\/bin\/python\r\nValid:          True\r\n\r\nSystem\r\nPlatform:   darwin\r\nOS:         posix\r\nPython:     3.10.5\r\nPath:       \/Users\/shun\/.pyenv\/versions\/3.10.5\r\nExecutable: \/Users\/shun\/.pyenv\/versions\/3.10.5\/bin\/python3.10\r\n<\/span><\/code><\/pre>\n<p>\u5982\u679c\u60a8\u5bf9\u8fdc\u7a0b\u8c03\u8bd5\u611f\u5174\u8da3\uff0c\u6211\u5e0c\u671b\u60a8\u4e5f\u80fd\u9605\u8bfb\u4e0b\u9762\u7684\u6587\u7ae0\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2>\u628a\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u6240\u9700\u7684\u6240\u6709\u8bbe\u7f6e\u90fd\u6574\u5408\u5230pyproject.toml\u6587\u4ef6\u4e2d\uff01<\/h2>\n<p>\u4f8b\u5982\uff0cPytest\u7684\u9009\u9879\u53ef\u4ee5\u5728pytest.ini\u6587\u4ef6\u4e2d\u8fdb\u884c\u8bb0\u5f55\uff0c\u4f46\u4e5f\u53ef\u4ee5\u5728pyproject.toml\u6587\u4ef6\u4e2d\u8fdb\u884c\u8bb0\u5f55\u3002\u4e0e\u6bcf\u6b21\u5b89\u88c5\u4e0d\u540c\u7684\u5305\u65f6\u521b\u5efa\u4e13\u7528\u6587\u4ef6\u5e76\u8bb0\u5f55\u9009\u9879\u76f8\u6bd4\uff0c\u5c06\u5176\u96c6\u4e2d\u5728pyproject.toml\u4e2d\u53ef\u4ee5\u66f4\u8f7b\u677e\u548c\u4fbf\u5229\u5730\u7ba1\u7406\u3002<\/p>\n<h3>\u9ed1\u8272<\/h3>\n<pre class=\"post-pre\"><code><span class=\"nn\">[tool.black]<\/span>\r\n<span class=\"py\">line-length<\/span> <span class=\"p\">=<\/span> <span class=\"mi\">79<\/span>\r\n<span class=\"py\">include<\/span> <span class=\"p\">=<\/span> <span class=\"s\">'\\.py$'<\/span>\r\n<span class=\"py\">exclude<\/span> <span class=\"p\">=<\/span> <span class=\"s\">'''\r\n(\r\n  \/(\r\n      \\.eggs         # exclude a few common directories in the\r\n    | \\.git          # root of the project\r\n    | \\.hg\r\n    | \\.mypy_cache\r\n    | \\.tox\r\n    | \\.venv\r\n    | _build\r\n    | buck-out\r\n    | build\r\n    | dist\r\n  )\/\r\n)\r\n'''<\/span>\r\n<\/code><\/pre>\n<h3>\u5206\u7c7b<\/h3>\n<p>\u8bbe\u7f6eImport\u7684\u683c\u5f0f\u4ee5\u4f18\u5148\u4f7f\u7528Black\uff0c\u5426\u5219\u4f1a\u4e0eBlack\u53d1\u751f\u51b2\u7a81\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"nn\">[tool.isort]<\/span>\r\n<span class=\"py\">profile<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"black\"<\/span>\r\n<\/code><\/pre>\n<h3>Pytest\u7684\u4e2d\u6587\u91ca\u4e49<\/h3>\n<pre class=\"post-pre\"><code><span class=\"nn\">[tool.pytest.ini_options]<\/span>\r\n<span class=\"py\">DJANGO_SETTINGS_MODULE<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"project.settings\"<\/span>\r\n<span class=\"py\">addopts<\/span> <span class=\"p\">=<\/span> <span class=\"s\">\"-v -s --durations=0\"<\/span>\r\n<\/code><\/pre>\n<p>\u5728\u4f7f\u7528addopts\u65f6\uff0c\u8bf7\u5c06\u9009\u9879\u7528\u53cc\u5f15\u53f7\u62ec\u8d77\u6765\u3002<br \/>\n\u53e6\u5916\uff0c\u4f7f\u7528pytest-django\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u540d\u4e3aDJANGO_SETTINGS_MODULE\u7684\u73af\u5883\u53d8\u91cf\uff0c\u53ef\u4ee5\u5728\u8fd9\u91cc\u8fdb\u884c\u8bb0\u5f55\u3002<\/p>\n<h2>\u603b\u7ed3<\/h2>\n<p>\u8bb8\u591a\u516c\u53f8\u5728\u5b9e\u9645\u5de5\u4f5c\u4e2d\u90fd\u4f7f\u7528\u8bd7\u6b4c\u6bd4\u6211\u60f3\u8c61\u7684\u66f4\u52a0\u65b9\u4fbf\uff0c\u6240\u4ee5\u6709\u5fc5\u8981\u4e86\u89e3\u4e00\u4e9b\u4f7f\u7528\u65b9\u6cd5\u548c\u539f\u7406\u3002\uff08Docker\u559c\u6b22requirements.txt\u7684\u6587\u4ef6\u3002\uff09\u3002\u5176\u4ed6\u547d\u4ee4\u8bf7\u53c2\u8003\u5b98\u65b9\u6587\u6863\u3002<\/p>\n<h2>\u8bf7\u53c2\u8003<\/h2>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u8bd7\u6b4c\u662f\u4ec0\u4e48\uff1f \u6b63\u5982\u516c\u5f0f\u6587\u4ef6\u6240\u8ff0\uff0cPoetry\u662f\u7ba1\u7406Python\u8f6f\u4ef6\u5305\u7684\u5de5\u5177\u3002\u901a\u8fc7\u4f7f\u7528Poetry\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u6839 [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-49280","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>[\u9488\u5bf9\u521d\u5b66\u8005] \u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\u5305\u7ba1\u7406\u7b49\uff0c\u5168\u9762\u89e3\u91ca\u8bf4\u660e - 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\/\u9488\u5bf9\u521d\u5b66\u8005-\u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[\u9488\u5bf9\u521d\u5b66\u8005] \u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\u5305\u7ba1\u7406\u7b49\uff0c\u5168\u9762\u89e3\u91ca\u8bf4\u660e\" \/>\n<meta property=\"og:description\" content=\"\u8bd7\u6b4c\u662f\u4ec0\u4e48\uff1f \u6b63\u5982\u516c\u5f0f\u6587\u4ef6\u6240\u8ff0\uff0cPoetry\u662f\u7ba1\u7406Python\u8f6f\u4ef6\u5305\u7684\u5de5\u5177\u3002\u901a\u8fc7\u4f7f\u7528Poetry\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u6839 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u9488\u5bf9\u521d\u5b66\u8005-\u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-30T19:04:28+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-05-04T04:58:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8a79913a08637a6ca0d6\/21-0.png\" \/>\n<meta name=\"author\" content=\"\u9038, \u79d1\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u9038, \u79d1\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \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\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/\",\"name\":\"[\u9488\u5bf9\u521d\u5b66\u8005] \u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\u5305\u7ba1\u7406\u7b49\uff0c\u5168\u9762\u89e3\u91ca\u8bf4\u660e - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2022-12-30T19:04:28+00:00\",\"dateModified\":\"2024-05-04T04:58:25+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[\u9488\u5bf9\u521d\u5b66\u8005] \u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\u5305\u7ba1\u7406\u7b49\uff0c\u5168\u9762\u89e3\u91ca\u8bf4\u660e\"}]},{\"@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\/85c1dae56e6ea1e695c73d33c684d487\",\"name\":\"\u9038, \u79d1\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g\",\"caption\":\"\u9038, \u79d1\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"[\u9488\u5bf9\u521d\u5b66\u8005] \u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\u5305\u7ba1\u7406\u7b49\uff0c\u5168\u9762\u89e3\u91ca\u8bf4\u660e - 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\/\u9488\u5bf9\u521d\u5b66\u8005-\u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\/","og_locale":"zh_CN","og_type":"article","og_title":"[\u9488\u5bf9\u521d\u5b66\u8005] \u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\u5305\u7ba1\u7406\u7b49\uff0c\u5168\u9762\u89e3\u91ca\u8bf4\u660e","og_description":"\u8bd7\u6b4c\u662f\u4ec0\u4e48\uff1f \u6b63\u5982\u516c\u5f0f\u6587\u4ef6\u6240\u8ff0\uff0cPoetry\u662f\u7ba1\u7406Python\u8f6f\u4ef6\u5305\u7684\u5de5\u5177\u3002\u901a\u8fc7\u4f7f\u7528Poetry\uff0c\u53ef\u4ee5\u65b9\u4fbf\u5730\u6839 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u9488\u5bf9\u521d\u5b66\u8005-\u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2022-12-30T19:04:28+00:00","article_modified_time":"2024-05-04T04:58:25+00:00","og_image":[{"url":"https:\/\/cdn.silicloud.com\/blog-img\/blog\/img\/657d8a79913a08637a6ca0d6\/21-0.png"}],"author":"\u9038, \u79d1","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u9038, \u79d1","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/","name":"[\u9488\u5bf9\u521d\u5b66\u8005] \u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\u5305\u7ba1\u7406\u7b49\uff0c\u5168\u9762\u89e3\u91ca\u8bf4\u660e - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2022-12-30T19:04:28+00:00","dateModified":"2024-05-04T04:58:25+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/85c1dae56e6ea1e695c73d33c684d487"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%e4%bb%b6\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"[\u9488\u5bf9\u521d\u5b66\u8005] \u8bd7\u6b4c\u5165\u95e8\uff01\u4ece\u5b89\u88c5\u65b9\u6cd5\uff0c\u547d\u4ee4\u5230\u8f6f\u4ef6\u5305\u7ba1\u7406\u7b49\uff0c\u5168\u9762\u89e3\u91ca\u8bf4\u660e"}]},{"@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\/85c1dae56e6ea1e695c73d33c684d487","name":"\u9038, \u79d1","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c94f6d9cbbfbca863fab309840bd690c153c95f8490c290ad2ed54dd693dad16?s=96&d=mm&r=g","caption":"\u9038, \u79d1"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/keyi\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e9%92%88%e5%af%b9%e5%88%9d%e5%ad%a6%e8%80%85-%e8%af%97%e6%ad%8c%e5%85%a5%e9%97%a8%ef%bc%81%e4%bb%8e%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%ef%bc%8c%e5%91%bd%e4%bb%a4%e5%88%b0%e8%bd%af%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\/49280","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\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=49280"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/49280\/revisions"}],"predecessor-version":[{"id":98458,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/49280\/revisions\/98458"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=49280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=49280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=49280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}