(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 :-(
Works for me. Double check that you are using
workonto activate the virtualenv (notsource bin/activate), and that you are really activating the right virtualenv.If it still does not work, please provide more information about your environment (OS, versions of involved packages, etc.). Did you modify any of the other virtualenv-wrapper hooks?
Update: Maybe you created the hook in the wrong path? If you create the virtualenv with
mkvirtualenv, it should create thepostactivatefile for you in the right place, so you just have to edit it. It should be in this location:To clarify: not in
~/.virtualenvs/tb_test/postactivate