Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How (if it is possible) can I get the version of Django REST framework?

How (if it is possible) can I get the version of Django REST framework?

import ?
print(?)
like image 262
gornvix Avatar asked Oct 26 '15 23:10

gornvix


4 Answers

if you have installed PIP, use below command

pip show djangorestframework
like image 66
niran Avatar answered Oct 18 '22 21:10

niran


Depending on what you need:

>>> import rest_framework
>>> print rest_framework.VERSION
'3.1.3'

Or:

$ pip freeze
...
djangorestframework==3.1.3
...
like image 30
César Avatar answered Oct 18 '22 22:10

César


In Python you can use variable __version__ or VERSION (check source):

>>> import rest_framework
>>> 
>>> rest_framework.__version__
'3.9.2'
>>> rest_framework.VERSION
'3.9.2'

In your shell you can use combination of pip and grep:

$ pip freeze | grep djangorestframework==
djangorestframework==3.9.2
like image 30
jozo Avatar answered Oct 18 '22 21:10

jozo


if you have to install pip in the project then run this command and check the version

pip show djangorestframework

enter link description here

you can see in the picture

like image 22
muhammad daniyal Avatar answered Oct 18 '22 22:10

muhammad daniyal