How to upgrade django?

后端 未结 15 1339
情歌与酒
情歌与酒 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:14

    I use this command for upgrading any package using pip:

    pip install <package-name> --upgrade 
    

    Example: pip install django --upgrade

    you need to use the --upgrade or -U flag for upgrading.

    Alternatively, you can use python -m pip install -U Django.

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

    From the Django Docs: if you are using a Virtual Environment and it is a major upgrade, you might want to set up a new environment with the dependencies first. Or, if you have installed Django using the PIP, then the below is for you: python3.8 -m pip install -U Django .

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

    sudo pip install --upgrade django

    also upgrade the DjangoRestFramework:

    sudo pip install --upgrade djangorestframework

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

    You can use --upgrade with the pip command to upgrade Python packages.

    pip install --upgrade django==3.3.1
    
    0 讨论(0)
  • 2021-01-31 08:24

    You can use pip install -U django. It will update to the current stable version. Read official documentation on Django Docs

    0 讨论(0)
  • 2021-01-31 08:25
    1. Use this command to get all available Django versions: yolk -V django
    2. Type pip install -U Django for latest version, or if you want to specify version then use pip install --upgrade django==1.6.5

    NOTE: Make sure you test locally with the updated version of Django before updating production.

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