Virtualenv allows you to have multiple Django environments on one PC, each with it's own Django and Python settings and packages.
First install virtualenv:
- pip install virtualenv
Create a virtual environment from the folder where you want the virtual env files:
- virtualenv name
You run "scripts\activate.bat" script to activate the virtual environment:
- cd name
- scripts\activate.bat
Add the following to the scripts\activate.bat file to set the location of your apps settings.py file:
- set DJANGO_SETTINGS_MODULE=<app>.settings
where <app> is the name of your django app.
Install the tools you need:
- pip install django
If using Pydev from Eclipse, set up the path to the virtual env's python.exe in the project preferences.
Be sure to select the virtual env python from the Interpreter drop down list in the PyDev - Interpreter/Grammer window:
No comments:
Post a Comment