Get the version of Django for application

后端 未结 6 1658
感动是毒
感动是毒 2021-02-18 22:33

I am starting a new (actually very old) project which I know is in Django. I am getting lost knowing the exact version of Django it has been build upon. Is there a way I can kno

6条回答
  •  情书的邮戳
    2021-02-18 23:22

    This works in Django 1.7:

    import django
    django.VERSION
    

    ...which yields (on my machine):

    (1, 7, 0, 'rc', 3)
    

    Note: It's important that you need to make sure you are running inside a python virtual environment before running this, as otherwise you'd importing the system wide django, not at the project level.

提交回复
热议问题