cloudpanel-io / cloudpanel-ce

1.28k stars 106 forks source link

Selected Python version in GUI not used for Python uwsgi application site; undocumented mechanism behind it #426

Closed xuiqzy closed 6 months ago

xuiqzy commented 9 months ago

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.ini config for uwsgi according to docs. (Might need to set pythonpath for 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 .ini uwsgi config, if needed additionally, in the docs for adding a new python version.

Additional Context

Even setting the py-program-name to the python3.12 executable inside the my_site.ini config 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).