{"id":1056,"date":"2020-02-07T17:33:25","date_gmt":"2020-02-07T17:33:25","guid":{"rendered":"http:\/\/blog.webhostpython.com\/?p=1056"},"modified":"2020-10-21T10:12:37","modified_gmt":"2020-10-21T10:12:37","slug":"getting-started-with-python-django-hosting-plan","status":"publish","type":"post","link":"https:\/\/blog.webhostpython.com\/2020\/02\/07\/getting-started-with-python-django-hosting-plan\/","title":{"rendered":"Getting started with Python\/Django Hosting plan"},"content":{"rendered":"\n<p> Here at Webhostpython.com, we completely support Python and the Django framework. This has been one of our main focal points, hence the name &#8220;Webhostpython&#8221;. We are avid supporters of this beautiful programming language. <\/p>\n\n\n\n<p>Our Python plans support multiple versions of not only Python, but of Django and other frameworks as well, making this an ideal web hosting environment for developers looking to develop in an ever-evolving yet stable environment<\/p>\n\n\n\n<p><strong>Uploading your Python Application to our server<\/strong><\/p>\n\n\n\n<p>In order to get started, all you need to do is the following:<\/p>\n\n\n\n<p><br>1. Upload your application that was created on your local machine via FTP\/SFTP\/cPanel File Manager to a path such as \/app1 . There is no right or wrong folder to upload your application to, we&#8217;re just using &#8220;app1&#8221; here as an example.<\/p>\n\n\n\n<p><br>2. After this, login to cPanel, head to Software -&gt; Setup Python App<\/p>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-http:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"228\" src=\"http:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1-1024x228.png\" alt=\"\" class=\"wp-image-1057\" srcset=\"https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1-1024x228.png 1024w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1-300x67.png 300w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1-768x171.png 768w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1-1536x341.png 1536w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1-2048x455.png 2048w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1-696x155.png 696w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1-1068x237.png 1068w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python1-1890x420.png 1890w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><br>3. Now, click the Blue &#8220;CREATE APPLICATION&#8221; button<\/p>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-http:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"296\" src=\"http:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2-1024x296.png\" alt=\"\" class=\"wp-image-1058\" srcset=\"https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2-1024x296.png 1024w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2-300x87.png 300w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2-768x222.png 768w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2-1536x444.png 1536w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2-2048x592.png 2048w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2-696x201.png 696w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2-1068x309.png 1068w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python2-1453x420.png 1453w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><br>4. Select values such as:<br>Python version: [Pick the appropriate version]<br>Application root: \/app1 [or whatever folder you uploaded to]<br>Application URL: \/ [or \/subfolder, etc]<br>Application startup file: This is the path to your wsgi.py file. This may be app1\/wsgi.py for example.<\/p>\n\n\n\n<p><span class=\"has-inline-color has-vivid-green-cyan-color\"><strong>If you are deploying a Django app<\/strong>, create a file named passenger_wsgi.py inside the same directory as your manage.py. Delete all its contents and add the following<br><\/span><span class=\"has-inline-color has-cyan-bluish-gray-color\">from &lt;yourapp>.wsgi import application<\/span><span class=\"has-inline-color has-vivid-green-cyan-color\"><br>Now instead of the wsgi.py file, your Application startup file for the below screen should be passenger_wsgi.py file.<\/span><br><\/p>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-http:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"466\" src=\"http:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4-1024x466.png\" alt=\"\" class=\"wp-image-1059\" srcset=\"https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4-1024x466.png 1024w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4-300x137.png 300w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4-768x350.png 768w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4-1536x699.png 1536w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4-2048x932.png 2048w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4-696x317.png 696w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4-1068x486.png 1068w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python4-923x420.png 923w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Now click on Create which will take you here:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large td-caption-align-http:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"471\" src=\"http:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5-1024x471.png\" alt=\"\" class=\"wp-image-1060\" srcset=\"https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5-1024x471.png 1024w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5-300x138.png 300w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5-768x353.png 768w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5-1536x706.png 1536w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5-2048x942.png 2048w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5-696x320.png 696w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5-1068x491.png 1068w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python5-913x420.png 913w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>That&#8217;s it! This screen is important as it tells you your &#8220;Virtual Environment&#8221; which is needed so you can install your required modules, pandas, requests, etc. via SSH. In this example, it tells me:<\/p>\n\n\n\n<p> To enter to virtual environment, run the command: source \/home\/migrate\/virtualenv\/app2\/3.7\/bin\/activate &amp;&amp; cd \/home\/migrate\/app2 <\/p>\n\n\n\n<p>To do this, log into SSH using the cPanel Username and password for this account as well as the proper port (Ask support for this if you do not know it)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"600\" height=\"345\" src=\"http:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python6.png\" alt=\"\" class=\"wp-image-1061\" srcset=\"https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python6.png 600w, https:\/\/blog.webhostpython.com\/wp-content\/uploads\/2020\/02\/python6-300x173.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/figure>\n\n\n\n<p>Now that you&#8217;ve loaded the Virtual Environment, you will then be inside of your virtual environment and can then run &#8220;pip install [module]&#8221;. <\/p>\n\n\n\n<p>Thank you!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here at Webhostpython.com, we completely support Python and the Django framework. This has been one of our main focal points, hence the name &#8220;Webhostpython&#8221;. We are avid supporters of this beautiful programming language. Our Python plans support multiple versions of not only Python, but of Django and other frameworks as well, making this an ideal [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1058,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[32],"tags":[],"class_list":{"0":"post-1056","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python-and-django"},"_links":{"self":[{"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/posts\/1056","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/comments?post=1056"}],"version-history":[{"count":0,"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/posts\/1056\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/media\/1058"}],"wp:attachment":[{"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/media?parent=1056"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/categories?post=1056"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.webhostpython.com\/wp-json\/wp\/v2\/tags?post=1056"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}