mirror of
https://github.com/cloudpanel-io/cloudpanel-ce.git
synced 2026-04-05 20:31:58 +02:00
Selected Python version in GUI not used for Python uwsgi application site; undocumented mechanism behind it #269
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @xuiqzy on 2/8/2024
CloudPanel version(s) affected
2.4.1-1+clp-jammy (cloudpanel UI doesn't show it's version)
Description
Installing and selecting another python version doesn't actually use the other python version for the uwsgi app.
How is it supposed to be used? Just as a env var that is available like the app_port variable?
How to actually use another python version with a uwsgi python app?
How to reproduce
Install python3.12 from deadsnakes PPA on ubuntu. (Or other way to make it available on the system)
Select python3.12 for a python project in the dropdown.
Deploy a simple flask app in a virtual environment and configure the
my_site.iniconfig for uwsgi according to docs. (Might need to setpythonpathfor it to recognize the installed dependencies correctly with the virtual environment)When printing the python version in the flask app it is still 3.10.
Possible Solution
Explain in documentation how python version that is selected in GUI is actually used to help people to understand when they can rely on this functionality and when they need to do something themselves. It would also be helpful to debug these issues if the general functioning of this python version feature would be explained. For what executables is it used? For the uwsgi executable? Is the building and installation of a different python uwsgi plugin needed like https://stackoverflow.com/questions/23872801/running-multiple-uwsgi-python-versions suggests?
Explain how to correctly edit the
.iniuwsgi config, if needed additionally, in the docs for adding a new python version.Additional Context
Even setting the
py-program-nameto the python3.12 executable inside themy_site.iniconfig for uwsgi doesn't change which python version is used (but would also negate the use of the dropdown in cloudpanel and should be explained why both needed).