Im trying to deploy django application on cpanel
But as I setup python3.7.12 but it detecting python2.6.6
Im tried please help me
Im trying to deploy django application on cpanel
But as I setup python3.7.12 but it detecting python2.6.6
Im tried please help me
3
Answers
We have to edit .htaccess file In this file we can set the python3 virtual enviroment path.
If we have root privilages then we can also edit application.json file and change defualt python path
But we can edit .htaccess file it easy to create
If you have deployed Python 3.7 via the Python Selector inside cPanel, it actually creates a virtual environment with that version.
Python 2.6 is most probably the default global one on your hosted server.
In order to be able to use the 3.7 version, you will need to enter inside the virtual environment.
To do that, go to your cPanel -> Setup Python App, edit your newly deployed app, and at the top of the page, you will have a command that you can copy/paste in SSH to enter into that environment.
You should do these steps:
First in your cpanel main menu find Setup Python app and then click on this link
after that install new python version, python 3.7.2 is recommend version after click install, after all of this I believe cpanel will created a vertualenv folder on your host, open cpanel terminal and past this code to enable your vertual environment:
Note: part 2 after vertualenv -> /3.7.2 maybe have different name, This name is basically the name you choose when create a new environment