How can I run two Django versions in the same server?
2013-07-20 21:16
369 查看
You should definitely go with virtualenv.
This is how you can check if you already have virtualenv installed:
If you don't have virtualenv installed, you can install it like this:
If that gives you an error, you probably don't have pip yet. You can install it using:
Once virtualenv is installed you can create separated virtual Python environments, one per Django installation, like this:
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:
Your prompt should indicate that you are running the environment by looking something like this:
You can leave the virtualenv by typing:
If you have come this far you can start installing environment-specific versions of Python packages like this (in an activated environment):
This will install Django version 1.0 inside the current virtual environment. You can see if it worked by issuing:
This should result in something like:
You can now deactivate this environment, activate the other environment, and install Django 1.4 like this:
Hope this helps!
http://serverfault.com/questions/413879/how-can-i-run-two-django-versions-in-the-same-server
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
相关文章推荐
- It is not possible to run two different versions of ASP.NET in the same IIS process.问题的解决
- It is not possible to run two different versions of ASP.NET in the same IIS process:IIS
- It is not possible to run two different versions of ASP.NET in the same IIS process
- How to Have Two Versions of the Same App on Your Device
- [Yii Framework] How to run cron job (or use command) in the server with yii framework
- PHPFarm - How to run multiple versions of PHP on the same computer
- HOW TO RUN YOUR WEB SERVER AND MQTT WEBSOCKETS BROKER ON THE SAME PORT
- How can a database be in-memory and durable at the same time?
- HOW TO RUN YOUR WEB SERVER AND MQTT WEBSOCKETS BROKER ON THE SAME PORT
- How to make two <div>…</div> in the same row?
- How To Turn Up Logging on the Siebel Web Server Extension in Siebel Versions 7.x and 8.x? [ID 477185
- How can I run Perl system commands in the background
- How can you disable the UDDI and UDDI Explorer functionality in WebLogic Server? (Doc ID 1274906.1)
- How can I force Python's file.write() to use the same newline format in Windows as in Linux (“\r\n”
- [zz]How to disable the password complexity in Windows Server 2008?
- how to change the implicit default settings in django 1.6
- Download and run CSQL on Linux -Only two commands will be used to start the server
- two or more web modules defined in the configuration have the same context root解决方案
- how can i change the back color on mouse out to the color specified in gridview
- How to use Wise SetupCapture in the Wise Packager for Deployment Server to create an MSI