{"id":1263,"date":"2026-09-04T17:00:00","date_gmt":"2026-09-04T17:00:00","guid":{"rendered":"https:\/\/www.kailashcloud.com\/blog\/?p=1263"},"modified":"2026-09-04T08:52:30","modified_gmt":"2026-09-04T08:52:30","slug":"host-a-django-website-on-cpanel","status":"publish","type":"post","link":"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/","title":{"rendered":"How to Host a Django Website on cPanel: 7 Simple Steps to Get Your Website Live"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Django<\/strong> works well on a local computer, but moving a project to cPanel requires a few settings that do not exist in a normal local development setup. The most important pieces are the Python application environment, WSGI entry point, project settings, static files, database, and domain configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The good news is that you do not need to manage Apache configuration manually on a typical cPanel Python hosting account. cPanel can run Python applications through Phusion Passenger, while CloudLinux servers may expose the same workflow through <strong>Setup Python App<\/strong>. The exact interface depends on how your hosting provider has configured the server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This guide shows <strong>how to host a Django website on cPanel<\/strong> from an existing Django project, including the files to upload, the WSGI configuration, dependencies, migrations, static files, environment variables, and the common errors that appear after deployment.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_87_1 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Quick_Answer\" >Quick Answer<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#What_You_Need_Before_You_Start\" >What You Need Before You Start<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Step_1_Prepare_Your_Django_Project_Locally\" >Step 1: Prepare Your Django Project Locally<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Create_requirementstxt\" >Create requirements.txt<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Prepare_Django_for_production\" >Prepare Django for production<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Step_2_Create_the_Python_Application_in_cPanel\" >Step 2: Create the Python Application in cPanel<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Option_A_Setup_Python_App_on_CloudLinux\" >Option A: Setup Python App on CloudLinux<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Option_B_Application_Manager\" >Option B: Application Manager<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Step_3_Upload_Your_Django_Project\" >Step 3: Upload Your Django Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Step_4_Configure_passenger_wsgipy\" >Step 4: Configure passenger_wsgi.py<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Step_5_Install_Dependencies_and_Run_Django_Commands\" >Step 5: Install Dependencies and Run Django Commands<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Run_database_migrations\" >Run database migrations<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Create_a_superuser_if_needed\" >Create a superuser if needed<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Step_6_Configure_Static_Files\" >Step 6: Configure Static Files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Step_7_Connect_the_Domain_and_Test_the_Website\" >Step 7: Connect the Domain and Test the Website<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Common_Django_cPanel_Problems_and_How_to_Fix_Them\" >Common Django cPanel Problems and How to Fix Them<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#1_503_Service_Unavailable\" >1. 503 Service Unavailable<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#2_ModuleNotFoundError\" >2. ModuleNotFoundError<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#3_DisallowedHost_error\" >3. DisallowedHost error<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#4_CSS_and_JavaScript_are_missing\" >4. CSS and JavaScript are missing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#5_Database_connection_errors\" >5. Database connection errors<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#6_Changes_are_not_appearing\" >6. Changes are not appearing<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#7_The_application_works_locally_but_not_on_cPanel\" >7. The application works locally but not on cPanel<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Where_cPanel_Fits_for_Django_Hosting\" >Where cPanel Fits for Django Hosting<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Django_cPanel_Deployment_Checklist\" >Django cPanel Deployment Checklist<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Frequently_Asked_Questions\" >Frequently Asked Questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Can_I_host_Django_on_cPanel_shared_hosting\" >Can I host Django on cPanel shared hosting?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Do_I_need_SSH_access_to_host_Django_on_cPanel\" >Do I need SSH access to host Django on cPanel?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Can_I_use_Django_with_MySQL_on_cPanel\" >Can I use Django with MySQL on cPanel?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Can_I_use_PostgreSQL_with_cPanel\" >Can I use PostgreSQL with cPanel?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Why_does_my_Django_site_show_a_503_error\" >Why does my Django site show a 503 error?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Do_I_need_Gunicorn_to_run_Django_on_cPanel\" >Do I need Gunicorn to run Django on cPanel?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-34\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Should_I_upload_my_virtual_environment\" >Should I upload my virtual environment?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-35\" href=\"https:\/\/www.kailashcloud.com\/blog\/host-a-django-website-on-cpanel\/#Can_I_host_a_Django_API_on_cPanel\" >Can I host a Django API on cPanel?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Quick_Answer\"><\/span>Quick Answer<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To host a Django website on cPanel:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Confirm that your cPanel hosting supports Python applications and Passenger.<\/li>\n\n\n\n<li>Prepare your Django project with a <code>requirements.txt<\/code> file and production settings.<\/li>\n\n\n\n<li>Create a Python application in cPanel using <strong>Setup Python App<\/strong> or <strong>Application Manager<\/strong>.<\/li>\n\n\n\n<li>Upload your Django project into the application root.<\/li>\n\n\n\n<li>Create and configure the <code>passenger_wsgi.py<\/code> WSGI entry point.<\/li>\n\n\n\n<li>Install dependencies, run migrations, and collect static files.<\/li>\n\n\n\n<li>Configure the domain, test the website, and check logs if it does not load.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">The exact menu names and available Python versions depend on your hosting environment. cPanel documents Python applications through its Application Manager and WSGI deployment workflow, while CloudLinux provides Python Selector for supported cPanel servers.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"What_You_Need_Before_You_Start\"><\/span>What You Need Before You Start<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before uploading anything, make sure you have:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A cPanel hosting account with Python application support enabled.<\/li>\n\n\n\n<li>A working Django project that runs correctly on your local computer.<\/li>\n\n\n\n<li>Access to cPanel File Manager.<\/li>\n\n\n\n<li>cPanel Terminal or SSH access if your hosting plan provides it.<\/li>\n\n\n\n<li>A domain or subdomain connected to the hosting account.<\/li>\n\n\n\n<li>A <code>requirements.txt<\/code> file containing your Python dependencies.<\/li>\n\n\n\n<li>Production database credentials if your project uses MySQL, PostgreSQL, or another external database.<\/li>\n\n\n\n<li>Your Django project&#8217;s settings module and WSGI module name.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If your cPanel account does not contain <strong>Setup Python App<\/strong>, <strong>Application Manager<\/strong>, or another Python application feature, ask your hosting provider whether Python and Passenger are enabled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using <strong>Kailash Cloud<\/strong>, its <a href=\"https:\/\/www.kailashcloud.com\/python-hosting-in-nepal\">Python hosting plans<\/a> are specifically presented for Django, Flask, and FastAPI applications and include cPanel and terminal access.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1477\" height=\"557\" src=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image.png\" alt=\"cPanel Software section with Setup Python App and Application Manager\" class=\"wp-image-1265\" srcset=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image.png 1477w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-300x113.png 300w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-766x289.png 766w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1024x386.png 1024w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-528x199.png 528w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1055x398.png 1055w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-819x309.png 819w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1238x467.png 1238w\" sizes=\"auto, (max-width: 1477px) 100vw, 1477px\" \/><figcaption class=\"wp-element-caption\">cPanel Software section with Setup Python App and Application Manager<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_1_Prepare_Your_Django_Project_Locally\"><\/span>Step 1: Prepare Your Django Project Locally<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Do the first part of the deployment on your own computer. The goal is to make the project portable so the server only has to recreate the Python environment and connect the production settings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A typical Django project might look like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>myproject\/\n\u251c\u2500\u2500 manage.py\n\u251c\u2500\u2500 requirements.txt\n\u251c\u2500\u2500 passenger_wsgi.py\n\u251c\u2500\u2500 myproject\/\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u251c\u2500\u2500 settings.py\n\u2502   \u251c\u2500\u2500 urls.py\n\u2502   \u251c\u2500\u2500 wsgi.py\n\u2502   \u2514\u2500\u2500 asgi.py\n\u251c\u2500\u2500 app1\/\n\u2502   \u251c\u2500\u2500 migrations\/\n\u2502   \u251c\u2500\u2500 admin.py\n\u2502   \u251c\u2500\u2500 models.py\n\u2502   \u251c\u2500\u2500 views.py\n\u2502   \u2514\u2500\u2500 urls.py\n\u251c\u2500\u2500 templates\/\n\u2514\u2500\u2500 static\/\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Your structure may be different. The important part is knowing the name of the Django package that contains <code>settings.py<\/code> and <code>wsgi.py<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_requirementstxt\"><\/span>Create <code>requirements.txt<\/code><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your local virtual environment contains all the packages required by the project, you can generate the dependency list with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip freeze &gt; requirements.txt\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Review the file before uploading it. It should contain the packages your production application actually needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not upload your local <code>venv<\/code> or <code>.venv<\/code> directory. cPanel or CloudLinux creates a server-side Python environment for the application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Prepare_Django_for_production\"><\/span>Prepare Django for production<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Do not leave the development configuration enabled on a public website. Django recommends reviewing settings such as <code>DEBUG<\/code>, <code>ALLOWED_HOSTS<\/code>, HTTPS, static files, and environment-specific configuration before going live.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DEBUG = False\n\nALLOWED_HOSTS = &#91;\n    \"yourdomain.com\",\n    \"www.yourdomain.com\",\n]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace the values with the domains that actually serve your application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Keep your <code>SECRET_KEY<\/code>, database password, API keys, and other secrets outside the source code where possible.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_2_Create_the_Python_Application_in_cPanel\"><\/span>Step 2: Create the Python Application in cPanel<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">There are two common cPanel configurations. Your hosting provider may expose one or both.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before creating the Python application, first add the <strong>domain or subdomain<\/strong> that you want to use for the application in cPanel. You will then use this domain or subdomain as the <strong>Application URL<\/strong> when configuring the Python app.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you need help adding a domain or subdomain in cPanel, see our guide:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.kailashcloud.com\/blog\/subdomain-and-addon-domain-in-cpanel\/\">How to Add a Subdomain and Addon Domain in cPanel<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the domain or subdomain is created and pointing to your hosting account, continue with one of the Python application setup methods below.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Option_A_Setup_Python_App_on_CloudLinux\"><\/span>Option A: Setup Python App on CloudLinux<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On CloudLinux servers, look under the <strong>Software<\/strong> section for <strong>Setup Python App<\/strong>. This is provided by CloudLinux&#8217;s Python Selector and uses Passenger to host Python applications.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click <strong>Create Application<\/strong> and choose the Python version that is compatible with your project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Typical fields include:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Field<\/th><th>What to enter<\/th><\/tr><\/thead><tbody><tr><td>Python version<\/td><td>A version supported by your project and offered by the server<\/td><\/tr><tr><td>Application root<\/td><td>Your project directory relative to the cPanel home directory<\/td><\/tr><tr><td>Application URL<\/td><td>The domain or subdomain that should serve the application<\/td><\/tr><tr><td>Application startup file<\/td><td><code>passenger_wsgi.py<\/code><\/td><\/tr><tr><td>Application Entry point<\/td><td><code>application<\/code><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Keep the application code outside <code>public_html<\/code> when your hosting interface allows it.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1588\" height=\"791\" src=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329.png\" alt=\"cPanel Setup Python App form\" class=\"wp-image-1268\" srcset=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329.png 1588w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329-300x149.png 300w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329-1024x510.png 1024w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329-768x383.png 768w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329-1536x765.png 1536w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329-528x263.png 528w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329-1056x526.png 1056w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329-820x408.png 820w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/Screenshot-2026-09-04-111329-1240x618.png 1240w\" sizes=\"auto, (max-width: 1588px) 100vw, 1588px\" \/><figcaption class=\"wp-element-caption\">cPanel Setup Python App form<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Option_B_Application_Manager\"><\/span>Option B: Application Manager<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Some cPanel servers use <strong>Application Manager<\/strong> instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">cPanel&#8217;s Application Manager supports Python applications and uses the server&#8217;s configured Passenger Python runtime. The exact fields available depend on the server configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your host gives you Application Manager instead of Setup Python App, follow the fields and environment created by that interface.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"660\" src=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1-1024x660.png\" alt=\"cPanel Application Manager register application form\" class=\"wp-image-1269\" srcset=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1-1024x660.png 1024w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1-300x193.png 300w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1-767x494.png 767w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1-528x340.png 528w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1-1055x680.png 1055w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1-819x528.png 819w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-1.png 1237w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">cPanel Application Manager register application form<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If neither interface is available, this is usually a server-side limitation rather than a Django problem. Contact your hosting provider before trying to build a custom Apache configuration on shared hosting.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_3_Upload_Your_Django_Project\"><\/span>Step 3: Upload Your Django Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Once the Python application exists, upload the Django project into the application root you selected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The simplest method for a small project is cPanel File Manager:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Compress your Django project into a ZIP file on your computer.<\/li>\n\n\n\n<li>Leave out <code>.venv<\/code>, <code>venv<\/code>, <code>__pycache__<\/code>, and other local development files.<\/li>\n\n\n\n<li>Open <strong>File Manager<\/strong> in cPanel.<\/li>\n\n\n\n<li>Open the application root directory.<\/li>\n\n\n\n<li>Upload the ZIP file.<\/li>\n\n\n\n<li>Extract it in the application root.<\/li>\n\n\n\n<li>Confirm that <code>manage.py<\/code>, <code>requirements.txt<\/code>, and your Django project package are in the expected locations.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Be careful about an extra directory level.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A clean structure might look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/home\/yourusername\/djangoapp\/\n\u251c\u2500\u2500 manage.py\n\u251c\u2500\u2500 requirements.txt\n\u251c\u2500\u2500 passenger_wsgi.py\n\u2514\u2500\u2500 myproject\/\n    \u251c\u2500\u2500 settings.py\n    \u251c\u2500\u2500 urls.py\n    \u2514\u2500\u2500 wsgi.py\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_4_Configure_passenger_wsgipy\"><\/span>Step 4: Configure <code>passenger_wsgi.py<\/code><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Passenger needs a WSGI application object that it can load. Django already provides a WSGI application through the project&#8217;s <code>wsgi.py<\/code>, so the cPanel entry point can import it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Create <code>passenger_wsgi.py<\/code> in the application root:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import os\nimport sys\n\nsys.path.insert(0, \"\/home\/yourusername\/djangoapp\")\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"myproject.settings\")\n\nfrom django.core.wsgi import get_wsgi_application\n\napplication = get_wsgi_application()\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Replace:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>\/home\/yourusername\/djangoapp<\/code> with the actual absolute path to your application root.<\/li>\n\n\n\n<li><code>myproject.settings<\/code> with the Python path to your Django settings module.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For a standard project, <code>myproject.settings<\/code> refers to <code>myproject\/settings.py<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The key detail is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>application = get_wsgi_application()\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That <code>application<\/code> object is what Passenger loads.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your project has a non-standard layout, do not copy the example blindly. The Python path must match the location of <code>manage.py<\/code> and the package containing <code>settings.py<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_5_Install_Dependencies_and_Run_Django_Commands\"><\/span>Step 5: Install Dependencies and Run Django Commands<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Open the Terminal in cPanel or connect through SSH if your hosting account provides it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you are using CloudLinux&#8217;s <strong>Setup Python App<\/strong>, the application page normally provides the command needed to enter the application&#8217;s virtual environment. Copy the command shown by your cPanel interface rather than guessing the virtual environment path.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"955\" height=\"751\" src=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/virtual-environment-path.png\" alt=\"Path to Enter the Virtual Environment\" class=\"wp-image-1271\" srcset=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/virtual-environment-path.png 955w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/virtual-environment-path-300x236.png 300w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/virtual-environment-path-767x603.png 767w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/virtual-environment-path-528x415.png 528w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/virtual-environment-path-819x644.png 819w\" sizes=\"auto, (max-width: 955px) 100vw, 955px\" \/><figcaption class=\"wp-element-caption\">Path to Enter the Virtual Environment<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once the environment is active, move to your application directory:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/home\/yourusername\/djangoapp\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then install the packages:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -r requirements.txt\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can confirm that Django is available with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python -m django --version\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Run_database_migrations\"><\/span>Run database migrations<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If your application uses Django&#8217;s database models, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python manage.py migrate\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Before running migrations, make sure your production database, database user, and permissions are configured correctly. If you haven&#8217;t created them yet, follow cPanel&#8217;s official guide for <a href=\"https:\/\/docs.cpanel.net\/cpanel\/databases\/database-wizard\/\" target=\"_blank\" rel=\"noopener\">creating a database, database user, and assigning user privileges<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you use MySQL or MariaDB, cPanel&#8217;s <strong>Database Wizard<\/strong> walks you through the complete setup.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Do not assume that <code>localhost<\/code> is always the correct database host. Use the value supplied by your hosting environment or database provider.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_a_superuser_if_needed\"><\/span>Create a superuser if needed<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the project uses Django Admin and you need an administrator account, run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python manage.py createsuperuser\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Follow the prompts to create the account. Once the application is running, you can sign in to Django Admin at <code>\/admin\/<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_6_Configure_Static_Files\"><\/span>Step 6: Configure Static Files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A Django development server can serve static files during development, but production deployment needs a defined static-file strategy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A common production setting is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>STATIC_URL = \"\/static\/\"\nSTATIC_ROOT = BASE_DIR \/ \"staticfiles\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python manage.py collectstatic\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Django collects the static assets into <code>STATIC_ROOT<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Your production setup must then make that directory available at the <code>\/static\/<\/code> URL. How you serve it depends on the cPanel server configuration and the way your application is deployed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For uploaded media, configure <code>MEDIA_ROOT<\/code> and <code>MEDIA_URL<\/code> separately. User-uploaded files should be stored separately from your application code and should not be treated as executable code.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Step_7_Connect_the_Domain_and_Test_the_Website\"><\/span>Step 7: Connect the Domain and Test the Website<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you selected the correct domain or subdomain when creating the Python application, cPanel and Passenger should route requests to your Django application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Open the application URL and test more than the homepage.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The homepage loads.<\/li>\n\n\n\n<li>A real application route works.<\/li>\n\n\n\n<li>Django Admin opens if your project uses it.<\/li>\n\n\n\n<li>CSS and JavaScript load correctly.<\/li>\n\n\n\n<li>Images and uploaded media work as expected.<\/li>\n\n\n\n<li>Database-backed pages can read and write data.<\/li>\n\n\n\n<li>Forms and authentication work.<\/li>\n\n\n\n<li>HTTPS works correctly.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Django recommends HTTPS for sites that handle logins, sessions, password resets, or other sensitive information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run Django&#8217;s deployment checks:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python manage.py check --deploy\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Review every warning it reports. A successful page load does not necessarily mean the application is ready for production.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"842\" height=\"425\" src=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-2.png\" alt=\"Host a Django Website on cPanel\" class=\"wp-image-1272\" srcset=\"https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-2.png 842w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-2-300x151.png 300w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-2-767x387.png 767w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-2-527x266.png 527w, https:\/\/www.kailashcloud.com\/blog\/wp-content\/uploads\/2026\/09\/image-2-818x413.png 818w\" sizes=\"auto, (max-width: 842px) 100vw, 842px\" \/><figcaption class=\"wp-element-caption\">Django website running Correctly<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Common_Django_cPanel_Problems_and_How_to_Fix_Them\"><\/span>Common Django cPanel Problems and How to Fix Them<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"1_503_Service_Unavailable\"><\/span>1. 503 Service Unavailable<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A 503 response usually means Passenger could not start or serve the application correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check these first:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The Python version selected in cPanel matches your application&#8217;s requirements.<\/li>\n\n\n\n<li>Django and all dependencies are installed in the application&#8217;s virtual environment.<\/li>\n\n\n\n<li><code>passenger_wsgi.py<\/code> exists in the expected application root.<\/li>\n\n\n\n<li><code>DJANGO_SETTINGS_MODULE<\/code> points to the correct settings module.<\/li>\n\n\n\n<li>The Python path in <code>sys.path.insert()<\/code> points to the directory containing <code>manage.py<\/code>.<\/li>\n\n\n\n<li>The application has been restarted after configuration changes.<\/li>\n\n\n\n<li>The application logs do not show a Python import error or missing dependency.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"2_ModuleNotFoundError\"><\/span>2. <code>ModuleNotFoundError<\/code><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the log contains something such as:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ModuleNotFoundError: No module named 'django'\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">the package is probably missing from the application&#8217;s Python environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Activate the environment created for that application and run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install -r requirements.txt\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Do not install Django into a different global Python environment and assume Passenger will use it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"3_DisallowedHost_error\"><\/span>3. <code>DisallowedHost<\/code> error<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If Django reports an invalid HTTP host, check <code>ALLOWED_HOSTS<\/code> in your production settings.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALLOWED_HOSTS = &#91;\n    \"yourdomain.com\",\n    \"www.yourdomain.com\",\n]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use the actual hostnames visitors use.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"4_CSS_and_JavaScript_are_missing\"><\/span>4. CSS and JavaScript are missing<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If the page loads but looks unstyled, static files are usually the first thing to inspect.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Run:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python manage.py collectstatic\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then confirm that <code>STATIC_ROOT<\/code> is configured and that your cPanel deployment actually serves <code>\/static\/<\/code> from the collected directory.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Also check the browser&#8217;s developer tools for 404 responses on CSS and JavaScript files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"5_Database_connection_errors\"><\/span>5. Database connection errors<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A database error after deployment usually means the production settings do not match the database created on the server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Database name<\/li>\n\n\n\n<li>Database username<\/li>\n\n\n\n<li>Database password<\/li>\n\n\n\n<li>Database host<\/li>\n\n\n\n<li>Database port<\/li>\n\n\n\n<li>Database driver installed in <code>requirements.txt<\/code><\/li>\n\n\n\n<li>Database user privileges<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"6_Changes_are_not_appearing\"><\/span>6. Changes are not appearing<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Passenger applications may continue running an existing application process after you edit files. Restart the application through the cPanel interface after deployment changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"7_The_application_works_locally_but_not_on_cPanel\"><\/span>7. The application works locally but not on cPanel<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">This is usually an environment difference rather than a Django problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Compare:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python version<\/li>\n\n\n\n<li>Django version<\/li>\n\n\n\n<li>Installed dependencies<\/li>\n\n\n\n<li>Environment variables<\/li>\n\n\n\n<li>Database configuration<\/li>\n\n\n\n<li>File paths<\/li>\n\n\n\n<li><code>ALLOWED_HOSTS<\/code><\/li>\n\n\n\n<li>Static and media configuration<\/li>\n\n\n\n<li>Operating-system packages required by third-party libraries<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">If a package requires native system libraries that are unavailable on shared hosting, the application may need a different dependency or a VPS where you control the server environment.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Where_cPanel_Fits_for_Django_Hosting\"><\/span>Where cPanel Fits for Django Hosting<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">cPanel can be a convenient deployment environment for Django when your hosting provider has configured Python support, Passenger, and the required application-management tools.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is particularly useful when you want a control panel for domains, databases, SSL, email, files, and Python applications instead of managing every server component yourself.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are limits, however. Shared hosting normally restricts CPU, memory, background processes, system packages, and server-level configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A larger Django application may eventually need a <a href=\"https:\/\/cloud.google.com\/learn\/what-is-a-virtual-private-server\" target=\"_blank\" rel=\"noopener\">VPS<\/a> when it requires custom services, more predictable resources, WebSockets, scheduled background jobs, or deeper server configuration.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Django_cPanel_Deployment_Checklist\"><\/span>Django cPanel Deployment Checklist<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before you call the deployment complete, check each item:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Python application support is enabled.<\/li>\n\n\n\n<li>The selected Python version is compatible with the project.<\/li>\n\n\n\n<li>Project files are in the correct application root.<\/li>\n\n\n\n<li><code>requirements.txt<\/code> is present.<\/li>\n\n\n\n<li>Dependencies are installed inside the application&#8217;s environment.<\/li>\n\n\n\n<li><code>passenger_wsgi.py<\/code> imports the correct Django application.<\/li>\n\n\n\n<li><code>DJANGO_SETTINGS_MODULE<\/code> points to the correct settings module.<\/li>\n\n\n\n<li><code>DEBUG = False<\/code> in production.<\/li>\n\n\n\n<li><code>ALLOWED_HOSTS<\/code> contains the real domain names.<\/li>\n\n\n\n<li>Production secrets are not hard-coded into the repository.<\/li>\n\n\n\n<li>Database credentials are correct.<\/li>\n\n\n\n<li><code>python manage.py migrate<\/code> completes successfully.<\/li>\n\n\n\n<li><code>python manage.py collectstatic<\/code> completes successfully.<\/li>\n\n\n\n<li>Static files are actually being served.<\/li>\n\n\n\n<li><code>python manage.py check --deploy<\/code> has been reviewed.<\/li>\n\n\n\n<li>HTTPS works.<\/li>\n\n\n\n<li>The homepage and important application routes work.<\/li>\n\n\n\n<li>Application logs are clean after testing.<\/li>\n\n\n\n<li>A backup exists before major future changes.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To host a Django website on cPanel, you need to connect five key pieces correctly: the Python environment, your Django project, the Passenger WSGI entry point, the production database, and static files.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start by confirming that your hosting account supports Python applications. Then create the application, upload the project, install the dependencies, configure <code>passenger_wsgi.py<\/code>, run migrations and <code>collectstatic<\/code>, and test the live domain.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When something fails, do not start changing random settings. Check the application logs first, then verify the Python environment, WSGI import path, dependencies, Django settings, database, and static-file configuration.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If your Django application needs more control or better performance than shared cPanel hosting provides, a VPS is the natural next step. With a <strong>VPS<\/strong>, you have greater control over the server environment and can choose the web server, Python environment, process manager, database setup, background workers, and other server components. You also get dedicated server resources, which can provide a significant performance boost and more consistent performance as your application grows.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re considering a <a href=\"https:\/\/www.kailashcloud.com\/nepal-based-vps-hosting\"><strong>Nepal-based VPS hosting<\/strong><\/a> environment, consider factors such as server location, available resources, latency, root access, and the level of server management you need.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span>Frequently Asked Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Can_I_host_Django_on_cPanel_shared_hosting\"><\/span>Can I host Django on cPanel shared hosting?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, if the hosting provider has enabled Python application support and the server includes a supported way to run Python through Passenger. CloudLinux servers commonly expose this through Setup Python App, while other cPanel configurations may use Application Manager.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Do_I_need_SSH_access_to_host_Django_on_cPanel\"><\/span>Do I need SSH access to host Django on cPanel?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, SSH access is strongly recommended. Although some cPanel setups allow application management through the control panel, SSH makes it easier to install dependencies, run Django commands such as <code>migrate<\/code> and <code>collectstatic<\/code>, manage the virtual environment, and troubleshoot deployment issues.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Can_I_use_Django_with_MySQL_on_cPanel\"><\/span>Can I use Django with MySQL on cPanel?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, when the hosting environment provides MySQL and the required Python database driver. Create the database and user through the hosting control panel, configure the production Django database settings, install the appropriate driver, and run migrations.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Can_I_use_PostgreSQL_with_cPanel\"><\/span>Can I use PostgreSQL with cPanel?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">That depends on the hosting provider and server configuration. Do not assume PostgreSQL is available on every cPanel shared hosting plan.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Why_does_my_Django_site_show_a_503_error\"><\/span>Why does my Django site show a 503 error?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A 503 usually means the application did not start correctly or Passenger could not serve it. Check the application logs, Python version, installed dependencies, WSGI file, settings module, application path, and recent configuration changes.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Do_I_need_Gunicorn_to_run_Django_on_cPanel\"><\/span>Do I need Gunicorn to run Django on cPanel?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Not necessarily. A cPanel environment that uses Passenger can serve a Django WSGI application without requiring you to run a separate Gunicorn process. The correct deployment method depends on how the hosting provider has configured Python application support.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Should_I_upload_my_virtual_environment\"><\/span>Should I upload my virtual environment?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. Do not upload your local <code>venv<\/code> or <code>.venv<\/code> directory. Recreate the environment on the server and install the packages from <code>requirements.txt<\/code>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Can_I_host_a_Django_API_on_cPanel\"><\/span>Can I host a Django API on cPanel?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes, a Django project that exposes API endpoints can be deployed in the same way as another Django WSGI application. The practical limits depend on your hosting resources and the API&#8217;s workload.<\/p>\n","protected":false},"excerpt":{"rendered":"Django works well on a local computer, but moving a project to cPanel requires a few settings that&hellip;","protected":false},"author":4,"featured_media":1274,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"csco_display_header_overlay":false,"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","csco_post_video_location":[],"csco_post_video_location_hash":"","csco_post_video_url":"","csco_post_video_bg_start_time":0,"csco_post_video_bg_end_time":0,"csco_post_video_bg_volume":false,"footnotes":""},"categories":[13],"tags":[77,78,76],"class_list":["post-1263","post","type-post","status-publish","format-standard","has-post-thumbnail","category-web-hosting","tag-host-a-django-website-on-cpanel","tag-host-django-website","tag-python-hosting","cs-entry","cs-video-wrap"],"_links":{"self":[{"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/posts\/1263","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/comments?post=1263"}],"version-history":[{"count":3,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/posts\/1263\/revisions"}],"predecessor-version":[{"id":1275,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/posts\/1263\/revisions\/1275"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/media\/1274"}],"wp:attachment":[{"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/media?parent=1263"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/categories?post=1263"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kailashcloud.com\/blog\/wp-json\/wp\/v2\/tags?post=1263"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}