Re: Form processing using bash script
Brilliant! Just what I needed to hear. :-) Thanks, Kevin. -Carlos. On Tue, Oct 6, 2009 at 3:56 PM, Kevin Teaguewrote: > > > > On Oct 6, 12:02 pm, Carlos Gustavo wrote: > > Thanks Kevin, > > > > I would give it a shot. Doesn't sound as easy as I had hoped. :-) > > > > To make things even harder, keep in mind that any data gotten from the > HTTP request which is passed on to a shell call as an argument must > first be checked and/or cleaned, otherwise a malicious request could > execute arbitrary shell commands on the server. > > > > --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Form processing using bash script
On Oct 6, 12:02 pm, Carlos Gustavowrote: > Thanks Kevin, > > I would give it a shot. Doesn't sound as easy as I had hoped. :-) > To make things even harder, keep in mind that any data gotten from the HTTP request which is passed on to a shell call as an argument must first be checked and/or cleaned, otherwise a malicious request could execute arbitrary shell commands on the server. --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Form processing using bash script
Thanks Kevin, I would give it a shot. Doesn't sound as easy as I had hoped. :-) -Carlos. On Tue, Oct 6, 2009 at 2:55 PM, Kevin Teaguewrote: > > Use the os.subprocess module in the python standard library to invoke > the bash script from your django view code: > > http://docs.python.org/library/subprocess.html > > Although in my experience, when there is a bash script wrapping a > number of calls to other programs, I tend to find it easier to work > with to first port the bash into Python (although I'm biased in favor > of Python ;P). If you need to communicate with the subprocesses that > the bash script is invoking, it's going to be more difficult to do > going through python, then bash, then a C binary than it would be to > go directly from Python to the C binary. > > > > > > --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Form processing using bash script
Use the os.subprocess module in the python standard library to invoke the bash script from your django view code: http://docs.python.org/library/subprocess.html Although in my experience, when there is a bash script wrapping a number of calls to other programs, I tend to find it easier to work with to first port the bash into Python (although I'm biased in favor of Python ;P). If you need to communicate with the subprocesses that the bash script is invoking, it's going to be more difficult to do going through python, then bash, then a C binary than it would be to go directly from Python to the C binary. --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Form processing using bash script
Hi Daniel, Thanks for the response to my mail. These input values are used by a bash script containing various C programs and the processing results in graph that needs to be displayed as an image plot on the response form. Thanks again. -Carlos On Tue, Oct 6, 2009 at 2:01 PM, Daniel Rosemanwrote: > > On Oct 6, 6:01 pm, Carlos Gustavo wrote: > > Hi Everyone, > > > > I am Django newbie and the experience has been exciting. > > > > I want some help with the ff. challenge I am now facing: > > > > How can I get a Django form to process a bash script executing a bunch of > C > > programs running on linux. > > > > Any pointers or suggestions would be deeply appreciated. > > > > Thanks in advance. > > > > Best regards, > > > > -Carlos. > > It's not clear what you want to achieve. A Django form is a way of > entering and validating data via the website. What does the bash > script have to do with this? > -- > DR. > > > --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---
Re: Form processing using bash script
On Oct 6, 6:01 pm, Carlos Gustavowrote: > Hi Everyone, > > I am Django newbie and the experience has been exciting. > > I want some help with the ff. challenge I am now facing: > > How can I get a Django form to process a bash script executing a bunch of C > programs running on linux. > > Any pointers or suggestions would be deeply appreciated. > > Thanks in advance. > > Best regards, > > -Carlos. It's not clear what you want to achieve. A Django form is a way of entering and validating data via the website. What does the bash script have to do with this? -- DR. --~--~-~--~~~---~--~~ 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 django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~--~~~~--~~--~--~---