Hi all, I have implemented a captcha solution for django (because the already available approaches did not fit my needs), and came to this problem:
An image is created for every captcha-enabled form that is being displayed. Wen the user submits the form, the image is being deleted automatically. BUT: If the user does not send the form back, there is no obvious way for me to delete the picture. I had the following ideas: A) run a cronjob in the background that deletes all images older than 30 minutes. Disadvantage: needs an external cronscript, which I do not really want. It also has to run once a minute, which is ugly in my opinion. B) use django signals somehow... unfortunately there are no signals for forms - just for models, and I'm also not sure how to do that with signals, so this idea was quite worthless. C) start a new thread immediately after image creation which sleeps for about 30 minutes and after that deletes the image, in case it is still sitting on the server. Disadvantage: I'm not sure... Is it safe to have a separate thread (created with python's threading module) that idles around for such a long time? FastCGI issues? mod_python issues? development-server issues? Hopefully you can answer my question - or even come up with a better idea? Of course I will make the finished code available to everyone - maybe on djangosnippets.org, or (which I'd LOVE to do) in django.contrib.captcha. Martin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---