tags:

views:

34

answers:

1

Application running in django, apache, python and mysql:

I want to create global variable which I should be able to update from external python script may be using a cron job.

The the solution I think of... is having a webpage which updates that variable and then call this through a python script.

Any cleaner solutions?

+2  A: 

You can use a huge variety of inter-process communication ("IPC") mechanisms, but I don't believe any of them will be easier, safer or "cleaner" than going through HTTP (which is basically what "a webpage which updates that variable" amounts to!-) -- all of your settings are already prepared to handle HTTP ("web";-) interactions, after all! Alternatives such as having the cron job update MySQL directly are less "clean" and more complicated to integrate with the rest of your application (your app would have to be "polling" the DB regularly about that one variable -- eek!-).

Alex Martelli