Re: subprocess.Popen in django production - are file descriptors closed?

2009-08-31 Thread aaron smith

it ended up being an incorrect working directory. I had to give the
runfcgi parameter the "workdir" parameter so that it would run from
the right place. arg!. By default if you don't specify workdir it puts
the working dir as "/"

On Mon, Aug 31, 2009 at 7:16 AM, Bill Freeman wrote:
> Are you saying that it works in the development server environment?  If so,
> it could be permission
> issues.  Have the ruby script append a time stamp to a world writable log
> file to confirm that it gets
> run.
>
> Bill
>
> On Fri, Aug 28, 2009 at 9:07 PM, aaron smith
>  wrote:
>>
>> Hey All, quick question.
>>
>> I have a small snippet of code that runs a ruby script, which I read
>> the stdout when it's done. But, I'm not getting the stdout when it's
>> in django production.
>>
>> Here's my python snippet:
>>
>> def generate_license(paymentForm,dsaPrivFile):
>>        name = paymentForm.cleaned_data['firstname'] + " " +
>> paymentForm.cleaned_data['lastname']
>>        product = paymentForm.cleaned_data['product_code']
>>        command = "/usr/bin/ruby licensing/genlicense.rb " + "'" +
>> dsaPrivFile + "'" + " " + product + " '"+name+"'"
>>        process =
>> subprocess.Popen(command,stdout=subprocess.PIPE,shell=True)
>>        stdout_value = process.communicate()[0]
>>        print process.stdout.read()
>>        print stdout_value
>>        return stdout_value
>>
>> I have a couple prints in there just for testing in debug. My question
>> is how to get this to behave normally in django production
>> environment. I've tried a couple different things with opening tmp
>> files and using that for stdout for subprocess. But no luck. Any help
>> is much appreciated.
>>
>> Thanks
>>
>>
>
>
> >
>

--~--~-~--~~~---~--~~
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: subprocess.Popen in django production - are file descriptors closed?

2009-08-31 Thread Bill Freeman
Are you saying that it works in the development server environment?  If so,
it could be permission
issues.  Have the ruby script append a time stamp to a world writable log
file to confirm that it gets
run.

Bill

On Fri, Aug 28, 2009 at 9:07 PM, aaron smith <
beingthexemplaryli...@gmail.com> wrote:

>
> Hey All, quick question.
>
> I have a small snippet of code that runs a ruby script, which I read
> the stdout when it's done. But, I'm not getting the stdout when it's
> in django production.
>
> Here's my python snippet:
>
> def generate_license(paymentForm,dsaPrivFile):
>name = paymentForm.cleaned_data['firstname'] + " " +
> paymentForm.cleaned_data['lastname']
>product = paymentForm.cleaned_data['product_code']
>command = "/usr/bin/ruby licensing/genlicense.rb " + "'" +
> dsaPrivFile + "'" + " " + product + " '"+name+"'"
>process =
> subprocess.Popen(command,stdout=subprocess.PIPE,shell=True)
>stdout_value = process.communicate()[0]
>print process.stdout.read()
>print stdout_value
>return stdout_value
>
> I have a couple prints in there just for testing in debug. My question
> is how to get this to behave normally in django production
> environment. I've tried a couple different things with opening tmp
> files and using that for stdout for subprocess. But no luck. Any help
> is much appreciated.
>
> Thanks
>
> >
>

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



subprocess.Popen in django production - are file descriptors closed?

2009-08-28 Thread aaron smith

Hey All, quick question.

I have a small snippet of code that runs a ruby script, which I read
the stdout when it's done. But, I'm not getting the stdout when it's
in django production.

Here's my python snippet:

def generate_license(paymentForm,dsaPrivFile):
name = paymentForm.cleaned_data['firstname'] + " " +
paymentForm.cleaned_data['lastname']
product = paymentForm.cleaned_data['product_code']
command = "/usr/bin/ruby licensing/genlicense.rb " + "'" +
dsaPrivFile + "'" + " " + product + " '"+name+"'"
process = subprocess.Popen(command,stdout=subprocess.PIPE,shell=True)
stdout_value = process.communicate()[0]
print process.stdout.read()
print stdout_value
return stdout_value

I have a couple prints in there just for testing in debug. My question
is how to get this to behave normally in django production
environment. I've tried a couple different things with opening tmp
files and using that for stdout for subprocess. But no luck. Any help
is much appreciated.

Thanks

--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---