I currently have multiple Django sites running from one Apache server through WSGI and each site has their own virtualenv with possibly slight Python and Django version difference. For each site, I want to display the Python and Django version it is using as well as from which path it’s pulling the Python binaries from.
For each Django site, I can do:
import sys
sys.version
but I’m not sure if it’s showing the Python that the site is using or the system’s Python. Any help on that?
To find out which Python is being used, log the value of
sys.executable. It should contain the path to the interpreter being used.