How to setup DJANGO application on CyberPanel/OpenLiteSpeed

How to setup DJANGO application on CyberPanel/OpenLiteSpeed

DJANGO is a web application framework built with Python. DJANGO seen a tremendous growth recently, and a lot of developers are moving towards this framework. DJANGO official slogan says “the web framework for perfectionists with deadlines”. CyberPanel is also built on top of DJANGO framework, apart from that Instagram also uses DJANGO framework.

OpenLiteSpeed recently added support to run DJANGO applications at VHOST level. Now there is no need to reverse proxy your DJANGO application to gunicorn server. This also leads to increased performance.

In this tutorial we will see how we can setup a DJANGO application. (OpenLiteSpeed version 1.4.42+ is required)

Step 1: Install CyberPanel and Create Website

Before moving forward you need to install CyberPanel and Create Website. If CyberPanel is already installed, make sure to upgrade OpenLiteSpeed.

Upgrade OpenLiteSpeed on CentOS

Upgrade OpenLiteSpeed on Ubuntu

Install python 3.6 on CentOS

Install python 3.6 on Ubuntu


Step 2: Install LiteSpeed Implementation of WSGI

Step 3: Setup virtualevn for DJANGO Application

Note: In this tutorials we are going to use as example domain and cyberpanel as project name.

We will setup virtualevn in the document root of the application:

Step 4: Setup or Upload DJANGO Application

If you already have DJANGO application you can upload it to document root, we will create a brand new DJANGO project.

Open your project settings and make sure allowed hosts looks like for this project will be located at /home/

To set path for static files please add following at the end of

And create folder to start to collect your static files using

Create admin super user

Note: Always replace with your domain name.

Since you are modifying/creating files via command line, you can go to File manager and click Fix Permissions so that correct permissions settings are in place.

Step 5: Setup DJANGO Application Context

Go to website launcher at  https://<IP Address>:8090/websites/ so that you can edit vhost Conf  (Replace with your domain).

Scroll down and click vhost Conf and paste following at the end of the box:

env LS_PYTHONBIN=/home/  is the location of python inside your virtualenv. Make sure you replace domain and project name in above settings accordingly.


Once done click Save and you can visit your DJANGO application at, in this case, its It should look like:

You can also check admin panel at

One thought on “How to setup DJANGO application on CyberPanel/OpenLiteSpeed

Leave a Reply

Your email address will not be published. Required fields are marked *

%d bloggers like this: