Constantly monitor bitcoin wallet using Python/Django? I am building a site with python/django, running bitcoind in the background. I need to constantly check all addresses in the wallet to do a sql insert statement to my database whenever an incoming transaction is received, and maybe send some funds out in certain cases.

My site is working ok, and I wrote a python script that runs separate and uses a simple while true loop to achieve this. The problem is, when the script is running, it takes up too much memory and the site times out when I reload it. How to avoid this? I really need a background process running at all times. I am trying to use threading in the script, but it still seems to hog too much memory.

I thought about running bitcoind with the same wallet and the script on a separate computer, but I heard that is a bad idea.

Thanks.
Use wallet notify. You can set it in your bitcoin.conf file and have it call some python or django script.

Or another solution would be to constantly poll for new transactions, though I would not recommend this.