{"id":49872,"date":"2023-06-20T18:47:41","date_gmt":"2023-01-03T00:35:19","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/"},"modified":"2024-04-30T09:50:36","modified_gmt":"2024-04-30T01:50:36","slug":"%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/","title":{"rendered":"\u6211\u5728Conoha\u4e0a\u4f7f\u7528Ubuntu 18.04\u7684VPS\uff0c\u5e76\u90e8\u7f72\u4e86Django\uff08Nginx+Gunicorn\uff09"},"content":{"rendered":"<p>\u7531\u4e8e\u5b9e\u9645\u5904\u7406\u662f\u7531root\u7528\u6237\u8fdb\u884c\u7684\uff0c\u6240\u4ee5\u4e0d\u9700\u8981sudo\u3002\u4f46\u662f\uff0c\u7531\u4e8e\u6709\u4e00\u4e9b\u4ece\u5404\u4e2a\u5730\u65b9\u590d\u5236\u7c98\u8d34\u7684\u547d\u4ee4\uff0c\u6240\u4ee5\u539f\u6837\u4fdd\u7559\u5728\u4ee3\u7801\u4e2d\u3002<\/p>\n<h1>\u51c6\u5907\u4e0b\u5e76\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u3002<\/h1>\n<p>\u66f4\u6539\u5bc6\u7801<\/p>\n<p>\u73b0\u5728\u91cd\u542f<br \/>\n\u91cd\u590d\u767b\u5f55<\/p>\n<p>\u8bf7\u6267\u884c&#8221;sudo apt update&#8221;\u547d\u4ee4\u3002<\/p>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u672c\u5730\u5b89\u88c5Python3\u7684pip\u3001Python3\u7684\u5f00\u53d1\u5305\u3001libpq\u5f00\u53d1\u5305\u3001PostgreSQL\u6570\u636e\u5e93\u3001PostgreSQL\u6269\u5c55\u5305\u3001Nginx\u670d\u52a1\u5668\u548ccurl\u5de5\u5177\uff1a<br \/>\nsudo apt install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx curl<\/p>\n<h1>PostgreSQL\u7684\u914d\u7f6e<\/h1>\n<p>\u7528\u4e2d\u56fd\u7684\u6bcd\u8bed\u5c06\u4ee5\u4e0b\u5185\u5bb9\u6539\u8ff0\u4e3a\uff1a<br \/>\n\u4ee5postgres\u7528\u6237\u8eab\u4efd\u8fd0\u884cpsql\u547d\u4ee4\u3002<\/p>\n<p>\u521b\u5efa\u6570\u636e\u5e93 \u540d\u5b57\u4e3a Database\u540d;<br \/>\n\u521b\u5efa\u7528\u6237 DB\u30e6\u30fc\u30b6\u540d \u5e76\u8bbe\u7f6e\u5bc6\u7801\u4e3a &#8216;DB\u30d1\u30b9\u30ef\u30fc\u30c9&#8217;;<br \/>\n\u5c06\u7528\u6237 DB\u30e6\u30fc\u30b6\u540d \u7684\u5ba2\u6237\u7aef\u7f16\u7801\u8bbe\u7f6e\u4e3a &#8216;utf8&#8217;;<br \/>\n\u5c06\u7528\u6237 DB\u30e6\u30fc\u30b6\u540d \u7684\u9ed8\u8ba4\u4e8b\u52a1\u9694\u79bb\u7ea7\u522b\u8bbe\u7f6e\u4e3a &#8216;read committed&#8217;;<br \/>\n\u5c06\u7528\u6237 DB\u30e6\u30fc\u30b6\u540d \u7684\u65f6\u533a\u8bbe\u7f6e\u4e3a &#8216;UTC&#8217;;<br \/>\n\u5c06\u6570\u636e\u5e93 Database\u540d \u7684\u6240\u6709\u6743\u9650\u6388\u4e88\u7ed9\u7528\u6237 DB\u30e6\u30fc\u30b6\u540d;<\/p>\n<p>\u628a\u4e0b\u5217\u5185\u5bb9\u7528\u4e2d\u6587\u8fdb\u884c\u7ffb\u8bd1\uff1a\u53ea\u9700\u8981\u4e00\u4e2a\u9009\u9879\u3002<\/p>\n<h1>\u5f15\u5165\u865a\u62df\u73af\u5883<\/h1>\n<p>\u5728\u4e2d\u56fd\u672c\u571f\u7684\u73af\u5883\u4e2d\uff0c\u4ec5\u63d0\u4f9b\u4e00\u79cd\u9009\u9879\uff1a<br \/>\nsudo -H pip3 install &#8211;upgrade pip<br \/>\nsudo -H pip3 install virtualenv<br \/>\n\u4f7f\u7528sudo -H pip3 install &#8211;upgrade pip\u547d\u4ee4\u8fdb\u884cpip\u7684\u5347\u7ea7\uff0c\u5e76\u4f7f\u7528sudo -H pip3 install virtualenv\u547d\u4ee4\u5b89\u88c5virtualenv\u3002<\/p>\n<h1>\u521b\u5efa\u4e00\u4e2a\u4e13\u4e3aDjango\u8bbe\u8ba1\u7684\u76ee\u5f55\u3002<\/h1>\n<p>\u8fdb\u5165 \/home \u76ee\u5f55<br \/>\n\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a django \u7684\u6587\u4ef6\u5939<br \/>\n\u8fdb\u5165 django \u6587\u4ef6\u5939<\/p>\n<p>\u5c06\u5728\u5f00\u53d1\u73af\u5883\u4e2d\u521b\u5efa\u7684Django\u6570\u636e\u590d\u5236\u5230\/home\/django\u76ee\u5f55\u4e0b\u3002<\/p>\n<h1>\u521b\u5efa\u865a\u62df\u73af\u5883\u5e76\u6fc0\u6d3b\u3002<\/h1>\n<p>\u5207\u6362\u5230testdjango\u76ee\u5f55\uff08Django\u9879\u76ee\u540d\u79f0\uff09<br \/>\n\u521b\u5efa\u865a\u62df\u73af\u5883venv<br \/>\n\u6fc0\u6d3b\u865a\u62df\u73af\u5883venv<\/p>\n<h1>\u5b89\u88c5Django\u6240\u9700\u7684\u8f6f\u4ef6<\/h1>\n<p>pip\u5b89\u88c5django gunicorn psycopg2-binary<br \/>\npip\u5b89\u88c5django-allauth<br \/>\npip\u5b89\u88c5django-cleanup<br \/>\npip\u5b89\u88c5pillow<\/p>\n<h1>\u66f4\u6539\/\u4fee\u6539Django\u7684\u914d\u7f6e\u6587\u4ef6<\/h1>\n<p>\u6253\u5f00 \/home\/django\/testdjango\/testdjango\/settings.py \u6587\u4ef6\u3002<\/p>\n<p>ALLOWED_HOSTS = [&#8216;VPS\u7684IP&#8217;, &#8216;\u672c\u5730\u4e3b\u673a&#8217;]<\/p>\n<p>\u6570\u636e\u5e93 = {<br \/>\n&#8216;default&#8217;: {<br \/>\n&#8216;ENGINE&#8217;: &#8216;django.db.backends.postgresql_psycopg2&#8217;,<br \/>\n&#8216;NAME&#8217;: &#8216;\u6570\u636e\u5e93\u540d&#8217;,<br \/>\n&#8216;USER&#8217;: &#8216;\u6570\u636e\u5e93\u7528\u6237&#8217;,<br \/>\n&#8216;PASSWORD&#8217;: &#8216;\u6570\u636e\u5e93\u5bc6\u7801&#8217;,<br \/>\n&#8216;HOST&#8217;: &#8216;localhost&#8217;,<br \/>\n&#8216;PORT&#8217;: &#8221;,<br \/>\n}<br \/>\n}<\/p>\n<p>STATIC_ROOT = os.path.join(BASE_DIR, &#8216;static\/&#8217;) # \u5c06STATICFILES_DIRS\u90e8\u5206\u6ce8\u91ca\u6389(:wq\u9000\u51favi)<\/p>\n<h1>Django\u914d\u7f6e<\/h1>\n<p>python manage.py makemigrations<br \/>\npython manage.py migrate<br \/>\npython manage.py collectstatic<br \/>\n\uff08\u8f93\u5165&#8217;yes&#8217;\u7ee7\u7eed\uff0c\u6216&#8217;no&#8217;\u53d6\u6d88\uff1ayes\uff09<br \/>\npython manage.py createsuperuser<\/p>\n<h1>\u786e\u8ba4gunicorn\u7684\u5de5\u4f5c\u662f\u5426\u6b63\u5e38\u3002<\/h1>\n<p>sudo ufw\u5141\u8bb88000\u7aef\u53e3<br \/>\ngunicorn &#8211;bind 0.0.0.0:8000 testdjango.wsgi<br \/>\n\uff08\u5728Web\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95eeVPS\u7684IP\u5730\u5740:8000\u4ee5\u8fdb\u884c\u786e\u8ba4\u3002\u786e\u8ba4\u540e\uff0c\u4f7f\u7528Ctrl+c\u505c\u6b62gunicorn\uff09<br \/>\ndeactivate<\/p>\n<h1>\u7ffb\u8bd1\u7ed3\u679c\uff1agunicorn\u7684\u914d\u7f6e<\/h1>\n<p>\u4f7f\u7528sudo\u547d\u4ee4\uff0c\u901a\u8fc7vim\u7f16\u8f91\u5668\u6253\u5f00\/etc\/systemd\/system\/gunicorn.socket\u6587\u4ef6\u3002<\/p>\n<p>[Unit]<br \/>\n\u63cf\u8ff0=gunicorn\u5957\u63a5\u5b57<br \/>\n[Socket]<br \/>\n\u76d1\u542c\u6d41=\/run\/gunicorn.sock<br \/>\n[Install]<br \/>\n\u5e0c\u671b\u7531sockets.target\u5b89\u88c5<\/p>\n<p>\u8bf7\u4e3a\u6211\u6253\u5f00\u4f4d\u4e8e\/etc\/systemd\/system\/gunicorn.service\u7684\u6587\u4ef6\uff0c\u4f7f\u7528sudo vim\u547d\u4ee4\u3002<\/p>\n<p>[Unit]<br \/>\n\u63cf\u8ff0=gunicorn\u5b88\u62a4\u8fdb\u7a0b<br \/>\n\u8981\u6c42=gunicorn.socket<br \/>\n\u4e4b\u540e=network.target<\/p>\n<p>\u3010\u670d\u52a1\u3011<br \/>\n\u7528\u6237=\u6839<br \/>\n\u7ec4=www-data<br \/>\n\u5de5\u4f5c\u76ee\u5f55=\/home\/django\/testdjango<br \/>\n\u6267\u884c\u5f00\u59cb=\/home\/django\/testdjango\/venv\/bin\/gunicorn \\<br \/>\n&#8211;access-logfile &#8211; \\<br \/>\n&#8211;workers 3 \\<br \/>\n&#8211;bind unix:\/run\/gunicorn.sock \\<br \/>\ntestdjango.wsgi:application<\/p>\n<p>[\u5b89\u88c5]<br \/>\n\u6240\u9700\u76ee\u6807=\u591a\u7528\u6237.target<\/p>\n<h1>gunicorn\u7684\u542f\u52a8\uff08\u4ee5\u53ca\u81ea\u52a8\u542f\u52a8\uff09<\/h1>\n<p>\u5f00\u59cbgunicorn.socket\u670d\u52a1\uff1a<br \/>\nsudo systemctl start gunicorn.socket<\/p>\n<p>\u8bbe\u7f6egunicorn.socket\u5f00\u673a\u81ea\u542f\uff1a<br \/>\nsudo systemctl enable gunicorn.socket<\/p>\n<h1>nginx\u7684\u914d\u7f6e<\/h1>\n<p>\u4f7f\u7528sudo\u547d\u4ee4\u4ee5root\u6743\u9650\u7f16\u8f91\/etc\/nginx\/sites-available\/testdjango\u6587\u4ef6\uff0c\u53ef\u4ee5\u91c7\u7528vim\u7f16\u8f91\u5668\u3002<\/p>\n<p>\u670d\u52a1\u5668{<br \/>\n\u76d1\u542c80;<br \/>\n\u670d\u52a1\u5668\u540d\u79f0 VPS\u7684IP;<br \/>\n\u4f4d\u7f6e= \/favicon.ico { \u8bb0\u5f55\u53d6\u6d88; \u672a\u627e\u5230\u65f6\u4e0d\u8bb0\u5f55; }<br \/>\n\u4f4d\u7f6e \/static\/ { \u6839 \/home\/django\/testdjango; }<br \/>\n\u4f4d\u7f6e \/ { \u5305\u62ec\u4ee3\u7406\u53c2\u6570; \u4ee3\u7406\u4f20\u9012 http:\/\/unix:\/run\/gunicorn.sock; }<br \/>\n}<\/p>\n<h1>\u4e3a\u4e86\u8ba9nginx\u5c06\u5176\u8bc6\u522b\u4e3a\u5b9e\u9645\u4f7f\u7528\u7684\u6587\u4ef6\uff0c\u521b\u5efa\u4e00\u4e2a\u7b26\u53f7\u94fe\u63a5\u3002<\/h1>\n<p>\u5728\u4e2d\u56fd\u7ffb\u8bd1\u4e3a\u4e2d\u6587\u540e\uff0c\u53ea\u9700\u8981\u4e00\u79cd\u9009\u9879\uff1asudo ln -s \/etc\/nginx\/sites-available\/testdjango \/etc\/nginx\/sites-enabled\u3002<\/p>\n<h1>\u91cd\u65b0\u542f\u52a8nginx\u5e76\u8bbe\u7f6e\u9632\u706b\u5899\u914d\u7f6e\u3002<\/h1>\n<p>\u8bf7\u91cd\u65b0\u542f\u52a8 Nginx \u670d\u52a1\uff1asudo systemctl restart nginx<br \/>\n\u5141\u8bb8 Nginx \u7684\u5b8c\u6574\u8bbf\u95ee\uff1asudo ufw allow &#8216;Nginx Full&#8217;<\/p>\n<p>\u786e\u8ba4\u8bbf\u95ee<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7531\u4e8e\u5b9e\u9645\u5904\u7406\u662f\u7531root\u7528\u6237\u8fdb\u884c\u7684\uff0c\u6240\u4ee5\u4e0d\u9700\u8981sudo\u3002\u4f46\u662f\uff0c\u7531\u4e8e\u6709\u4e00\u4e9b\u4ece\u5404\u4e2a\u5730\u65b9\u590d\u5236\u7c98\u8d34\u7684\u547d\u4ee4\uff0c\u6240\u4ee5\u539f\u6837\u4fdd\u7559 [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-49872","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\u5728Conoha\u4e0a\u4f7f\u7528Ubuntu 18.04\u7684VPS\uff0c\u5e76\u90e8\u7f72\u4e86Django\uff08Nginx+Gunicorn\uff09 - 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\u5728conoha\u4e0a\u4f7f\u7528ubuntu-18-04\u7684vps\uff0c\u5e76\u90e8\u7f72\u4e86django\uff08nginxgunicorn\uff09\u3002\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6211\u5728Conoha\u4e0a\u4f7f\u7528Ubuntu 18.04\u7684VPS\uff0c\u5e76\u90e8\u7f72\u4e86Django\uff08Nginx+Gunicorn\uff09\" \/>\n<meta property=\"og:description\" content=\"\u7531\u4e8e\u5b9e\u9645\u5904\u7406\u662f\u7531root\u7528\u6237\u8fdb\u884c\u7684\uff0c\u6240\u4ee5\u4e0d\u9700\u8981sudo\u3002\u4f46\u662f\uff0c\u7531\u4e8e\u6709\u4e00\u4e9b\u4ece\u5404\u4e2a\u5730\u65b9\u590d\u5236\u7c98\u8d34\u7684\u547d\u4ee4\uff0c\u6240\u4ee5\u539f\u6837\u4fdd\u7559 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u5728conoha\u4e0a\u4f7f\u7528ubuntu-18-04\u7684vps\uff0c\u5e76\u90e8\u7f72\u4e86django\uff08nginxgunicorn\uff09\u3002\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-01-03T00:35:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-04-30T01:50:36+00:00\" \/>\n<meta name=\"author\" content=\"\u6e05, \u626c\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u6e05, \u626c\" \/>\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\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/\",\"name\":\"\u6211\u5728Conoha\u4e0a\u4f7f\u7528Ubuntu 18.04\u7684VPS\uff0c\u5e76\u90e8\u7f72\u4e86Django\uff08Nginx+Gunicorn\uff09 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-01-03T00:35:19+00:00\",\"dateModified\":\"2024-04-30T01:50:36+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%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\u5728Conoha\u4e0a\u4f7f\u7528Ubuntu 18.04\u7684VPS\uff0c\u5e76\u90e8\u7f72\u4e86Django\uff08Nginx+Gunicorn\uff09\"}]},{\"@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\/cb5556d2501da73d864cac945e8d9461\",\"name\":\"\u6e05, \u626c\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g\",\"caption\":\"\u6e05, \u626c\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u6211\u5728Conoha\u4e0a\u4f7f\u7528Ubuntu 18.04\u7684VPS\uff0c\u5e76\u90e8\u7f72\u4e86Django\uff08Nginx+Gunicorn\uff09 - 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\u5728conoha\u4e0a\u4f7f\u7528ubuntu-18-04\u7684vps\uff0c\u5e76\u90e8\u7f72\u4e86django\uff08nginxgunicorn\uff09\u3002\/","og_locale":"zh_CN","og_type":"article","og_title":"\u6211\u5728Conoha\u4e0a\u4f7f\u7528Ubuntu 18.04\u7684VPS\uff0c\u5e76\u90e8\u7f72\u4e86Django\uff08Nginx+Gunicorn\uff09","og_description":"\u7531\u4e8e\u5b9e\u9645\u5904\u7406\u662f\u7531root\u7528\u6237\u8fdb\u884c\u7684\uff0c\u6240\u4ee5\u4e0d\u9700\u8981sudo\u3002\u4f46\u662f\uff0c\u7531\u4e8e\u6709\u4e00\u4e9b\u4ece\u5404\u4e2a\u5730\u65b9\u590d\u5236\u7c98\u8d34\u7684\u547d\u4ee4\uff0c\u6240\u4ee5\u539f\u6837\u4fdd\u7559 [&hellip;]","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u6211\u5728conoha\u4e0a\u4f7f\u7528ubuntu-18-04\u7684vps\uff0c\u5e76\u90e8\u7f72\u4e86django\uff08nginxgunicorn\uff09\u3002\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-01-03T00:35:19+00:00","article_modified_time":"2024-04-30T01:50:36+00:00","author":"\u6e05, \u626c","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u6e05, \u626c","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/","name":"\u6211\u5728Conoha\u4e0a\u4f7f\u7528Ubuntu 18.04\u7684VPS\uff0c\u5e76\u90e8\u7f72\u4e86Django\uff08Nginx+Gunicorn\uff09 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-01-03T00:35:19+00:00","dateModified":"2024-04-30T01:50:36+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/cb5556d2501da73d864cac945e8d9461"},"breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%e3%80%82\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%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\u5728Conoha\u4e0a\u4f7f\u7528Ubuntu 18.04\u7684VPS\uff0c\u5e76\u90e8\u7f72\u4e86Django\uff08Nginx+Gunicorn\uff09"}]},{"@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\/cb5556d2501da73d864cac945e8d9461","name":"\u6e05, \u626c","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/32a4239de8ff29adace466261d309424a1e5fe9f7e3036bf89fe03f2e3dbe717?s=96&d=mm&r=g","caption":"\u6e05, \u626c"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/qingyang\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e6%88%91%e5%9c%a8conoha%e4%b8%8a%e4%bd%bf%e7%94%a8ubuntu-18-04%e7%9a%84vps%ef%bc%8c%e5%b9%b6%e9%83%a8%e7%bd%b2%e4%ba%86django%ef%bc%88nginxgunicorn%ef%bc%89%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\/49872","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\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=49872"}],"version-history":[{"count":2,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/49872\/revisions"}],"predecessor-version":[{"id":91189,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/49872\/revisions\/91189"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=49872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=49872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=49872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}