I have a Django application running in AWS Elastic beanstalk.I need to run a cron job which runs a Django management command every 10 minutes (python manage.py test). For that I created a .ebextensions/cron.config file.
.ebextensions/cron.config
container_commands:
01_some_cron_job:
command: "cat .ebextensions/cron_test.txt > /etc/cron.d/cron_test && chmod 644 /etc/cron.d/some_cron_job"
.ebextensions/cron_test.txt
*/10 * * * * /opt/python/run/venv/bin/python34 /opt/python/current/app/manage.py test
Is this the right way to run a Django management command as cron job in AWS elastic beanstalk? Do we need to activate the virtual environment before running the command?