K. ossama
K. ossama

Reputation: 433

two versions of django installed in ubuntu 16.04

I have two versions installed in my envirment, django 1.8.7 and 1.10 which i have installed with pip! I want to use django 1.10 by default instead of the version 1.8.7. how can I do that ?

thank you

Upvotes: 0

Views: 156

Answers (1)

R891
R891

Reputation: 2719

A good way to run multiple versions of Python programs is to use virtualenv.

Installation depends on your operating system, but there is more info here.

See this tutorial for information on how to use virtualenv with Django.

With virtualenvs, you can run multiple versions of Django that use multiple versions of Python. If you add virtualenvwrapper, you can use a simple command, like workon project1 to work on a Django 1.8 project that uses Python 2.7, or workon project2 to work on a Django 1.10 project that uses Python 3.5.

Edit: in 2020 you can do:

$ python3 -m venv .venv
$ source .venv/bin/activate
$ pip install django

You can install any version of Django there that you want. That version of Django will be different than any version that might be on your system.

Read more about it here: https://docs.python.org/3/library/venv.html

Upvotes: 3

Related Questions