How to deploy DJANGO app on CyberPanel

Django is a very popular free and open-source web application framework that is written in Python Language. A framework is made up of collections of modules that make development smoother and easier. Using Django frameworks it will save a lot of time and reduce the risk of bugs. You don't have to write everything from the beginning, so there's a very low probability of introducing errors or bugs.

These are the following step to install Django on CyberPanel -

1. Upgrade OpenLiteSpeed -

 For CentOS-

yum update
yum upgrade openlitespeed

If you are using Ubuntu then,

apt-get update
apt-get upgrade openlitespeed

2. Install python -

 For CentOS-

yum install python36-devel
yum install python36-pip

If you are using Ubuntu then,

apt install build-essential
apt-get install python3-dev

3. Download the Litespeed web server gateway interface -

Run these command-

curl -O
tar xf wsgi-lsapi-1.7.tgz
cd wsgi-lsapi-1.7
python3 ./
cp lswsgi /usr/local/lsws/fcgi-bin/

4. Install and Start Virtual Environment for Django Application -

virtualenv --system-site-packages /home/
source /home/

5. Install Django -

pip install django


pip3 install django

6. Setup DJANGO Project -

Note- Here we are creating a new Django project from the beginning and our project name is myproject. 

If you have already Django project then don't create a new project just upload your project in the root directory.

you can upload your project through a file manager or FileZilla(By using an FTP account)

cd /home/
django-admin startproject myproject

7. Changes in setting File - 

you can find the setting file at /home/


 For static files please add these code below the file

STATIC_URL = '/static/'

STATIC_ROOT = '/home/'

Note- Don't forget to save file

Run the below command

cd /home/
python collectstatic
python migrate
python createsuperuser

8. Update the vhosts Configuration

Add the bunch of the code in vhost Conf

context / {

  type                    appserver

  location                /home/

  binPath                 /usr/local/lsws/fcgi-bin/lswsgi

  appType                 wsgi

  startupFile             myproject/

  envType                 1

  env                     LS_PYTHONBIN=/home/

  env                     PYTHONHOME=/home/



Replace with your domain name and myproject with your project name

After saving the vhost Conf you should now be able to visit your website and see the affected changes.

Latest Posts

How to deploy DJANGO app on CyberPanel 16 Dec, 2021