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

20👍

Depending on what you need:

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

Or:

$ pip freeze
...
djangorestframework==3.1.3
...
👤César

12👍

if you have installed PIP, use below command

pip show djangorestframework
👤niran

2👍

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

1👍

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
👤jozo

Leave a comment