jignesh
answered May 1 '23 00:00
To check the version of Django installed on your system, you can use the following command in your terminal:
python -m django --version
This will print the version number of Django installed on your system.
Alternatively, if you have Django installed in a virtual environment, you can activate the environment and then use the same command:
source path/to/venv/bin/activate
python -m django --version
This will print the version number of Django installed in the virtual environment.
You can also check the version of Django from within a Python script by importing the django module and accessing the __version__ attribute:
import django
print(django.__version__)
This will print the version number of Django installed on your system.
Note that the output of django-admin version command can also be used to check the version of Django . However, it is recommended to use the python -m django --version command instead, as it is more reliable and provides a consistent output across different platforms.