{"id":2095,"date":"2021-02-18T19:26:12","date_gmt":"2021-02-18T19:26:12","guid":{"rendered":"https:\/\/www.thenaylors.co.uk\/wordpress\/?p=2095"},"modified":"2021-02-18T19:26:12","modified_gmt":"2021-02-18T19:26:12","slug":"deploying-django-app-on-linux-server-running-uwsgi-from-github","status":"publish","type":"post","link":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/","title":{"rendered":"Deploying Django app on linux server running uwsgi from Github"},"content":{"rendered":"<ol>\n<li>\u00a0Decide folder for environment.\u00a0 e.g. \/media\/www\/captainslog.<\/li>\n<li>\u00a0Go to media\/www and download from github into new directory e.g. sudo git clone https:\/\/github.com\/mjnaylor8\/django-captainslog.git captainslog<\/li>\n<li>Create virtual environment.\u00a0 sudo python3 venv env<\/li>\n<li>Check it works OK.\u00a0 Go to env directory and run source bin\/activate<\/li>\n<li>Move back up one directory and assuming there is a requirements.txt file run pip3 install -r requirements.txt<\/li>\n<li>Deploy any bespoke apps from github&#8230;..\u00a0 pip install git+https:\/\/github.com\/mjnaylor8\/django-mapbox-location-field.git<\/li>\n<li>Make changes to manage.py, asgi.py and wsgi.py to ensure pointing to production settings &#8230;.\n<div>\n<div>os.environ.setdefault(&#8216;DJANGO_SETTINGS_MODULE&#8217;, &#8216;captains_log.settings.<strong>production<\/strong>&#8216;)<\/div>\n<\/div>\n<\/li>\n<li>Run python3 manage.py collectstatic to ensure all collected OK<\/li>\n<li>Restart emporer sudo systemctl restart emperor.uwsgi<\/li>\n<li>Restart nginx sudo systemctl restart nginx<\/li>\n<li>Pray it is OK<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0Decide folder for environment.\u00a0 e.g. \/media\/www\/captainslog. \u00a0Go to media\/www and download from github into new directory e.g. sudo git clone https:\/\/github.com\/mjnaylor8\/django-captainslog.git captainslog Create virtual environment.\u00a0 sudo python3 venv env Check it works OK.\u00a0 Go to env directory and run source bin\/activate Move back up one directory and assuming there is a requirements.txt file run pip3 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Deploying Django app on linux server running uwsgi from Github&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[179,180,181],"class_list":["post-2095","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-django","tag-github","tag-nas"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Deploying Django app on linux server running uwsgi from Github - Michael Naylor<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deploying Django app on linux server running uwsgi from Github - Michael Naylor\" \/>\n<meta property=\"og:description\" content=\"\u00a0Decide folder for environment.\u00a0 e.g. \/media\/www\/captainslog. \u00a0Go to media\/www and download from github into new directory e.g. sudo git clone https:\/\/github.com\/mjnaylor8\/django-captainslog.git captainslog Create virtual environment.\u00a0 sudo python3 venv env Check it works OK.\u00a0 Go to env directory and run source bin\/activate Move back up one directory and assuming there is a requirements.txt file run pip3 &hellip; Continue reading &quot;Deploying Django app on linux server running uwsgi from Github&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/\" \/>\n<meta property=\"og:site_name\" content=\"Michael Naylor\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-18T19:26:12+00:00\" \/>\n<meta name=\"author\" content=\"Michael Naylor\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mjnaylor\" \/>\n<meta name=\"twitter:site\" content=\"@mjnaylor\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Naylor\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/\"},\"author\":{\"name\":\"Michael Naylor\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\"},\"headline\":\"Deploying Django app on linux server running uwsgi from Github\",\"datePublished\":\"2021-02-18T19:26:12+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/\"},\"wordCount\":149,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\"},\"keywords\":[\"django\",\"github\",\"nas\"],\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/\",\"url\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/\",\"name\":\"Deploying Django app on linux server running uwsgi from Github - Michael Naylor\",\"isPartOf\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#website\"},\"datePublished\":\"2021-02-18T19:26:12+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploying Django app on linux server running uwsgi from Github\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#website\",\"url\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/\",\"name\":\"Michael Naylor\",\"description\":\"Things which interest me.\",\"publisher\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5\",\"name\":\"Michael Naylor\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g\",\"caption\":\"Michael Naylor\"},\"logo\":{\"@id\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/\"},\"sameAs\":[\"http:\/\/www.thenaylors.co.uk\/wordpress\"],\"url\":\"https:\/\/www.thenaylors.co.uk\/wordpress\/author\/michael\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Deploying Django app on linux server running uwsgi from Github - Michael Naylor","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/","og_locale":"en_GB","og_type":"article","og_title":"Deploying Django app on linux server running uwsgi from Github - Michael Naylor","og_description":"\u00a0Decide folder for environment.\u00a0 e.g. \/media\/www\/captainslog. \u00a0Go to media\/www and download from github into new directory e.g. sudo git clone https:\/\/github.com\/mjnaylor8\/django-captainslog.git captainslog Create virtual environment.\u00a0 sudo python3 venv env Check it works OK.\u00a0 Go to env directory and run source bin\/activate Move back up one directory and assuming there is a requirements.txt file run pip3 &hellip; Continue reading \"Deploying Django app on linux server running uwsgi from Github\"","og_url":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/","og_site_name":"Michael Naylor","article_published_time":"2021-02-18T19:26:12+00:00","author":"Michael Naylor","twitter_card":"summary_large_image","twitter_creator":"@mjnaylor","twitter_site":"@mjnaylor","twitter_misc":{"Written by":"Michael Naylor","Estimated reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/#article","isPartOf":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/"},"author":{"name":"Michael Naylor","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5"},"headline":"Deploying Django app on linux server running uwsgi from Github","datePublished":"2021-02-18T19:26:12+00:00","mainEntityOfPage":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/"},"wordCount":149,"commentCount":0,"publisher":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5"},"keywords":["django","github","nas"],"inLanguage":"en-GB","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/","url":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/","name":"Deploying Django app on linux server running uwsgi from Github - Michael Naylor","isPartOf":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#website"},"datePublished":"2021-02-18T19:26:12+00:00","breadcrumb":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/deploying-django-app-on-linux-server-running-uwsgi-from-github\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.thenaylors.co.uk\/wordpress\/"},{"@type":"ListItem","position":2,"name":"Deploying Django app on linux server running uwsgi from Github"}]},{"@type":"WebSite","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#website","url":"https:\/\/www.thenaylors.co.uk\/wordpress\/","name":"Michael Naylor","description":"Things which interest me.","publisher":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.thenaylors.co.uk\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":["Person","Organization"],"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/22e1ad271f44b7f71c8e1fbf982dcbe5","name":"Michael Naylor","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/2aa27338833977999b7baeb1ee9e723e?s=96&d=mm&r=g","caption":"Michael Naylor"},"logo":{"@id":"https:\/\/www.thenaylors.co.uk\/wordpress\/#\/schema\/person\/image\/"},"sameAs":["http:\/\/www.thenaylors.co.uk\/wordpress"],"url":"https:\/\/www.thenaylors.co.uk\/wordpress\/author\/michael\/"}]}},"_links":{"self":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/2095","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/comments?post=2095"}],"version-history":[{"count":1,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/2095\/revisions"}],"predecessor-version":[{"id":2096,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/posts\/2095\/revisions\/2096"}],"wp:attachment":[{"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/media?parent=2095"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/categories?post=2095"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thenaylors.co.uk\/wordpress\/wp-json\/wp\/v2\/tags?post=2095"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}