I'm running a Python server with mod_python, and I've run into some issues with configuration variables. This is actually two questions rolled into one, because I think they are highly related:
I need a way to configure variables that will be available in Python while running. I currently just have a module that sets some name-value pairs that I import into other modules, but I was reading up on PythonOption recently and was wondering what advantages would be gained from using that instead.
I need a way to store state on the server. I've got access to an API that's limited to running X number of times a day, and once it hits that limit, I need to revert to my (lesser) code. I'm wondering how I can keep track of how many times I've run the query in a day.
I thought about using a file or the database, but I'm afraid I will slow down requests by having everyone try to access the same file or row at once. Is there a better way to set this up in mod_python?