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
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
Go to your Django project home directory and do:
./manage.py --version
go the setting of the Django Project. there find your Django Version.
>>> import django
>>> print(django.get_version())
1.6.1
I am using the IDLE (Python GUI).
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)
After django 1.0 you can just do this
$ django-admin --version
1.11.10