{"id":3507,"date":"2016-02-01T02:03:37","date_gmt":"2016-02-01T02:03:37","guid":{"rendered":"https:\/\/unihost.com\/help\/?p=3507"},"modified":"2023-01-19T13:53:47","modified_gmt":"2023-01-19T10:53:47","slug":"installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu","status":"publish","type":"post","link":"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/","title":{"rendered":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu."},"content":{"rendered":"<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e VPS \u0441 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u043c Linux (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Ubuntu) \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c (\u0440\u0430\u0437\u0434\u0435\u043b\u044b 1 \u2013 6) \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443. \u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Django, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u041f\u041e, \u043c\u043e\u0433\u0443\u0442 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 6. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435, \u00a0\u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 7.<!--more--><\/span><\/p>\n<ol>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432<br \/>\n<\/strong><\/strong>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0435 \u043f\u0430\u043a\u0435\u0442\u044b \u043d\u0430 VPS. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u0441\u044c \u043a VPS \u043f\u043e SSH \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/span><\/span><\/p>\n<pre>sudo apt-get update\r\nsudo apt-get upgrade\r\n<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041f\u0435\u0440\u0432\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u0442 \u0432\u0441\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 apt-get. \u0412\u0442\u043e\u0440\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0430\u0442 \u043d\u043e\u0432\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432, \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u0438\u0437\u0432\u0435\u0449\u0435\u043d\u0438\u0435, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0435\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f. \u041d\u0430\u0436\u043c\u0438\u0442\u0435 &#8220;Y&#8221; \u0438 \u043a\u043b\u0430\u0432\u0438\u0448\u0443 &#8220;Enter&#8221; \u043f\u0440\u0438 \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0438\u0437\u0432\u0435\u0449\u0435\u043d\u0438\u044f.<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><b>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 <\/b><b>Virtualenv.<br \/>\n<\/b>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 <strong>virtualenv<\/strong> \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u0443\u044e \u043d\u0438\u0436\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<b><br \/>\n<\/b><\/span><\/span><\/span><\/p>\n<pre>sudo apt-get install python-virtualenv<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"> \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c <strong>virtualenv<\/strong> (\u0438\u043b\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443), \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0438 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0432 \u043d\u0435\u0439 <strong>Django<\/strong> \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u044b <strong>Python<\/strong>:<\/span><\/span><\/p>\n<pre><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\">sudo virtualenv \/opt\/myenv<\/span><\/span><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435: \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 <span style=\"font-family: Ubuntu Mono,monospace;\">\/opt<\/span> \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u043e\u0432\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 <strong>myenv<\/strong>. \u0421\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0443, \u0432 \u044d\u0442\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0438 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443. \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0441\u0440\u0435\u0434\u0443 \u0432 \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435, \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c <span style=\"font-family: Ubuntu Mono,monospace;\">\/opt\/myenv<\/span> \u043f\u0443\u0442\u0435\u043c \u043a \u0412\u0430\u0448\u0435\u043c\u0443 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0443. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0442 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 <strong>webapps<\/strong> \u0432 \u043a\u043e\u0440\u043d\u0435 \u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b.<\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Django.<br \/>\n<\/strong>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c <strong>virtualenv<\/strong>, \u0447\u0442\u043e\u0431\u044b \u043f\u0430\u043a\u0435\u0442\u044b <strong>Python<\/strong> \u0431\u044b\u043b\u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u043d\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0430 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e, \u0432\u043d\u0443\u0442\u0440\u0438 \u0441\u0440\u0435\u0434\u044b. \u0418\u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c <strong>virtualenv:<\/strong><\/span><\/span><\/p>\n<pre>source \/opt\/myenv\/bin\/activate<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 Django. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <strong>pip<\/strong>, \u043c\u0435\u043d\u0435\u0434\u0436\u0435\u0440 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 <strong>Python<\/strong> (\u0430\u043d\u0430\u043b\u043e\u0433 <strong>easy_install<\/strong>). \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre>pip install django<\/pre>\n<p><strong>Django<\/strong> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432\u043d\u0443\u0442\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 <strong>virtualenv<\/strong>. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0435\u0440 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/strong> \u0438\u043c\u044f \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0435\u0433\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443 (<strong>myenv<\/strong>) \u0432\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043b\u0438 <strong>virtualenv<\/strong> \u0438 \u043a\u0430\u043a\u0430\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u0441\u0440\u0435\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u043d\u0430 VPS\u00a0 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e <strong>virtualenv<\/strong>).<\/span><\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 PostgreSQL.<br \/>\n<\/strong>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 <strong>Django<\/strong> \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <strong>PostgreSQL<\/strong> \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0430\u0437 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0431\u043e\u043b\u0435\u0435 \u0443\u0441\u0442\u043e\u0439\u0447\u0438\u0432\u044b\u0439 \u043a \u043e\u0448\u0438\u0431\u043a\u0430\u043c, \u0447\u0435\u043c MySQL, \u043a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, <strong>Django ORM<\/strong> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0441 <strong>PostgreSQL<\/strong> \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043b\u0443\u0447\u0448\u0435, \u0447\u0435\u043c \u0441 <strong>MySQL<\/strong>, <strong>MSSQL<\/strong> \u0438 \u0442.\u043f. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u0430\u044f \u00a0<strong>virtualenv<\/strong> \u043d\u0435 \u043d\u0443\u0436\u043d\u0430, \u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0435\u0437\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/span><\/span><\/span><\/p>\n<pre>deactivate<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\">\u0414\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u0430 \u0434\u0435\u0437\u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0443\u044e \u0430\u043a\u0442\u0438\u0432\u043d\u0443\u044e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 <strong>PostgreSQL<\/strong> (\u0434\u043b\u044f \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0441 <strong>Django<\/strong>) \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/span><\/span><\/p>\n<pre>sudo apt-get install libpq-dev python-dev<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 <strong>PostgreSQL<\/strong>:<\/span><\/p>\n<pre>sudo apt-get install postgresql postgresql-contrib<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0422\u0435\u043f\u0435\u0440\u044c <strong>PostgreSQL<\/strong> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0438 \u0433\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435.<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 NGINX.<br \/>\nNGINX<\/strong> \u2013 \u044d\u0442\u043e \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u043b\u0435\u0433\u043a\u0438\u0439 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0435 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f <strong>Django<\/strong>. \u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <strong>NGINX<\/strong>, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/span><\/span><\/p>\n<pre>sudo apt-get install nginx<\/pre>\n<p><strong>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/strong>: <strong>NGINX<\/strong> \u043d\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e, \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u043e\u0439 VPS.<\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 Gunicorn.<br \/>\nGunicorn<\/strong> \u2013 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u043e\u0449\u043d\u044b\u0439 HTTP-\u0441\u0435\u0440\u0432\u0435\u0440<strong> Python WSGI<\/strong>. \u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <strong>Gunicorn<\/strong> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c <strong>Python<\/strong>, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443, \u043f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u0435\u0433\u043e \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<\/span><\/span><\/p>\n<pre>source \/opt\/myenv\/bin\/activate<\/pre>\n<p>\u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e <strong>\u00abmyenv\u00bb<\/strong> \u0432\u043d\u0435\u0441\u0435\u043d \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438. \u0410\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0432 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre>pip install gunicorn<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0422\u0435\u043f\u0435\u0440\u044c <strong>Gunicorn<\/strong> \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432\u043d\u0443\u0442\u0440\u0438 <strong>virtualenv<\/strong>.<\/span><span style=\"font-family: Ubuntu,sans-serif;\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0432\u0441\u0435\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430. \u041f\u043e\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432 \u0438 \u0442\u043e\u043c\u0443, \u043a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f \u0434\u0440\u0443\u0433\u0438\u0445 \u0432 \u0418\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435.<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><b>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 PostgreSQL<br \/>\n<\/b>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c <strong>PostgreSQL<\/strong>. \u0414\u0430\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u043d\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0430\u0432 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u0418\u0442\u0430\u043a, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/span><\/span><\/p>\n<pre>sudo su - postgres<\/pre>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u0441\u0442\u0440\u043e\u043a\u0430 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 <strong>\u00abpostgres@\u0441\u0435\u0440\u0432\u0435\u0440\u00bb<\/strong>. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u0442\u0430\u043a, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445:<\/p>\n<pre>createdb mydb<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u044b\u0445 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c <strong>mydb<\/strong> (\u0435\u0441\u043b\u0438 \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043d\u0435 \u0431\u044b\u043b\u0438 \u0432\u043d\u0435\u0441\u0435\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f). \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0443\u0433\u043e\u0434\u043d\u043e. \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u0430\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/span><\/p>\n<pre>createuser --interactive -P\r\nEnter name of role to add: root\r\nEnter password for new role: \r\nEnter it again: \r\nShall the new role be a superuser? (y\/n) n\r\nShall the new role be allowed to create databases? (y\/n) n\r\nShall the new role be allowed to create more new roles? (y\/n) n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u044f\u0432\u044f\u0442\u0441\u044f 6 \u0438\u0437\u0432\u0435\u0449\u0435\u043d\u0438\u0439. \u041f\u0435\u0440\u0432\u043e\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442 \u0438\u043c\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u044e\u0431\u043e\u0435 \u0443\u0434\u043e\u0431\u043d\u043e\u0435 \u0438\u043c\u044f). \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0434\u0432\u0430 \u0438\u0437\u0432\u0435\u0449\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u044f\u0442 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0434\u0438\u0442\u044c \u043f\u0430\u0440\u043e\u043b\u044c \u0434\u043b\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0442\u0440\u0435\u0445 \u0438\u0437\u0432\u0435\u0449\u0435\u043d\u0438\u044f\u0445 \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043f\u0440\u0430\u0432\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043c\u0430\u043d\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 <strong>PostgreSQL<\/strong>:<\/span><\/p>\n<pre>psql<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043d\u043e\u0432\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0431\u0430\u0437\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/span><\/p>\n<pre>GRANT ALL PRIVILEGES ON DATABASE mydb TO \u0438\u043c\u044f_\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f;<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0418\u0442\u0430\u043a, \u0431\u0430\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 <strong>PostgreSQL<\/strong> \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c, \u0438\u043c\u0435\u044e\u0449\u0438\u0439 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u044d\u0442\u043e\u0439 \u0411\u0414, \u0441\u043e\u0437\u0434\u0430\u043d\u044b. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c <strong>Django<\/strong> \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0435\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u044d\u0442\u0443 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445.<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><b>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <\/b><b>Django.<br \/>\n<\/b>\u041d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 <strong>Django<\/strong>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0436\u0435\u0442, \u0432\u0441\u0435 \u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u043e\u043b\u0436\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0438\u0437 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <strong>virtualenv<\/strong> (\u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e <span style=\"font-family: Ubuntu Mono,monospace;\">\/opt\/myenv<\/span>):<\/span><\/span><\/p>\n<pre>cd \/opt\/myenv<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre>source \/opt\/myenv\/bin\/activate<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\">\u0422\u0435\u043f\u0435\u0440\u044c, \u043a\u043e\u0433\u0434\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u0430, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 Django:<\/span><\/span><\/p>\n<pre>django-admin.py startproject myproject<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0412 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u043d\u043e\u0432\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u043e \u0438\u043c\u0435\u043d\u0438 <strong>myproject<\/strong>. \u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u043d\u0435\u043c \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0444\u0430\u0439\u043b\u044b \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <strong>Django<\/strong>.<\/span><span style=\"font-family: Ubuntu,sans-serif;\">\u0427\u0442\u043e\u0431\u044b <strong>Django<\/strong> \u0438\u043c\u0435\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0441 \u0431\u0430\u0437\u043e\u0439 \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0431\u0435\u043a\u044d\u043d\u0434 <strong>PostgreSQL<\/strong>. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c, \u0447\u0442\u043e \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u0430\u043a\u0442\u0438\u0432\u043d\u0430, \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/span><\/p>\n<pre>pip install psycopg2<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <strong>myproject<\/strong>, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432 \u0435\u0433\u043e \u043f\u043e\u0434\u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0441 \u0442\u0430\u043a\u0438\u043c \u0436\u0435 \u0438\u043c\u0435\u043d\u0435\u043c:<\/span><\/p>\n<pre>cd \/opt\/myenv\/myproject\/myproject<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0412 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b settings.py:<\/span><\/p>\n<pre>nano settings.py<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0411\u0414 \u0438 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0438\u0445 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/span><\/p>\n<pre>DATABASES = {\r\n'default': {\r\n'ENGINE': 'django.db.backends.postgresql_psycopg2', \r\n'NAME': 'mydb', \r\n'USER': 'myuser',\r\n'PASSWORD': 'password',\r\n'HOST': 'localhost', \r\n'PORT': '', \r\n}\r\n}<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b. \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u043d\u0438\u043c\u0438\u0442\u0435\u0441\u044c \u043d\u0430 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u0432\u044b\u0448\u0435, \u0432 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <strong>Django<\/strong> (<span style=\"font-family: Ubuntu Mono,monospace;\">\/opt\/myenv\/myproject<\/span>).<\/span><\/p>\n<pre>cd \/opt\/myenv\/myproject<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0415\u0441\u043b\u0438 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u0440\u0435\u0434\u0430 \u043d\u0435 \u0431\u044b\u043b\u0430 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u043d\u0430, \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0439\u0442\u0435 \u0435\u0435.<\/span><\/p>\n<pre>source \/opt\/myenv\/bin\/activate<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0410\u043a\u0442\u0438\u0432\u0438\u0440\u043e\u0432\u0430\u0432 virtualenv, \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443, \u0447\u0442\u043e\u0431\u044b Django \u043c\u043e\u0433 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445:<\/span><\/p>\n<pre>python manage.py migrate<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0412\u044b\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043f\u043e\u043a\u0430\u0436\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0430\u0431\u043b\u0438\u0446, \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043f\u0440\u043e\u0441\u0438\u0442, \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0443\u043f\u0435\u0440\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f (\u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f: \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0414\u0436\u0430\u043d\u0433\u043e \u0438\u043b\u0438 Django admin).<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><b>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Gunicorn.<br \/>\n<\/b>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Gunicorn \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043f\u043e\u0442\u043e\u043c\u0443 \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043b\u0438\u0448\u044c \u043a\u0440\u0430\u0442\u043a\u043e\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 <strong>Gunicorn<\/strong> \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0433\u043e \u043e\u0431\u0449\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0435\u0440\u0432\u0435\u0440\u0430 <strong>Gunicorn<\/strong> \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/span><\/span><\/p>\n<pre>gunicorn myproject.wsgi:application --bind \u0434\u043e\u043c\u0435\u043d_\u0438\u043b\u0438_ip:8001<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0444\u0440\u0430\u0437\u0443 <strong>\u00ab\u0434\u043e\u043c\u0435\u043d_\u0438\u043b\u0438_ip\u00bb<\/strong> \u0441\u0432\u043e\u0438\u043c \u0434\u043e\u043c\u0435\u043d\u043d\u044b\u043c \u0438\u043b\u0438 IP-\u0430\u0434\u0440\u0435\u0441\u043e\u043c VPS. \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432\u0435\u0431-\u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0438 \u043f\u043e\u0441\u0435\u0442\u0438\u0442\u0435 <strong>\u0434\u043e\u043c\u0435\u043d_\u0438\u043b\u0438_ip.com:8001<\/strong>. \u0414\u043e\u043b\u0436\u0435\u043d \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u044d\u043a\u0440\u0430\u043d \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f <strong>Django<\/strong>.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><br \/>\n<strong>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435<\/strong>: \u0415\u0441\u043b\u0438 \u0412\u044b \u0443\u043a\u0430\u0436\u0438\u0442\u0435 IP 0.0.0.0:8001 \u0442\u043e \u0434\u0430\u043d\u043d\u0430\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u041a\u0430\u043a\u043e\u0439 \u0431\u044b Ip \u043d\u0435 \u0431\u044b\u043b \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u043f\u0430\u043d\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0441 \u043d\u0435\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430.<\/span><\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><b>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 NGINX.<br \/>\n<\/b>\u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0443\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <strong>NGINX<\/strong>:<\/span><\/span><\/p>\n<pre>sudo service nginx start<\/pre>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 <strong>NGINX<\/strong> \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u0433\u0434\u0435 \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b <strong>settings.py<\/strong> \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <strong>Django<\/strong> \u0438 \u043e\u0442\u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 <strong>STATIC_ROOT<\/strong> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre>STATIC_ROOT = \"\/opt\/myenv\/static\/\"<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0433\u0434\u0435 \u0443\u0433\u043e\u0434\u043d\u043e \u043d\u043e \u0434\u043b\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u044f \u0447\u0438\u0441\u0442\u043e\u0442\u044b \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0438\u0445 \u0432\u043d\u0435 \u043f\u0430\u043f\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Django, \u043d\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0440\u0435\u0434\u044b.<\/span><span style=\"font-family: Ubuntu,sans-serif;\">\u0423\u043a\u0430\u0437\u0430\u0432 \u043c\u0435\u0441\u0442\u043e\u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0435 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432, \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435 <strong>NGINX<\/strong> \u0434\u043b\u044f \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u044d\u0442\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b <strong>NGINX<\/strong> \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043a\u043e\u043c\u0430\u043d\u0434\u044b (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u0435 <strong>\u00abnano\u00bb<\/strong> \u0434\u0440\u0443\u0433\u0438\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u043e\u043c):<\/span><\/p>\n<pre>sudo nano \/etc\/nginx\/sites-available\/myproject<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0444\u0430\u0439\u043b \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u0443\u0433\u043e\u0434\u043d\u043e, \u043d\u043e \u0432 \u0446\u0435\u043b\u043e\u043c \u0442\u0430\u043a\u0438\u043c \u0444\u0430\u0439\u043b\u0430\u043c \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0435 \u0441 \u0441\u0430\u0439\u0442\u043e\u043c. \u0412\u043d\u0435\u0441\u0438\u0442\u0435 \u0432 \u0444\u0430\u0439\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/span><\/p>\n<pre>server {\r\nserver_name \u0434\u043e\u043c\u0435\u043d_\u0438\u043b\u0438_ip.com;\r\naccess_log off;\r\nlocation \/static\/ {\r\nalias \/opt\/myenv\/lib\/python2.7\/site-packages\/django\/contrib\/admin\/;\r\n}\r\nlocation \/ {\r\nproxy_pass http:\/\/127.0.0.1:8001;\r\nproxy_set_header X-Forwarded-Host $server_name;\r\nproxy_set_header X-Real-IP $remote_addr;\r\nadd_header P3P 'CP=\"ALL DSP COR PSAa PSDa OUR NOR ONL UNI COM NAV\"';\r\n}\r\n}<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043a\u0440\u043e\u0439\u0442\u0435 \u0444\u0430\u0439\u043b. \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430 \u0433\u043e\u0432\u043e\u0440\u0438\u0442 <strong>NGINX<\/strong> \u043e\u0431\u0441\u043b\u0443\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0441\u0435, \u0447\u0442\u043e \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u043e\u043c\u0435\u043d_\u0438\u043b\u0438_ip.com\/static\/ \u0438\u0437 \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <strong>Django<\/strong>. \u0412\u0441\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u043c\u043e\u0435 \u043d\u0430 \u0434\u043e\u043c\u0435\u043d_\u0438\u043b\u0438_ip.com, \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0445\u043e\u0441\u0442, \u043f\u043e\u0440\u0442 8001 (\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0443\u0449\u0435\u043d <strong>Gunicorn<\/strong>). \u0411\u0435\u0437 \u044d\u0442\u043e\u0433\u043e IP-\u0430\u0434\u0440\u0435\u0441\u043e\u043c \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0431\u0443\u0434\u0435\u0442 127.0.0.1, \u0430 \u0438\u043c\u0435\u043d\u0435\u043c \u0445\u043e\u0441\u0442\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u044f \u0445\u043e\u0441\u0442\u0430 \u0434\u0430\u043d\u043d\u043e\u0433\u043e VPS.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0443\u044e \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b, \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433<span style=\"font-family: Ubuntu Mono,monospace;\"> \/etc\/nginx\/sites-enabled<\/span>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c <strong>NGINX<\/strong> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0430\u043a\u0442\u0438\u0432\u0435\u043d \u043b\u0438 \u0441\u0430\u0439\u0442. \u041f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u043a\u0430\u0442\u0430\u043b\u043e\u0433 <span style=\"font-family: Ubuntu Mono,monospace;\">\/etc\/nginx\/sites-enabled:<\/span><\/span><\/p>\n<pre>cd \/etc\/nginx\/sites-enabled<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435:<\/span><\/p>\n<pre>sudo ln -s ..\/sites-available\/myproject<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u042d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443, \u0447\u0442\u043e \u0443\u043a\u0430\u0436\u0435\u0442 <strong>NGINX<\/strong> \u043d\u0430 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u0430\u0439\u0442\u0430.<\/span><\/p>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0431\u043b\u043e\u043a <span style=\"font-family: Ubuntu,sans-serif;\"><strong>NGINX<\/strong><\/span> \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e:<\/span><\/p>\n<pre>sudo rm default<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <strong>NGINX<\/strong>, \u0447\u0442\u043e\u0431\u044b \u0432\u043d\u0435\u0441\u0435\u043d\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0443\u043f\u0438\u043b\u0438 \u0432 \u0441\u0438\u043b\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435:<\/span><\/p>\n<pre>sudo service nginx restart<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e <strong>Nginx<\/strong> \u0413\u043e\u0442\u043e\u0432 \u043a \u0440\u0430\u0431\u043e\u0442\u0435. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 <strong>django<\/strong> \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c\u0438 \u0432 \u0444\u043e\u043d\u043e\u0432\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"><strong>\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<br \/>\n<\/strong>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/span><\/span>cd \/opt\/myenv\/bin<\/p>\n<pre>touch gunicorn_start\r\nchmod u+x gunicorn_start<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\">\u0418 \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0435\u0433\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/span><\/span><\/p>\n<pre>#!\/bin\/bash\r\n<span style=\"font-family: Ubuntu,sans-serif;\">NAME=\"myproject\" <\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> DJANGODIR=\/opt\/myenv\/myproject <\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> SOCKFILE=\/opt\/myenv\/run\/gunicorn.sock <\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> USER=root<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> GROUP=root <\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> NUM_WORKERS=3 <\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> DJANGO_SETTINGS_MODULE=myproject.settings <\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> DJANGO_WSGI_MODULE=myproject.wsgi <\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> echo \"Starting $NAME as `whoami`\"<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> cd $DJANGODIR<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> source ..\/bin\/activate<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> export DJANGO_SETTINGS_MODULE=$DJANGO_SETTINGS_MODULE<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> export PYTHONPATH=$DJANGODIR:$PYTHONPATH<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> RUNDIR=$(dirname $SOCKFILE)<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> test -d $RUNDIR || mkdir -p $RUNDIR<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> exec ..\/bin\/gunicorn ${DJANGO_WSGI_MODULE}:application \\<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> --name $NAME \\<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> --workers $NUM_WORKERS \\<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> --user=$USER --group=$GROUP \\<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> --bind=0.0.0.0:8001 \\<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"> --log-level=debug \\<\/span>\r\n<span style=\"font-family: Ubuntu,sans-serif;\"><span style=\"font-family: Ubuntu,sans-serif;\"> --log-file=-root@test:\/opt\/myenv\/bin<\/span><\/span><\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0412 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <strong>NAME<\/strong> \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e &#8220;<strong>myproject<\/strong>&#8220;.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> \u0414\u0430\u043b\u0435\u0435 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u044c \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u043e\u0435\u043a\u0442\u0443 <strong>DJANGODIR<\/strong>.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u044b \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043f\u0443\u0442\u044c \u043a \u0444\u0430\u0439\u043b\u0443 \u0441\u043e\u043a\u0435\u0442\u0430 <strong>SOCKFILE<\/strong>.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> \u0422\u0430\u043a \u0436\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0433\u0440\u0443\u043f\u0443 \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u0441\u044f \u0412\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 (<strong>USER<\/strong> \u0438 <strong>GROUP<\/strong>).<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> \u0414\u0430\u043b\u0435\u0435 \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <strong>NUM_WORKERS<\/strong>.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> \u0422\u0430\u043a \u0436\u0435 \u043d\u0443\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0443\u0442\u044c \u043a \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0438 \u043c\u043e\u0434\u0443\u043b\u044e <strong>WSGI<\/strong>.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\"> \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043a\u043e\u0434\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0412\u0430\u043c \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043f\u0440\u0438\u0441\u0432\u043e\u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u0445\u043e\u0441\u0442 \u0438 \u043f\u043e\u0440\u0442 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0430\u0441\u0440\u043e\u0439\u043a\u0430 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0430\u044f (0.0.0.0:8001)<\/span><\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><strong>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c supervisor \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u043c\u0438.<br \/>\n<\/strong>\u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 <strong>supervisor<\/strong> \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/span><\/p>\n<pre>apt-get install supervisor\r\n<\/pre>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre>touch \/etc\/supervisor\/conf.d\/myproject.conf<\/pre>\n<p>\u0418 \u043d\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u0438\u043c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u044b\u043c:<\/p>\n<pre><span style=\"font-family: Ubuntu,sans-serif;\">[program:myproject]\r\ncommand = \/opt\/myenv\/bin\/gunicorn_start \r\nuser = root \r\nstdout_logfile = \/opt\/myenv\/logs\/gunicorn_supervisor.log \r\nredirect_stderr = true \r\nenvironment=LANG=en_US.UTF-8,LC_ALL=en_US.UTF-8 \r\n<\/span><\/pre>\n<p><strong>program:myproject<\/strong> &#8211; \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 Supervisor<br \/>\n<strong>command<\/strong> &#8211; \u043f\u0443\u0442\u044c \u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 Django<br \/>\n<strong>user<\/strong> &#8211; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0441\u043a<br \/>\n<strong>stdout_logfile<\/strong> &#8211; \u043f\u0443\u0442\u044c \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c Supervisor \u043b\u043e\u0433\u0438. \u041e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0438 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438.<br \/>\n<strong>redirect_stderr<\/strong> &#8211; \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u043e\u0448\u0438\u0431\u043e\u043a.<br \/>\n<strong>environment=LANG<\/strong> &#8211; \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u043e\u0432\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432.<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0434\u043b\u044f \u043b\u043e\u0433\u043e\u0432 \u0438 \u043b\u043e\u0433 \u0444\u0430\u0439\u043b. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><span style=\"font-family: Ubuntu,sans-serif;\">mkdir -p \/opt\/myenv\/logs\/\r\ntouch \/opt\/myenv\/logs\/gunicorn_supervisor.log<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043b\u0438\u0448\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0412\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/span><\/p>\n<pre>sudo supervisorctl start myproject<\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0422\u0430\u043a \u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>restart<\/strong> \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <strong>stop<\/strong> \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c.<\/span><br \/>\n<span style=\"font-family: Ubuntu,sans-serif;\">\u0415\u0441\u043b\u0438 \u043d\u0443\u0436\u043d\u043e \u0447\u0442\u043e \u0431\u044b <strong>Supervisor<\/strong> \u043f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u0438\u043b \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu,sans-serif;\">sudo supervisorctl reread\r\nsudo supervisorctl update\r\n<\/span><\/pre>\n<\/li>\n<li><span style=\"font-family: Ubuntu,sans-serif;\"><strong>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043f\u0430\u0441\u0442\u044c \u0432 \u0430\u0434\u043c\u0438\u043d \u043f\u0430\u043d\u0435\u043b\u044c \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/strong><br \/>\n\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 \u043d\u0430\u0448\u0438\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443:<\/span><\/p>\n<pre>source \/opt\/myenv\/bin\/activate\r\ncd \/opt\/myenv\/myproject\r\n<\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u043e\u0441\u043b\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, E-Mail \u0438 \u043f\u0430\u0440\u043e\u043b\u044c:<\/p>\n<pre><span style=\"font-family: Ubuntu,sans-serif;\">python manage.py createsuperuser<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\"><strong>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/strong> \u0435\u0441\u043b\u0438 \u0412\u044b \u0437\u0430\u0431\u044b\u043b\u0438 \u043f\u0430\u0440\u043e\u043b\u044c \u0442\u043e \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c. \u0414\u043b\u044f \u0441\u0431\u0440\u043e\u0441\u0430 \u0442\u0430\u043a \u0436\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0438\u0442\u0435 \u0432 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044e \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c \u0438 \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0439\u0442\u0435 \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u0443\u044e \u0441\u0440\u0435\u0434\u0443. \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0438\u043c \u0432\u00a0<strong>manage.py shell<\/strong><\/span><\/p>\n<pre><span style=\"font-family: Ubuntu,sans-serif;\">python manager.py shell<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u0438 \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c<\/span><\/p>\n<pre><span style=\"font-family: Ubuntu,sans-serif;\">from django.contrib.auth.models import User\r\nuser = User.objects.get( username='root')\r\nuser.set_password(\u00abpassword\u00bb)\r\nuser.save()\r\n<\/span><\/pre>\n<p><span style=\"font-family: Ubuntu,sans-serif;\">\u042d\u0442\u043e \u043b\u0438\u0448\u044c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441 <strong>Django<\/strong>. \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u0441\u044f \u0441 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439: <a href=\"https:\/\/docs.djangoproject.com\/en\/1.9\/\" rel=\"nofollow noopener noreferrer\" target=\"_blank\">Django<\/a><\/span><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e VPS \u0441 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u043c Linux (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Ubuntu) \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c (\u0440\u0430\u0437\u0434\u0435\u043b\u044b 1 \u2013 6) \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443. \u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Django, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u041f\u041e, \u043c\u043e\u0433\u0443\u0442 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 6. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435, \u00a0\u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[69,9],"tags":[310,95,311],"class_list":["post-3507","post","type-post","status-publish","format-standard","hentry","category-dedicated-servers-ru","category-vps-ru","tag-django","tag-nginx","tag-postgres"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu. - Unihost.FAQ<\/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:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu. - Unihost.FAQ\" \/>\n<meta property=\"og:description\" content=\"\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e VPS \u0441 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u043c Linux (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Ubuntu) \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c (\u0440\u0430\u0437\u0434\u0435\u043b\u044b 1 \u2013 6) \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443. \u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Django, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u041f\u041e, \u043c\u043e\u0433\u0443\u0442 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 6. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435, \u00a0\u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"Unihost.FAQ\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/unihost\/\" \/>\n<meta property=\"article:published_time\" content=\"2016-02-01T02:03:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-19T10:53:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/unihost.com\/help\/minio.php?.\/unihost-logo-alt.png\" \/>\n\t<meta property=\"og:image:width\" content=\"250\" \/>\n\t<meta property=\"og:image:height\" content=\"141\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Unihost Support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@unihost\" \/>\n<meta name=\"twitter:site\" content=\"@unihost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Unihost Support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/\"},\"author\":{\"name\":\"Unihost Support\",\"@id\":\"https:\/\/unihost.com\/help\/ru\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\"},\"headline\":\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu.\",\"datePublished\":\"2016-02-01T02:03:37+00:00\",\"dateModified\":\"2023-01-19T10:53:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/\"},\"wordCount\":1517,\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/ru\/#organization\"},\"keywords\":[\"Django\",\"Nginx\",\"Postgres\"],\"articleSection\":[\"02. \u0421\u0435\u0440\u0432\u0435\u0440\u044b\",\"VPS\"],\"inLanguage\":\"ru\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/\",\"url\":\"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/\",\"name\":\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu. - Unihost.FAQ\",\"isPartOf\":{\"@id\":\"https:\/\/unihost.com\/help\/ru\/#website\"},\"datePublished\":\"2016-02-01T02:03:37+00:00\",\"dateModified\":\"2023-01-19T10:53:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/#breadcrumb\"},\"inLanguage\":\"ru\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Unihost\",\"item\":\"https:\/\/unihost.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Help\",\"item\":\"https:\/\/unihost.com\/help\/ru\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/unihost.com\/help\/ru\/#website\",\"url\":\"https:\/\/unihost.com\/help\/ru\/\",\"name\":\"Unihost.FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/unihost.com\/help\/ru\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/unihost.com\/help\/ru\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ru\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/unihost.com\/help\/ru\/#organization\",\"name\":\"Unihost\",\"alternateName\":\"Unihost\",\"url\":\"https:\/\/unihost.com\/help\/ru\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru\",\"@id\":\"https:\/\/unihost.com\/help\/ru\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"contentUrl\":\"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png\",\"width\":300,\"height\":300,\"caption\":\"Unihost\"},\"image\":{\"@id\":\"https:\/\/unihost.com\/help\/ru\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/unihost\/\",\"https:\/\/x.com\/unihost\",\"https:\/\/www.instagram.com\/unihost\/?hl=en\",\"https:\/\/www.linkedin.com\/company\/unihost-com\",\"https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/unihost.com\/help\/ru\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a\",\"name\":\"Unihost Support\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru\",\"@id\":\"https:\/\/unihost.com\/help\/ru\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g\",\"caption\":\"Unihost Support\"},\"sameAs\":[\"https:\/\/unihost.com\/\"],\"url\":\"https:\/\/unihost.com\/help\/ru\/author\/support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu. - Unihost.FAQ","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:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/","og_locale":"ru_RU","og_type":"article","og_title":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu. - Unihost.FAQ","og_description":"\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e VPS \u0441 \u0434\u0438\u0441\u0442\u0440\u0438\u0431\u0443\u0442\u0438\u0432\u043e\u043c Linux (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, Ubuntu) \u0443\u0436\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0434\u0430\u043d\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u043e \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c (\u0440\u0430\u0437\u0434\u0435\u043b\u044b 1 \u2013 6) \u043e\u0445\u0432\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443. \u041f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 Django, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u041f\u041e, \u043c\u043e\u0433\u0443\u0442 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 6. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b \u0441\u043e\u0432\u0435\u0442\u044b \u043f\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0435, \u00a0\u043c\u043e\u0433\u0443\u0442 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u043a \u0440\u0430\u0437\u0434\u0435\u043b\u0443 [&hellip;]","og_url":"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/","og_site_name":"Unihost.FAQ","article_publisher":"https:\/\/www.facebook.com\/unihost\/","article_published_time":"2016-02-01T02:03:37+00:00","article_modified_time":"2023-01-19T10:53:47+00:00","og_image":[{"width":250,"height":141,"url":"https:\/\/unihost.com\/help\/minio.php?.\/unihost-logo-alt.png","type":"image\/png"}],"author":"Unihost Support","twitter_card":"summary_large_image","twitter_creator":"@unihost","twitter_site":"@unihost","twitter_misc":{"Written by":"Unihost Support","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/"},"author":{"name":"Unihost Support","@id":"https:\/\/unihost.com\/help\/ru\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a"},"headline":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu.","datePublished":"2016-02-01T02:03:37+00:00","dateModified":"2023-01-19T10:53:47+00:00","mainEntityOfPage":{"@id":"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/"},"wordCount":1517,"publisher":{"@id":"https:\/\/unihost.com\/help\/ru\/#organization"},"keywords":["Django","Nginx","Postgres"],"articleSection":["02. \u0421\u0435\u0440\u0432\u0435\u0440\u044b","VPS"],"inLanguage":"ru"},{"@type":"WebPage","@id":"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/","url":"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/","name":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu. - Unihost.FAQ","isPartOf":{"@id":"https:\/\/unihost.com\/help\/ru\/#website"},"datePublished":"2016-02-01T02:03:37+00:00","dateModified":"2023-01-19T10:53:47+00:00","breadcrumb":{"@id":"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/#breadcrumb"},"inLanguage":"ru","potentialAction":[{"@type":"ReadAction","target":["https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/unihost.com\/help\/ru\/installation-and-configuration-django-with-postgres-nginx-and-gunicorn-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Unihost","item":"https:\/\/unihost.com\/"},{"@type":"ListItem","position":2,"name":"Help","item":"https:\/\/unihost.com\/help\/ru\/"},{"@type":"ListItem","position":3,"name":"\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Django \u0441 Postgres, Nginx \u0438 Gunicorn \u043d\u0430 Ubuntu."}]},{"@type":"WebSite","@id":"https:\/\/unihost.com\/help\/ru\/#website","url":"https:\/\/unihost.com\/help\/ru\/","name":"Unihost.FAQ","description":"","publisher":{"@id":"https:\/\/unihost.com\/help\/ru\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/unihost.com\/help\/ru\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ru"},{"@type":"Organization","@id":"https:\/\/unihost.com\/help\/ru\/#organization","name":"Unihost","alternateName":"Unihost","url":"https:\/\/unihost.com\/help\/ru\/","logo":{"@type":"ImageObject","inLanguage":"ru","@id":"https:\/\/unihost.com\/help\/ru\/#\/schema\/logo\/image\/","url":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","contentUrl":"https:\/\/unihost.com\/help\/minio.php?2026\/01\/minio.png","width":300,"height":300,"caption":"Unihost"},"image":{"@id":"https:\/\/unihost.com\/help\/ru\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/unihost\/","https:\/\/x.com\/unihost","https:\/\/www.instagram.com\/unihost\/?hl=en","https:\/\/www.linkedin.com\/company\/unihost-com","https:\/\/www.youtube.com\/channel\/UCITKsxMDnslQY8brN3advgw"]},{"@type":"Person","@id":"https:\/\/unihost.com\/help\/ru\/#\/schema\/person\/bb5ae95f38577c920e6a7507888b715a","name":"Unihost Support","image":{"@type":"ImageObject","inLanguage":"ru","@id":"https:\/\/unihost.com\/help\/ru\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a0c9db17c2a0d93e8a0d5ac123f8c5db750ad4d3d5657369c0c4e480f5af77b8?s=96&d=mm&r=g","caption":"Unihost Support"},"sameAs":["https:\/\/unihost.com\/"],"url":"https:\/\/unihost.com\/help\/ru\/author\/support\/"}]}},"_links":{"self":[{"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/posts\/3507","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/comments?post=3507"}],"version-history":[{"count":17,"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/posts\/3507\/revisions"}],"predecessor-version":[{"id":4479,"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/posts\/3507\/revisions\/4479"}],"wp:attachment":[{"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/media?parent=3507"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/categories?post=3507"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unihost.com\/help\/ru\/wp-json\/wp\/v2\/tags?post=3507"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}