There are multiple ways to check what Django version you are on. Some are easier than others. I will go over 4 options, if they all don’t work for you, comment below and I will try to help you out.
When you start your server (python manage.py runserver
), you will get some output right away. That will also tell you on what version you are. Look at the sample data below.
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
November 20, 2019 - 14:34:16
Django version 2.2.5, using settings 'back.settings'
Starting ASGI/Channels version 2.3.0 development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.
There it says: Django version 2.2.5, using settings 'back.settings'
, so your Django version is 2.2.5.
Stop the server and then run pip freeze | grep Django
(when you are in the virtual environment). The output should be something like this:
Django==2.2.5
Django is shown there as Django==2.2.5
, which means that Django is currently on version 2.2.5
.
Stop the server (if you haven’t already) and open up shell python manage.py shell and then enter this:
import django
django.get_version()
For me, it prints out 2.2.5
, which then is your Django version.
Stop the server (if you haven’t already) and then run this:
python manage.py version
Which prints 2.2.5
for me.
If you want to upgrade Django, then you can run pip install --upgrade django
. If you would like to downgrade, then you can run pip install django==<versionnumber>
. Replace <versionnumber>
with the actual number, like 2.2.1
.
I hope this helps you out.
Django tips-tricks versionStan is professional web developer working mainly with Django and VueJS. With years of experience under the belt, he is comfortable writing about his past mistakes and ongoing learnings.