How to check Django version

后端 未结 26 2655
梦如初夏
梦如初夏 2020-12-04 04:36

I have to use Python and Django for our application. So I have two versions of Python, 2.6 and 2.7. Now I have installed Django. I could run the sample application for testi

26条回答
  •  孤城傲影
    2020-12-04 05:29

    There is an undocumented utils versions module in Django:

    https://github.com/django/django/blob/master/django/utils/version.py

    With that, you can get the normal version as a string or a detailed version tuple:

    >>> from django.utils import version
    >>> version.get_version()
    ... 1.9
    >>> version.get_complete_version()
    ... (1, 9, 0, 'final', 0)
    

提交回复
热议问题