Hi, beginner programmer here:
I am using django to build a web app called watergunwars. In my watergunwars directory, I have my models.py module, as well as a file called eliminate.py that I would like to run once per day.
# from eliminate.py:
from watergunwars.models import UserProfile
for agent in UserProfile.agents:
agent.kill_count += 1
agent.save()
In scheduler, I set the path to /home/kaliqwang/CentennialWGW/watergunwars/eliminate.py, but the log returns the following error:
Traceback (most recent call last):
File "/home/kaliqwang/CentennialWGW/watergunwars/eliminate.py", line 1, in <module>
from watergunwars.models import UserProfile
ImportError: No module named watergunwars.models
2016-04-09 00:09:07 -- Completed task, took 0.00 seconds, return code was 1.
Can someone help me figure out what I'm doing wrong?