How to check Django version: A Comprehensive Guide for Beginners

There are six ways to check Django version:-

  • python -m django –version
  • django-admin –version
  • ./manage.py –version or python manage.py –version
  • pip freeze | grep Django
  • python -c "import django; print(django.get_version())"
  • python manage.py runserver –version

Django is a popular web platform for Python that makes building web apps very easy. Each new Django version adds exciting features, fixes problems, and makes other modifications.

When creating packages, developers must check Django version being used to ensure compatibility. This is necessary to utilize new features and stay up with system updates.

In this article, we are going to show you six easy ways to check Django version, along with cases that are easy to understand.

Django Versions

here is a table of all of the versions of Django:

  • 4.2 LTS – Release Date: December 8, 2022 | End of Mainstream Support: December 2023 | End of Security Support: December 2025
  • 4.1 – Release Date: September 20, 2022 | End of Mainstream Support: April 5, 2023 | End of Security Support: April 7, 2025
  • 3.2 LTS – Release Date: December 7, 2021 | End of Mainstream Support: December 2022 | End of Security Support: December 2024
  • 3.1 – Release Date: September 14, 2021 | End of Mainstream Support: April 5, 2022 | End of Security Support: April 7, 2024
  • 3.0 – Release Date: December 10, 2020 | End of Mainstream Support: December 2021 | End of Security Support: December 2023
  • 2.2 – Release Date: September 12, 2019 | End of Mainstream Support: December 2020 | End of Security Support: December 2022
  • 2.1 – Release Date: March 14, 2018 | End of Mainstream Support: December 2019 | End of Security Support: December 2021
  • 2.0 – Release Date: July 13, 2017 | End of Mainstream Support: December 2018 | End of Security Support: December 2020
  • 1.11 – Release Date: June 29, 2016 | End of Mainstream Support: December 2017 | End of Security Support: December 2019
  • 1.10 – Release Date: January 15, 2015 | End of Mainstream Support: December 2016 | End of Security Support: December 2018
  • 1.9 – Release Date: October 13, 2014 | End of Mainstream Support: December 2015 | End of Security Support: December 2017
  • 1.8 – Release Date: June 1, 2014 | End of Mainstream Support: December 2015 | End of Security Support: December 2017
  • 1.7 – Release Date: March 8, 2013 | End of Mainstream Support: December 2014 | End of Security Support: December 2016
  • 1.6 – Release Date: December 6, 2012 | End of Mainstream Support: December 2013 | End of Security Support: December 2015
  • 1.5 – Release Date: July 10, 2012 | End of Mainstream Support: December 2013 | End of Security Support: December 2015
  • 1.4 – Release Date: March 8, 2012 | End of Mainstream Support: December 2012 | End of Security Support: December 2014
  • 1.3 – Release Date: November 21, 2011 | End of Mainstream Support: December 2012 | End of Security Support: December 2014
  • 1.2 – Release Date: August 10, 2011 | End of Mainstream Support: December 2011 | End of Security Support: December 2013
  • 1.1 – Release Date: April 19, 2011 | End of Mainstream Support: December 2011 | End of Security Support: December 2013
  • 1.0 – Release Date: July 20, 2005 | End of Mainstream Support: December 2005 | End of Security Support: December 2007

As you can see in this table, Django is very actively being developed and regularly releases new versions. The latest version, Django 4.2 LTS, was released on December 8, 2022. This is the most stable & supported version of Django. It is recommended for use in production environments.

How to check Django Version

Method 1: Using the python -m django –version command

The simplest way to check Django version is by typing this command in your terminal or command prompt (cmd).

This command directly runs the Django module and displays the version information.

Example output:

Method 2: Using the django-admin –version command

Another straightforward method to check Django version is by using the django-admin command. Open your terminal or command prompt and enter –

This command is specifically designed to display the Django version.

Example output:

Method 3: Using the ./manage.py –version or python manage.py –version command

When working on a Django project, you can check Django version within the project context. In the console or command window, go to the top path of your project. Then, execute any of the following commands:

or

These commands run the manage.py script, which resides in your project's root directory, and display the Django version specific to your project.

Example output:

Method 4: Using the pip freeze | grep Django command

To view a list of all installed Python modules and filter for the Django module, you can use the pip freeze command combined with the grep command. Simply enter the following command in your terminal or command prompt:-

This command lists all installed Python modules and filters the output for the Django module, displaying the version information.

Example output:

Method 5: Using the python -c "import django; print(django.get_version())" command

You can also check Django version by running a Python command that imports the Django module and retrieves the version number. Open your terminal or command prompt and execute the following command:

This command imports the django module and uses the get_version() method to print the Django version.

Example output:

Method 6: Using the python manage.py runserver –version command

If you prefer to check Django version while starting the development server, you can use the following command:

Running this command starts the Django development server and displays the version number in the terminal output.

Example output:

Conclusion

Check the Django version for the latest features, bug fixes, and adjustments. In this comprehensive guide, we explored six simple methods to check Django version:

  • python -m django –version
  • django-admin –version
  • ./manage.py –version or python manage.py –version
  • pip freeze | grep Django
  • python -c "import django; print(django.get_version())"
  • python manage.py runserver –version

These methods suit various demands and are beginner-friendly. Whether you need a quick check or detailed information about your Django installation, these methods will help you determine the Django version with ease.

Know your Django version to use the newest updates, test it with everything, and confidently develop powerful online applications. Keep studying Django and love website building.