0

I'm trying to run a django custom command using Windows Task Scheduler. If I run the task from Windows Task Scheduler it says it completes without errors, however I can tell it isn't being run.

If I run the command from the django project directory it runs successfully. However, if I run the command outside this directory then this command isn't accessible. I think Task Scheduler runs my command this way, and so although the task completes, the command isn't executed.

How would I add it to the list of global commands? How would I also debug this sort of issue?

I've only got Python 2.7.

EDIT:

I've just realised the Python Path in Django lists a different set of directories to the directories in the sys.path, from "import sys". Further, the project directory format in Django's debug thing is listed as 'C:/Project' not the format 'C:\Python27'

  • Check you have `PYTHONPATH` and `DJANGO_SEETINGS_MODULE` set appropriately when its run from task scheduler. – Rohan Jun 20 '14 at 04:23
  • PYTHONPATH was not a variable I set, I created it so don't think it's related to the python's sys.path. How would I set DJANGO_SETTINGS_MODULE in the context of Task Scheduler? – hbhrugubanda Jun 20 '14 at 04:53

0 Answers0