Using only virtualenv (without virtualenvwrapper), setting environment variables is easy through the activate
script youyou're sourcing in order to activate the virtualenv.
RunOn unix, run:
nano YOUR_ENV/bin/activate
Addor if you're on windows:
nano YOUR_ENV/Scripts/activate.bat
Then, add the environment variables to the end of the file like this. If you're on unix:
export KEY=VALUE
or if you're on windows:
set KEY=VALUE
You can also set a similar hook to unset the environment variable as suggested by Danilo Bargen in his greatexcellent answer above if you need.