Hi guys,
I've setup my project with virtualenvs. I have django 1.6. I need to run some periodical task that will check my models and does some actions for me so I've decided to write a django custom admin command. When I run the command itself from the console it works like a charm
./manage.py updateposts
Task started ... Task finished
To run this command as a scheduled task, I've added a bash script that runs this command for a specific environment
!/bin/bash
$HOME/.virtualenvs/noname/bin/python $HOME/noname/manage.py updateposts
Running this bash script from a console works as well.
The problem appears when I add a schedule task to run this bash script. It fails with the following error
django.db.utils.OperationalError: (2003, "Can't connect to MySQL server on 'mysql.server' (111)")
Any ideas? Am I missing something?
Thanks!