Hi,

You can't do it that way. If you want to run a python file on the server,
you can do it in several ways:

1. Create a view that runs all the code inside the refresh.py file. This
could take an amount of time, so I wouldn't do it that way.
2. Create a view that calls a celery task to run the refresh.py file in the
background. That way you won't lock the browser while the commands are
running.

The way you are trying, you are trying to run the refresh file locally on
the client. That will never work (even if you can get it to work in
development :-))

Regards,

Andréas

2015-10-19 16:06 GMT+02:00 CooliusCaesar <braunm...@googlemail.com>:

> Hello,
>
> I need to launch a python file (refresh.py)  from my template.
> I have created a .bat wich starts refresh.py, but I can't get it to work:
> <button onclick="runbat()"> Launch refresh </button>
>
> <script language="JavaScript" type="text/javascript">
>
>     MyObject = new ActiveXObject("WScript.Shell");
>     function Runbat()
>     {
>        MyObject.Run("\"C:\\..path...\\refresh.bat\"");
>     }
> </script>
>
> Could somebody show me how to "properly" start my refresh.py?
> Refresh.py reads log files and checks the status of a few servers. It the
> deletes the Objects in my SQLite DB and rewrites them.
> I would also appreciate if somebody would give me a hint, wich points me
> in the right direction of how to "properly" solve problems like this in
> Django.
>
> If you want me to I could upload refresh.py
>
> Thank you in advance!
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/c43736d0-d1e7-410b-a486-bb9f222bf181%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/c43736d0-d1e7-410b-a486-bb9f222bf181%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CALXYUbnpt0va%2BhEpm5UnuqQL4UiOMZnHh-_fAJzKrC55XAffJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to