#

Django Project Deploy in cpenal

Oct. 20, 2022
Author: Asif Shahzad | Full Stack Web Developer


Today we will be deploying a Django Web App using Cpanel (Shared Hosting). I believe this should work on most hosting service providers that support CPanel, In my case I am using NameCheap Hosting.Here are the steps:

  1. Collect all static files in one place and replace static folder

python manage.py findstatic admin/js/core.js

In settings.py

STATIC_ROOT = "/static/"

python manage.py collectstatic

Copy static folder and replace.

  1.  

Main

Mysite

Static

Templates

Must be on root

  1. Setup python app (Software section of namecheap)

 

  1. Give project name as url

  1. Copy the link and open terminal then paste
  2. Pip install Django
  3. Pip install --upgrade pip
  4. pip install pillow==8.0.0
  5. pip install django-ckeditor
  6. pip install django-widget-tweaks
  7. Pip list
  8. In root edit passenger_wsgi.py and type (from  mysite.wsgi import application)

from mysite.wsgi import application

  1. Run project it show url allowed host error
  2. In setting.py update

DEBUG = False

ALLOWED_HOSTS = ['python.kodewhiz.com', 'www.python.kodewhiz.com']

 

  1. The app will run smooth. If not restart app from here:
  2. Sometimes Error in admin after login then clear history of browser, it works

Please share this page to friends.

Asif Shahzad | Full Stack Web Developer

We have expertise in website designing & development, software solutions, mobile app development, e-commerce solutions and graphic designing. We transform your visions into reality by providing 24/7 services.

Popular Posts

Call To Action

Do you Need a website?

Order Now