I'm trying to set up cron jobs in my django application on a ec2 instance(linux). Everything is working fine, I tried
python3 manage.py cron add
python3 manage.py cron show
python3 manage.py cron remove
everything works just fine
But when I start the apache server, and load the page, I'm getting 500. From the error logs I found that django_crontab
module was not found. But it's still there and I've installed it in the virtual environment too (I've double checked with pip3 freeze). I also tried sudo service cron start
which didn't show me anything and didn't make any difference. What could be the possible issue here?
Atleast I found the answer myslef. Freezing the pip3
modules and installing it in the server environment solved my issue. MODULE_IMPORT ERROR
can be rectified by this method even if your module is not visible when installed manualy using pip3 install module-name
. I hope this works for others!