How To Find Django Version Of A Project?

Viewed 2032

I have a Django project forked from GitHub. But I don't know which version of Django is used in that project. How can I find the Django version of the project ? I haven't installed Django in my PC.

4 Answers

You can check Django(installed) version with

pip show django

or

pip3 show django

In your case, it is difficult to find Django version since it is not mentioned in any file/s such as requirements.txt

You can assume the Django version used for existing GitHub project by Latest commit on [Date] by looking at that date you can assume figure out which version was used.

Note: You can check the logfile (if it is available)

I found a solution on my own. In the top of the settings.py file, you can see an auto generated multiline comment like this

"""
Django settings for remedy_server project.

Generated by 'django-admin startproject' using Django 3.2.

For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""

In that comment, the Django version of your project has been mentioned

Django version or any other package version

Open the terminal or command prompt

Type

pip show django

import django

print(django.get_version())

3.0.7

Related