Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

triggering different app environments with pyenv-virtualenv

with virtualenvwrapper, I could setup separate virtualenvs and calling workon venv have them link to specific settings files (ex. test_settings.py or dev_settings.py) I preset using hooks in the virtualenv's bin - preactivate, postactivate, predeactivate and postdeactivate.

Is there something equivalent for pyenv? pyenv-virtualenv automatically switches virtualenvs based on .python-version set in the current directory, so there's no need to activate and the .pyenv/versions/venv/bin/ dir doesn't have the compliment of hooks that virtualwrapper has anyway.

I can easily create different virtualenvs for my various app environments but how can I link them to different environment-specific app settings?

like image 538
TST Avatar asked May 27 '15 08:05

TST


1 Answers

I ended up adding environment variable export something='something-else' commands to the activate file ~/.pyenv/versions/my_venv/bin/activate in the spirit of autoenv after reading this forum reply elsewhere.

like image 117
TST Avatar answered Oct 20 '22 16:10

TST