{"id":288,"date":"2022-05-03T12:39:12","date_gmt":"2022-05-03T12:39:12","guid":{"rendered":"https:\/\/ecodebook.wordpress.com\/?p=288"},"modified":"2022-05-03T12:39:12","modified_gmt":"2022-05-03T12:39:12","slug":"setup-django-on-namecheap","status":"publish","type":"post","link":"https:\/\/blog.mycarts.shop\/?p=288","title":{"rendered":"Setup Django on Namecheap with subdomain."},"content":{"rendered":"\n<p class=\"has-vivid-purple-color has-text-color has-medium-font-size\"><strong>Step 1<\/strong><\/p>\n\n\n\n<p><strong>Create the python environment:<\/strong><br> Go to setup Python App and click on the CREATE APPLICATION button.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/image.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/image.png?w=308\" alt=\"\" class=\"wp-image-293\" width=\"178\" height=\"46\" srcset=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/image.png 308w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/image-300x77.png 300w\" sizes=\"auto, (max-width: 178px) 100vw, 178px\" \/><\/a><\/figure>\n\n\n\n<p>Enter the necessary information and click the create button to create the application .<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><strong>Python version:<\/strong> 3.8.12<br><strong>Application URL:<\/strong> mydomain.com<br><strong>Application startup file:<\/strong> passenger_wsgi.py<br><strong>Application Entry point:<\/strong> application<br>    <\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/s2.jpg\"><img loading=\"lazy\" decoding=\"async\" width=\"1395\" height=\"493\" data-id=\"297\" src=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/s2.jpg\" alt=\"\" class=\"wp-image-297\" srcset=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/s2.jpg 1395w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/s2-300x106.jpg 300w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/s2-1024x362.jpg 1024w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/s2-768x271.jpg 768w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2022\/05\/s2-809x286.jpg 809w\" sizes=\"auto, (max-width: 1395px) 100vw, 1395px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-vivid-purple-color has-text-color has-medium-font-size\"><strong>Step 2<\/strong><\/p>\n\n\n\n<p>Upload the project folder into app root.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc2.jpg?w=737\" alt=\"\" class=\"wp-image-311\" width=\"357\" height=\"139\" srcset=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc2.jpg 737w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc2-300x117.jpg 300w\" sizes=\"auto, (max-width: 357px) 100vw, 357px\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p class=\"has-vivid-purple-color has-text-color has-medium-font-size\"><strong>Step 3<\/strong><\/p>\n\n\n\n<p>Edit the&nbsp;<strong><em>passenger_wsgi.py<\/em><\/strong>&nbsp;file.<\/p>\n\n\n\n<p>Go to app root folder and edit the <strong><em>passenger_wsgi.py<\/em><\/strong>.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc1.jpg?w=840\" alt=\"\" class=\"wp-image-307\" width=\"365\" height=\"127\" srcset=\"https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc1.jpg 840w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc1-300x104.jpg 300w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc1-768x267.jpg 768w, https:\/\/blog.mycarts.shop\/wp-content\/uploads\/2023\/01\/pysc1-809x281.jpg 809w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/a><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Delete all the content and add below line.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from isai.wsgi import application<\/code><\/pre>\n\n\n\n<p class=\"has-vivid-purple-color has-text-color has-medium-font-size\"><strong>Step 4<\/strong><\/p>\n\n\n\n<p>Edit setting.py in the project folder: \/apps\/isai\/setting.py<\/p>\n\n\n\n<p>Update your domain to allowed url and update database information.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALLOWED_HOSTS = &#091;'mydomain.com']\n\n'default': {\n        'ENGINE': 'django.db.backends.mysql',\n        'NAME': 'dbname',\n        'USER': 'dbusername',\n        'PASSWORD': 'dbpassword',\n        'HOST': 'localhost',\n        'PORT': '3306',\n    }<\/code><\/pre>\n\n\n\n<p class=\"has-vivid-purple-color has-text-color has-medium-font-size\"><strong>Step 5<\/strong><\/p>\n\n\n\n<p><strong>Activate the environment<\/strong> <strong>and install Django and pymysql<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>1. source \/home\/username\/virtualenv\/apps\/3.8\/bin\/activate &amp;&amp; cd \/home\/username\/apps\n\n2. pip install django==4.0.4\n\n3. pip install pymysql<\/code><\/pre>\n\n\n\n<p>Finally, restart the python app.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Step 1 Create the python environment: Go to setup Python App and click on the CREATE APPLICATION button. Enter the necessary information and click the create button to create the application . Python version: 3.8.12Application URL: mydomain.comApplication startup file: passenger_wsgi.pyApplication Entry point: application Step 2 Upload the project folder into app root. Step 3 Edit&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/288","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=288"}],"version-history":[{"count":0,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=\/wp\/v2\/posts\/288\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mycarts.shop\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}