How to check Django version

后端 未结 26 2643
梦如初夏
梦如初夏 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:24

    If you want to make Django version comparison, you could use django-nine (pip install django-nine). For example, if Django version installed in your environment is 1.7.4, then the following would be true.

    from nine import versions
    
    versions.DJANGO_1_7 # True
    versions.DJANGO_LTE_1_7 # True
    versions.DJANGO_GTE_1_7 # True
    versions.DJANGO_GTE_1_8 # False
    versions.DJANGO_GTE_1_4 # True
    versions.DJANGO_LTE_1_6 # False
    

提交回复
热议问题