1👍
Runing a script from the javascript is not a clean way to do it, because the user can close the browser, disable js … etc. instead you can use django-celery, it let you run backgroud scripts and you can check to status of the script dynamically from a middleware. Good luck
0👍
You could add a client-side timeout to AJAX back to the server 10-15 sec later. Point it to a different view and execute your script within that view. For example:
function runServerScript() {
$.get("/yourviewurlhere", function(data) {
// Do something with the return data
});
}
setTimeout("runServerScript()", 10000);
If you want status to be displayed, the client would have to make multiple requests back to the server.
- [Answer]-Can you set a breakpoint and drop into interactive mode from command line in pycharm 3?
- [Answer]-Read/Write permission for a program run with subprocess?
- [Answer]-Loading new page after button is clicked (not duplicate)
- [Answer]-Python Django Progress Bar django-progressbarupload
- [Answer]-Ajax to notify about variable change on server
0👍
Celery might come in handy for such use cases. You can start a task (or script as you call them) from a view (even with a delay, as you want). Sending status reports back to the browser will be harder unless you opt for something like WebSockets but that’s highly experimental right now.
- [Answer]-Why am I getting an apache server error page on a django vhost using underscore in my subdomain?
- [Answer]-Integration jquery upload file plugins with Django form