mardi 2 janvier 2018

Remotely run a script from a site

I'm creating a python program that is gathering data from various sources using their APIs and store them in a database. I was planning on this being a cron job that would run nightly on a server. Unfortunately, one of the APIs cost money to use and by my estimate of the amount of requests that my program makes, it will cost around $1.75 every time I want to update my database. It would be much better if I could update it at will instead.

The part that I'm getting stuck at is how to allow a number of people access to update the database. It would be ideal if I could create a website where someone with access could press a button and then it would start running the script in the background. The script takes a couple minutes though and the request would time out. I'm rather novice at web development so I don't know of a solution around this.

How can I have a python script that can take a while run from the press of a button on a website?




Aucun commentaire:

Enregistrer un commentaire