Hirusha Fernando
Hirusha Fernando

Reputation: 1305

How To Find Django Version Of A Project?

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.

Upvotes: 4

Views: 3831

Answers (4)

Hirusha Fernando
Hirusha Fernando

Reputation: 1305

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

Upvotes: 2

Vivek Kumar
Vivek Kumar

Reputation: 31

import django

print(django.get_version())

3.0.7

Upvotes: 0

Suhas_Pote
Suhas_Pote

Reputation: 4600

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)

Upvotes: 1

Vivek Kumar
Vivek Kumar

Reputation: 31

Django version or any other package version

Open the terminal or command prompt

Type

pip show django

Upvotes: 0

Related Questions