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
I think after updating your project, you have to restart the server.
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???
How to upgrade Django Version
python -m pip install -U Django
use cammand on CMD
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
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)
You can use this command in vitualenv:
`pip install django==<version>`
this should work.