深度阅读

Django: How to check the Django version you're using right now

作者
作者
2023年08月22日
更新时间
12.27 分钟
阅读时间
0
阅读量

You might be wondering () what is the version of Django you are using right now.

Method 1

python -m django --version

Method 2

django-admin --version

Method 3

The third method is known to almost all of us, but we might not have paid much attention () to it.

python manage.py runserver
Watching for file changes with StatReloader
Performing system checks...
System check identified no issues (0 silenced).
February 22, 2022 - 20:32:37
Django version 4.0.2, using settings 'myproject.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
E:\codespeedy\codespeedy_final\myproject\myapiapp\views.py changed, reloading.
Watching for file changes with StatReloader
Performing system checks...

Method 3

You can also check the pip version using pip.

pip freeze

The output somewhat () looks .

Django==3.2.9
djangorestframework==3.13.1

Method 4

django.get_version()

Method 5

The slight change in syntax is that after importingdjango , we need to writedjango.VERSION , but the output varies .

django.VERSION
(3, 2, 9, 'final', 0)

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。