14👍
✅
You were on the right track, but you want to use the postactivate
hook instead of postmkvirtualenv
.
It won’t restore automatically on deactivate. Thankfully there is postdeactivate
hook that you can use to manually restore any environmental variables that you changed on activate.
22👍
One way I’ve done that before is by appending an export statement to the end of ./bin/activate
export DJANGO_SETTINGS_MODULE="myproject.settings"
- Django: admin interface: how to change user password
- How can i bulk create in django rest serializer
- Django Views: When is request.data a dict vs a QueryDict?
- Django – Supervisor : exited too quickly
Source:stackexchange.com