Forums

Can i create schedule task using pythonanywhere API?

Hi there! Can i create schedule task using pythonanywhere API? thanks

hi there, that's not currently possible but it should be soon... how were you thinking of using it, out of interest?

Hi, I though about the same for adding per-minute scheduled tasks. My django-powered site sends emails asynchronously for admin messages and confirming user registration. Hourly is far to sparse, hence I've had to manually add multiple hourly tasks for the same script. A better solution for my particular problem would be to have a more frequent (every minute) scheduled task

understood. we're working on ways of supporting this sort of async task queue. in the meantime, there's a few tips for how to get it working using the current scheduled task features here: https://help.pythonanywhere.com/pages/AsyncInWebApps/

Yea.. As suggested by Harry. The best way is to support your webapp with scheduled tasks. I use that a lot.

I have always this error

b'{"interval":["This field is required."],"command":["This field is required."],"minute":["This field is required."]}'

See https://www.pythonanywhere.com/forums/topic/23566/#id_post_72606

I have code which uses Python APScheduler . Will there be any conflict because of this . I have a task driven by scheduler at a particular time which in turn will dynamically generate files which will be scheduled using APScheduler. Based on the schedule for the day there will be separate tasks created dynamically which need to be scheduled everyday.

How are you running the APScheduler? If it's in a console, remember that console servers sometimes have to be restarted for system maintenance, so you'll have to restart your program when that happens. If you want a program that runs all of the time, and is restarted automatically if it exits for any reason (system maintenance, hardware failure, or even if it just crashes) you'll need a paid account, where you can use an always-on task.

Thanks for the Update. Is there any API to use the PythonAnywhere scheduler which can be used programatically.

Yes, check out the API documentation here.