How to run the web2py scheduler on PythonAnywhere

The web2py scheduler is a way to process asynchronous jobs from web2py. You can run it in a paid account without problems on PythonAnywhere; it's a bit less useful in a free account.

In a paid account

The way to get it running on PythonAnywhere in a paid account is to use an Always-on task.

Just create one on the "Tasks" page, with the following command:

cd ~; python web2py/ -K my_web2py_app_name

You should replace my_web2py_app_name with the actual app name, and if you've installed Web2py in a directory different to web2py in your home directory, you'll need to change that too.

In a free account

Unfortunately there's no good way to make it work in a free account, because you don't have access to always-on tasks. However, if the things you are trying to schedule happen at roughly the same time each day, you can create a scheduled task that will run just before that time, and use the same command as in the example above.