{"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"],"_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}]}}