{"id":2655,"date":"2018-10-05T21:00:11","date_gmt":"2018-10-05T15:30:11","guid":{"rendered":"https:\/\/blog.pheonixsolutions.com\/?p=2655"},"modified":"2019-04-05T18:07:57","modified_gmt":"2019-04-05T12:37:57","slug":"setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/","title":{"rendered":"Setting up Django and your web server with uWSGI and nginx on Ubuntu"},"content":{"rendered":"<h2>Setting up Django and your web server with uWSGI and nginx<\/h2>\n<p><strong>Date posted: 05-oct-2018<\/strong><\/p>\n<p>\u00a0<\/p>\n<p>In this article, we will see how to setup a Django web application on Ubuntu 16.04 server. We&#8217;ll use UWSGIservice to deploy our webapp along with Nginx.<\/p>\n<h4>Requirements:-<\/h4>\n<p>Python 3.6<\/p>\n<p>Django\u00a02.0.7<\/p>\n<p>Nginx\u00a01.10.3<\/p>\n<p>Ubuntu 16.04<\/p>\n<h4>Install Python basic packages<\/h4>\n<p class=\"p1\"><code>sudo apt-get install python3-dev\u00a0\u00a0python3-pip\u00a0<\/code><\/p>\n<p class=\"p1\"><code>sudo apt-get install python3-setuptools<\/code><\/p>\n<p class=\"p1\"><code>sudo apt-get install python3-kivy<\/code><\/p>\n<h4 class=\"p1\">Install Virutal Environment<\/h4>\n<p><code>pip3 install virtualenv virtualenvwrapper<\/code><code><\/code><\/p>\n<h4>Install Django<\/h4>\n<p><code>pip3 install django<\/code><\/p>\n<h4 class=\"p1\">Install UWSGI<\/h4>\n<h4 class=\"p1\"><code>sudo pip install uwsgi<\/code><\/h4>\n<p class=\"p1\">Now we need to create the vassals folder, which is the folder where our <code>.ini<\/code> files (called <code>vassals<\/code>) will reside upon. Inside vassals we will have two other folders: <code>available<\/code> and <code>enabled<\/code>. The first will contain all the (.ini) configuration files. While the second (<code>enabled<\/code>) will contain a symlink to the files at <code>available<\/code><\/p>\n<p class=\"p1\"><code>cd \/etc\/<\/code><\/p>\n<p class=\"p1\"><code>sudo mkdir uwsgi<\/code><\/p>\n<p class=\"p1\"><code>cd uwsgi<\/code><\/p>\n<p class=\"p1\"><code>sudo mkdir vassals<\/code><\/p>\n<p class=\"p1\"><code>cd vassals<\/code><\/p>\n<p class=\"p1\"><code>sudo mkdir enabled<\/code><\/p>\n<p class=\"p1\"><code>sudo mkdir available<\/code><\/p>\n<p class=\"p1\">Now we need to create an <code>emperor.ini<\/code> file, which will contain the path for the other vassals at <code>enabled<\/code>:<\/p>\n<p class=\"p1\"><code>sudo nano \/etc\/uwsgi\/vassals\/emperor.ini<\/code><\/p>\n<p class=\"p1\">Add this lines to the file:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[uwsgi]\n\nemperor = \/etc\/uwsgi\/vassals\/enabled<\/pre>\n<p class=\"p1\">Now, it&#8217;s time to deamonize uwsgi. In order to do it, create a <code>usgi.service<\/code> file at <code>\/etc\/systemd\/system\/<\/code>:<\/p>\n<p class=\"p1\"><code>sudo vi \/etc\/systemd\/system\/uwsgi.service<\/code><\/p>\n<p class=\"p1\">Now, paste the following content into it:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">[Unit]\nDescription=uWSGI Emperor\nAfter=syslog.target\n\n[Service]\nExecStart=\/usr\/local\/bin\/uwsgi --ini \/etc\/uwsgi\/vassals\/emperor.ini\n# Requires systemd version 211 or newer\nRuntimeDirectory=uwsgi\nRestart=always\nKillSignal=SIGQUIT\nType=notify\nStandardError=syslog\nNotifyAccess=all\n\n[Install]\nWantedBy=multi-user.target<\/pre>\n<p class=\"p1\">To start the service<\/p>\n<p class=\"p1\"><code>sudo systemctl start uwsgi<\/code><\/p>\n<p class=\"p1\">To check service status<\/p>\n<p class=\"p1\"><code>systemctl status uwsgi<\/code><\/p>\n<p class=\"p1\">Lets enable the service. So that it starts at boot<\/p>\n<p class=\"p1\"><code>sudo systemctl enable uwsgi<\/code><\/p>\n<p class=\"p1\">To stop the service<\/p>\n<p class=\"p1\"><code>sudo systemctl stop uwsgi<\/code><\/p>\n<p>Lets configure our django project to run with uwsgi.<\/p>\n<p>Lets create a file\u00a0\/etc\/uwsgi\/vassals\/available\/kb_web.ini<\/p>\n<p><code>vi\u00a0\/etc\/uwsgi\/vassals\/available\/web_app.ini<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\"># webapp_uwsgi.ini file\n[uwsgi]\n\n# Django-related settings\n# the base directory (full path)\nchdir           = \/var\/www\/webapp\n# Django's wsgi file\nmodule          = webapp.wsgi\nenable-threads = true\n\n# process-related settings\n# master\nmaster          = true\n# maximum number of worker processes\nprocesses       = 10\nlisten  = 100\n# the socket (use the full path to be safe\nsocket          = \/var\/www\/webapp\/webapp\/web_app.sock\n# ... with appropriate permissions - may be needed\nchmod-socket    = 666\n# clear environment on exit\nvacuum          = true\nmax-requests = 1000\n#limit-as = 128\ndaemonize =  \/var\/log\/uwsgi-emperor.log<\/pre>\n<p>Lets create a symlink to <code>enabled<\/code> folder<\/p>\n<p><code>ln -s\u00a0\/etc\/uwsgi\/vassals\/available\/kb_web.ini\u00a0\/etc\/uwsgi\/vassals\/enabled\/<\/code><\/p>\n<p>Please make sure you&#8217;ve uploaded your project folder under \/var\/www<\/p>\n<p><span style=\"color: #222222;\"><span style=\"background-color: #f2f4f5;\"><code>ls -l \/var\/www\/webapp<\/code><\/span><\/span><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">drwxr-xr-x 3 www-data www-data 4096 Sep 14 05:41 bin\ndrwxr-xr-x 6 root     root     4096 Oct  4 13:46 webapp\n-rwxr-xr-x 1 root     root      538 Aug 10 02:14 manage.py\n-rw-r--r-- 1 root     root      275 Aug 10 02:14 requirements<\/pre>\n<p>Lets manually verify the application by running this command<\/p>\n<p><code>python3 manage.py runserver 0.0.0.0:8000<\/code><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\"># python3 manage.py runserver 0.0.0.0:8000\nPerforming system checks...\n\nSystem check identified no issues (0 silenced).\nOctober 05, 2018 - 12:17:12\nDjango version 2.0.7, using settings 'kb1988.settings'\nStarting development server at http:\/\/0.0.0.0:8000\/\nQuit the server with CONTROL-C.<\/pre>\n<p>It looks fine and no python module errors.<\/p>\n<h4>Configure nginx domain<\/h4>\n<p>Lets configure nginx virtual host<\/p>\n<p><code>vi \/etc\/nginx\/sites-available\/webapp.com<\/code><\/p>\n<p>Enter the below contents. You can adjust the folder path as per your needs.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">upstream web_app {\n     server unix:\/\/\/var\/www\/webapp\/webapp\/kb_web.sock; # for a file socket\n}\nserver {\n    # the port your site will be served on\n    listen      80;\n    # the domain name it will serve for\n    server_name pheonixsolutions.com\n    charset     utf-8;\n\n    # max upload size\n    client_max_body_size 75M;   # adjust to taste\n    location \/media  {\n        alias \/var\/www\/webapp\/webapp\/media;  # your Django project's media files - amend as required\n    }\n\n    location \/static {\n        alias \/var\/www\/webapp\/webapp\/static;\n    }\n\n    # Finally, send all non-media requests to the Django server.\n    location \/ {\n        uwsgi_pass  web_app;\n        include     \/etc\/nginx\/uwsgi_params; # the uwsgi_params file you installed\n    }\n}<\/pre>\n<p>Verify nginx syntax test<\/p>\n<p><code>nginx -t<\/code><\/p>\n<p>Reload nginx service<\/p>\n<p><code>\/etc\/init.d\/nginx reload<\/code><\/p>\n<p>Restart UWSGI<\/p>\n<p><code>service restart uwsgi\u00a0<\/code><\/p>\n<p>Your domain should work at <code>http:\/\/pheonixsolutions.com<\/code><\/p>\n<h4>Added tips:-<\/h4>\n<p>To create superuser admin<br \/><br \/>virtualenv command , which will give platform to run source\/bin\/activate.<br \/><code><br \/>source \/var\/www\/webapp\/bin\/activate<\/code><\/p>\n<p><code>python3 manage.py createsuperuser --username=devops --<\/code><\/p>\n<p><code>email=devops@pheonixsolutions.com<\/code><code><br \/>\nEnter password: ********<\/code><\/p>\n<p>To collect static files from all the apps in one place<\/p>\n<p><code>python3 manage.py collectstatic<\/code><\/p>\n<p>If you run into errors, You should mention STATIC_ROOT path in your settings.py file. And then run above command again.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">STATIC_ROOT = '\/var\/www\/webapp\/webapp\/static\/'<\/pre>\n<p>\u00a0<\/p>\n<h2><strong>Steps to eradicate Django migration errors-&#8220;core_module issue&#8221; :<\/strong><\/h2>\n<p>In python you need to do migrate the changes on prod while its running. If we didn&#8217;t complete the migration properly.<\/p>\n<p>\u00a0<\/p>\n<p>This kind of error will make us more disappointing at a last stage of migration. we will see errors like shown below.<\/p>\n<p>\u00a0<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/blog.pheonixsolutions.com\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png\" alt=\"This image has an empty alt attribute; its file name is Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png\" \/><\/p>\n\n\n<p>As the error stats that this is an issue with core module. We believe that the code migration didn&#8217;t applied completely. <\/p>\n\n\n\n<p>To resolve that we need to run below commands:-<\/p>\n\n\n<pre class=\"wp-block-code\"><code>python3.6 manage.py makemigrations core\npython3.6 manage.py migrate core<\/code><\/pre>\n<p>Now login to your django admin panel and check. The errors should be gone.<\/p>\n\n\n<p>That&#8217;s it. We&#8217;re done with the setup!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up Django and your web server with uWSGI and nginx Date posted: 05-oct-2018 \u00a0 In this article, we will see how to setup a Django web application on Ubuntu 16.04 server. We&#8217;ll use UWSGIservice to deploy our webapp along with Nginx. Requirements:- Python 3.6 Django\u00a02.0.7 Nginx\u00a01.10.3 Ubuntu 16.04 Install&hellip; <a href=\"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/\" class=\"more-link read-more\" rel=\"bookmark\">Continue Reading <span class=\"screen-reader-text\">Setting up Django and your web server with uWSGI and nginx on Ubuntu<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[313,4,356,298,259,291,220],"tags":[],"class_list":{"0":"post-2655","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-apache","7":"category-litespeed","8":"category-mysql","9":"category-nginx","10":"category-python","11":"category-python-script","12":"category-web-server","13":"h-entry","15":"h-as-article"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Pheonix Solutions - We Empower Your Business Growth<\/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:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Pheonix Solutions - We Empower Your Business Growth\" \/>\n<meta property=\"og:description\" content=\"Setting up Django and your web server with uWSGI and nginx Date posted: 05-oct-2018 \u00a0 In this article, we will see how to setup a Django web application on Ubuntu 16.04 server. We&#8217;ll use UWSGIservice to deploy our webapp along with Nginx. Requirements:- Python 3.6 Django\u00a02.0.7 Nginx\u00a01.10.3 Ubuntu 16.04 Install&hellip; Continue Reading Setting up Django and your web server with uWSGI and nginx on Ubuntu\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/\" \/>\n<meta property=\"og:site_name\" content=\"PHEONIXSOLUTIONS\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/\" \/>\n<meta property=\"article:published_time\" content=\"2018-10-05T15:30:11+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-05T12:37:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.pheonixsolutions.com\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:site\" content=\"@pheonixsolution\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffa33d73c869faec2d50e79c24e3503\"},\"headline\":\"Setting up Django and your web server with uWSGI and nginx on Ubuntu\",\"datePublished\":\"2018-10-05T15:30:11+00:00\",\"dateModified\":\"2019-04-05T12:37:57+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/\"},\"wordCount\":430,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.pheonixsolutions.com\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png\",\"articleSection\":[\"Apache\",\"LiteSpeed\",\"MySQL\",\"Nginx\",\"Python\",\"Python\",\"Web Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/\",\"name\":\"Pheonix Solutions - We Empower Your Business Growth\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.pheonixsolutions.com\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png\",\"datePublished\":\"2018-10-05T15:30:11+00:00\",\"dateModified\":\"2019-04-05T12:37:57+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.pheonixsolutions.com\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png\",\"contentUrl\":\"https:\\\/\\\/blog.pheonixsolutions.com\\\/wp-content\\\/uploads\\\/2019\\\/03\\\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Setting up Django and your web server with uWSGI and nginx on Ubuntu\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"name\":\"Pheonix Solutions\",\"description\":\"We Empower Your Business Growth\",\"publisher\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#organization\",\"name\":\"PheonixSolutions\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"contentUrl\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/12\\\/logo.png\",\"width\":454,\"height\":300,\"caption\":\"PheonixSolutions\"},\"image\":{\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/PheonixSolutions-209942982759387\\\/\",\"https:\\\/\\\/x.com\\\/pheonixsolution\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/0ffa33d73c869faec2d50e79c24e3503\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"http:\\\/\\\/blog.pheonixsolutions.com\"],\"url\":\"https:\\\/\\\/pheonixsolutions.com\\\/blog\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Pheonix Solutions - We Empower Your Business Growth","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:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/","og_locale":"en_US","og_type":"article","og_title":"Pheonix Solutions - We Empower Your Business Growth","og_description":"Setting up Django and your web server with uWSGI and nginx Date posted: 05-oct-2018 \u00a0 In this article, we will see how to setup a Django web application on Ubuntu 16.04 server. We&#8217;ll use UWSGIservice to deploy our webapp along with Nginx. Requirements:- Python 3.6 Django\u00a02.0.7 Nginx\u00a01.10.3 Ubuntu 16.04 Install&hellip; Continue Reading Setting up Django and your web server with uWSGI and nginx on Ubuntu","og_url":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/","og_site_name":"PHEONIXSOLUTIONS","article_publisher":"https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","article_published_time":"2018-10-05T15:30:11+00:00","article_modified_time":"2019-04-05T12:37:57+00:00","og_image":[{"url":"https:\/\/blog.pheonixsolutions.com\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png","type":"","width":"","height":""}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@pheonixsolution","twitter_site":"@pheonixsolution","twitter_misc":{"Written by":"admin","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/#article","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/"},"author":{"name":"admin","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/0ffa33d73c869faec2d50e79c24e3503"},"headline":"Setting up Django and your web server with uWSGI and nginx on Ubuntu","datePublished":"2018-10-05T15:30:11+00:00","dateModified":"2019-04-05T12:37:57+00:00","mainEntityOfPage":{"@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/"},"wordCount":430,"commentCount":0,"publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"image":{"@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.pheonixsolutions.com\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png","articleSection":["Apache","LiteSpeed","MySQL","Nginx","Python","Python","Web Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/","url":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/","name":"Pheonix Solutions - We Empower Your Business Growth","isPartOf":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/#primaryimage"},"image":{"@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.pheonixsolutions.com\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png","datePublished":"2018-10-05T15:30:11+00:00","dateModified":"2019-04-05T12:37:57+00:00","breadcrumb":{"@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/#primaryimage","url":"https:\/\/blog.pheonixsolutions.com\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png","contentUrl":"https:\/\/blog.pheonixsolutions.com\/wp-content\/uploads\/2019\/03\/Screen-Shot-2019-03-29-at-1.23.41-PM-1-1024x343.png"},{"@type":"BreadcrumbList","@id":"https:\/\/pheonixsolutions.com\/blog\/setting-up-django-and-your-web-server-with-uwsgi-and-nginx-on-ubuntu\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pheonixsolutions.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Setting up Django and your web server with uWSGI and nginx on Ubuntu"}]},{"@type":"WebSite","@id":"https:\/\/pheonixsolutions.com\/blog\/#website","url":"https:\/\/pheonixsolutions.com\/blog\/","name":"Pheonix Solutions","description":"We Empower Your Business Growth","publisher":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pheonixsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/pheonixsolutions.com\/blog\/#organization","name":"PheonixSolutions","url":"https:\/\/pheonixsolutions.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","contentUrl":"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2016\/12\/logo.png","width":454,"height":300,"caption":"PheonixSolutions"},"image":{"@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/PheonixSolutions-209942982759387\/","https:\/\/x.com\/pheonixsolution"]},{"@type":"Person","@id":"https:\/\/pheonixsolutions.com\/blog\/#\/schema\/person\/0ffa33d73c869faec2d50e79c24e3503","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/09bacc0294abee1322a23ab4bc6a0330dd4cb4df707dc9d0b0efeba6c109608b?s=96&r=g","caption":"admin"},"sameAs":["http:\/\/blog.pheonixsolutions.com"],"url":"https:\/\/pheonixsolutions.com\/blog\/author\/admin\/"}]}},"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7F4uM-GP","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=2655"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/2655\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=2655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=2655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=2655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}