I can't believe this hasn't been asking on here before. Besides using a syntax error to make the debug screen appear in the browser, is there another way to check which version of Python a Django site is running?
1 Answer
Not that different from checking Python version from any Python program, https://docs.python.org/2/library/platform.html#platform.python_version
>>> from platform import python_version
>>> python_version() # Read this value from e.g. a Django command, or a page
'2.7.6'
# Or
>>> import sys
>>> sys.version_info
sys.version_info(major=2, minor=7, micro=6, releaselevel='final', serial=0)
1 Comment
user83039
So you're suggesting to put it into my code temporarily?
import sys; print(sys.version)will work for just about any version, including the two you mentioned.