1. Log in to the cPanel control panel
2. In the Software section, select “Setup Python App
3. Select Create Application
to create a Python application
4. Select the desired Python version from the drop-down list. We have 2.7, 3.3, 3.4, 3.5, 3.6 Python versions
5. Select the Application root, Application URL, Passenger log file.
6. Click the “CREATE” button, wait until the installation is complete.
7. After installation, confirm whether the Python application is installed successfully by accessing the URL.
8. Copy the command and run it in a terminal to enter a virtual environment.
9. Now install Django using the command
pip install django
10. Start the project
django-admin startproject project .
11. Open File Manager and edit passenger_wsgi.py from your newweb folder/project installation folder
12. Remove all the content from passenger_wsgi.py file and update following and save the file
from project.wsgi import application
13. From project folder edit settings.py
14. Find and update the allowed host values in file with your domain name or application URL.
ALLOWED_HOSTS = ['mydomain.in','www.mydomain.in']
15. Add the following code at bottom of settings.py file for media and application path. Remove cpuser in the below path and enter your cPanel username.
16. Create assets
folder in application root (For e.g. newweb)
17. Create a media
folder under public_html
18. execute the following command from a terminal
python manage.py collectstatic
19. Restart the Python application from setup python app in cPanel.
The Django application is successfully installed.