I am trying to write a bash script which runs a couple of python management commands overnight.
I read from other posts that you need to
source the virtualenv to be able to import the environment variables, however even after having added the command it still does not work:
#!/bin/bash source /home/DDiran/.virtualenvs/envname/bin/activate && cd /home/DDiran/projectdir/ && python manage.py randomize_product_order && python manage.py update_product_prices
The var in question is
$PRODUCTION_ENV and it results empty (raising a python
What am I doing wrong, and why?
As requested by @Romeo Ninov, contents of
The environment variables are set in
bin/postactivate which is set to run immediately after
bin/activate I think? That's how it usually works when activating the virtualenv.