How to check Django version

后端 未结 26 2571
梦如初夏
梦如初夏 2020-12-04 04:36

I have to use Python and Django for our application. So I have two versions of Python, 2.6 and 2.7. Now I have installed Django. I could run the sample application for testi

26条回答
  •  一整个雨季
    2020-12-04 05:20

    For checking using a Python shell, do the following.

    >>>from django import get_version
    >>> get_version()
    

    If you wish to do it in Unix/Linux shell with a single line, then do

    python -c 'import django; print(django.get_version())'
    

    Once you have developed an application, then you can check version directly using the following.

    python manage.py runserver --version
    

提交回复
热议问题