In this article, you will learn how to Install python Django using cPanel. First of all, Django is a Python framework that encourages rapid development, clean, and practical design. Designed by experienced developers, this takes care of a lot of web development hassles, so you can focus on writing your app without having to reinvent the wheel. It is free and open-source.
Create a Python Application.
Our first to learn how to Install python Django using cPanel is by setting up the app.
- Go to Setup Python App and then click on Create Application and set the following:
- Python Version: 3.7.3 “Recommended”.
- Application Root: The folder path where you will start your Django app.
- Application URL: The domain where you want your Django application to be live.
- Application startup file: Enter “passenger_wsgi.py”.
- Application entry point: Enter “application”.
- Click on Create.
- After your python app is set up, you will see the note above your new application on the same page. The note contains a command line to be run, copy it.
- From cPanel, open Terminal. Paste the command line there and hit enter.
- Install version 2.1 of Django by running the following command:
pip install django==2.1
Start a Django project
- In the Terminal, enter the following command:
django-admin startproject app ~/appsite
- Open the File Manager and go to your Django app folder. Under this folder, you will be editing the file “passenger_wsgi.py” and “settings.py” under the application subfolder in the next steps.
- Open the file “passenger_wsgi.py”, delete everything and enter the following line: From app.wsgi import application Note: replace “app” with your application name.
- Now, open your application subfolder and edit the file “settings.py”.
- Find the line starts with “ALLOWED_HOSTS” and enter your application domain between ‘’. Example:
ALLOWED_HOSTS = [‘example.ly’]
- Now go back to Set up Python app in your and Restart your application.