python - Django : how to delete file record after user close his page? -
i'm making simple file resizer django, there 3 fields, email
, size
, image
.
after user arrives last view can download resized, i'd django erase image
of imagefield
save space on django project whenever user close window final view page.
i want keep email
, size
is, these things shouldn't deleted.
i have no idea search, looked stackoverflows posts , in django google groups articles not find me, suggestion on how can done ?
https://developer.mozilla.org/en-us/docs/web/api/windoweventhandlers/onunload - can try using method handle browser close tab js , send request django.
but in place prefer timeout after images resized time ago removed (it can done simple cron script, possibly management command).
Comments
Post a Comment