Centralized installation of Django with VirtualEnv

I have a server that runs several different Django sites running various versions of Django. Yesterday, Django released security updates for 1.8 and 1.9 . This means that in order for everything to be safe, I have to go to each site and update the version of Django that works.

Since Django does a great job of version control (e.g. interruption of changes occurs between minor versions, such as 1.8-1.9, but not between versions, such as 1.9.2-1.9.4), it seems like I should have a central Django installation for each minor version, 1.7, 1.8, 1.9, etc.

Is there a way to get VirtualEnv to target a specific installation so that I have all the sites running Django 1.8, just one installation, and also for 1.9?

+6
source share
3 answers

One solution is to use add2virtualenv from virtualenvwrapper.

Just create virtual files for generic versions of django (of course, one virtualenv for one major version of django) and each virtualenvs invoke command:

 add2virtualenv /path/to/shared/virtualenv/lib/python3.4/site-packages 

replace the path with shared virtualvv (and, if necessary, the python version) with the one you want to use.

add2virtualenv have a permanent effect, so there is no need to call it again after virtualenvwrapper is activated.

+2
source

One approach you can take is symlink django from the site-packages directory. However, it seems all kinds of fragmentary.

As for me? I just installed SaltStack , since you can manage virtualenvs with it

+1
source

Isn't that just what .txt requirements mean? You can specify the version of Django as "> = 1.8, <1.9", then you know that the update will always install the latest version of patch 1.8, but never will be 1.9.

-2
source

All Articles