(Following Marina Mele's taskbuster Django tutorial)
The virtualenv is called tb_test. In $VIRTUAL_ENV/bin/ (~/.virtualenvs/tb_test) I pasted the postactivate file from the general hooks folder in $WORKON_HOME and added 2 lines so now it looks like this:
$VIRTUAL_ENV/bin/postactivate #!/bin/zsh # This hook is sourced after every virtualenv is activated.
echo "hELo"
export DJANGO_SETTINGS_MODULE="taskbuster.settings.testing"
However, upon running workon tb_test
the virtualenv gets activated and everything but the postactivate hook is not being loaded. No "heLo" echo :-(
I know it's been a while since this question was posted but now with Mac OS Catalina in more devices, ZSH comes as the default shell.
Well, I was having the same issue, couldn't activate environment variables.
What did the work was following the tips here: VirtualEnvWrapper Tips
In there, one of the tips suggest to add a
rehash
command after doingecho $variables
. and did the trick.Here are my
postactivate
orpreactivate
files in case:Same for the
postdeactivate
and orpredeactivate
It took me a while to find this tip, so hopefully this helps another helpless developer.