user83039
user83039

Reputation: 3167

How to check which version of Python a Django site is using?

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?

Upvotes: 3

Views: 1062

Answers (1)

bakkal
bakkal

Reputation: 55448

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)

Upvotes: 2

Related Questions