How to upgrade django?

后端 未结 15 1338
情歌与酒
情歌与酒 2021-01-31 07:57

My project was running on Django 1.5.4 and I wanted to upgrade it. I did pip install -U -I django and now pip freeze shows Django 1.6.5 (clearly django

相关标签:
15条回答
  • 2021-01-31 08:01

    I think after updating your project, you have to restart the server.

    0 讨论(0)
  • 2021-01-31 08:06

    I'm not an expert on either Python or Django.

    What I am doing is following along this really very good book: Test Driven Web Development With Python (2nd Ed). It uses Django...

    I'm also using a Windoze machine (W10) with Cygwin.

    The reason I mention all this is because I found, having installed Python 3.6 in my Cygwin setup, that I had to use pip3, not pip, to install Django.

    My installed version of Django was 1.11.8. To follow the "official" (?) tutorial here they want you to have Django 2.0 installed. I successfully managed to do this with:

    $ pip3 install -U django
    

    Hope this helps someone. Perhaps someone much more knowledgeable than me can talk about the need or otherwise to use pip3 for all Python 3.x activity???

    0 讨论(0)
  • 2021-01-31 08:07

    How to upgrade Django Version

    python -m pip install -U Django

    use cammand on CMD

    0 讨论(0)
  • 2021-01-31 08:07

    you must do the following:
    1- Update pip
    python -m pip install --upgrade pip
    2- If you already install Django update by using the following command
    pip install --upgrade Django
    or you can uninstall it using the following command
    pip uninstall Django
    3- If you don't install it yet use the following command
    python -m pip install Django
    4- Type your code

    Enjoy

    0 讨论(0)
  • 2021-01-31 08:09

    with python 3.7 try:

    sudo pip3 install --upgrade django==2.2.6
    

    Because using the following:

    pip3 install -U django
    

    or with python 2.7 if you like to keep that old python:

    pip install -U django
    

    Only gives you the older version of django (1.11.xx instead of 2.2.6)

    0 讨论(0)
  • 2021-01-31 08:11

    You can use this command in vitualenv:

     `pip install django==<version>`
    

    this should work.

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