i have script in django project needs run every 5 mins.
i using this cron module run script named 'cron.py' present in myproject/myapp/cron.py
but when running sever, script not running @ (no output) job showing when doing "python manage.py crontab show" mentioned in link above.
also, when run script explicitly going , running issuing 'python cron.py', showing (notifier name of myapp)
traceback (most recent call last):
file "cron.py", line 2, in
from notifier.models import *
importerror: no module named notifier.models
everything working when i'm copy-pasting same code in cron.py on python command line , running.
can please me out in right direction? i've looked everywhere on internet.
using python 2.7.10 , django 1.8 postgresql db.
check in correct directory, , possibly in correct virtual environment.
at top of cron script may want to:
import os os.chdir(os.path.dirname(__file__)) or change root directory of app.
Comments
Post a Comment