How can I run two Django versions in the same server?

You should definitely go with virtualenv.

This is how you can check if you already have virtualenv installed:

$ virtualenv --version

If you don't have virtualenv installed, you can install it like this:

$ pip install virtualenv

If that gives you an error, you probably don't have pip yet. You can install it using:

$ easy_install pip

Once virtualenv is installed you can create separated virtual Python environments, one per Django installation, like this:

$ virtualenv env

I recommend running this command in the project folder of each app. If you do so, you get a folder called 'env' which will contain the virtual Python environment. Every time you want to start working with the virtual environment you can issue this command:

$ source env/bin/activate

Your prompt should indicate that you are running the environment by looking something like this:

(env)$

You can leave the virtualenv by typing:

(env)$ deactivate

If you have come this far you can start installing environment-specific versions of Python packages like this (in an activated environment):

(env)$ pip install Django==1.0

This will install Django version 1.0 inside the current virtual environment. You can see if it worked by issuing:

(env)$ pip freeze

This should result in something like:

Django==1.0-final
wsgiref==0.1.2

You can now deactivate this environment, activate the other environment, and install Django 1.4 like this:

(env)$ pip install Django==1.4

Hope this helps!


http://serverfault.com/questions/413879/how-can-i-run-two-django-versions-in-the-same-server

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值