How to check Django version

后端 未结 26 2557
梦如初夏
梦如初夏 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:30

    Django version or any other package version

    Open the terminal or command prompt

    Type

    pip show django
    

    or

    pip3 show django
    

    You can find any package version...

    Example:

    pip show tensorflow
    
    pip show numpy
    

    etc....

    0 讨论(0)
  • 2020-12-04 05:30

    Python version supported by Django version

    Django version        Python versions
    ----------------------------------------
    1.0                   2.3, 2.4, 2.5, 2.6
    1.1                   2.3, 2.4, 2.5, 2.6
    1.2                   2.4, 2.5, 2.6, 2.7
    1.3                   2.4, 2.5, 2.6, 2.7
    1.4                   2.5, 2.6, 2.7
    1.5                   2.6.5, 2.7 and 3.2.3, 3.3 (experimental)
    1.6                   2.6.5, 2.7 and 3.2.3, 3.3
    1.11                  2.7, 3.4, 3.5, 3.6, 3.7 (added in 1.11.17)
    2.0                   3.4, 3.5, 3.6, 3.7
    2.1, 2.2              3.5, 3.6, 3.7
    

    To verify that Django can be seen by Python, type python from your shell. Then at the Python prompt, try to import Django:

    >>> import django
    >>> print(django.get_version())
    2.1
    >>> django.VERSION
    (2, 1, 4, 'final', 0)
    
    0 讨论(0)
  • 2020-12-04 05:31
    django-admin --version
    python manage.py --version
    pip freeze | grep django
    
    0 讨论(0)
  • 2020-12-04 05:31

    Django will use the version of Python specified by the PYTHONPATH environment variable. You can use echo $PYTHONPATH in a shell to determine which version will be used.

    The module versions used by Django will be the module versions installed under the version of Python specified by PYTHONPATH.

    0 讨论(0)
  • 2020-12-04 05:32

    Django 1.5 supports Python 2.6.5 and later.

    If you're under Linux and want to check the Python version you're using, run python -V from the command line.

    If you want to check the Django version, open a Python console and type

    >>> import django
    >>> django.VERSION
    (2, 0, 0, 'final', 0)
    
    0 讨论(0)
  • 2020-12-04 05:34

    Run pip list in a Linux terminal and find Django and its version in the list:

    Run pip freeze on cmd on Windows.

    0 讨论(0)
提交回复
热议问题