Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using an app called django-chronograph. It has a code of line which works in my dev environment and does not work in production:

p = subprocess.Popen(['python', get_manage_py(), 'run_job', str(self.pk)])

This line crashes in production with: unknown command run_job Whereas when I run directly from command line: manage.py run_job It works fine.

Interestingly it worked once when we exchanged 'python' with 'usr/bin/python'. then we restarted the server once more and it was back to old behaviour.

Thus it seems as we have a python path issue. I'm not the guy who is running the server, its my app that should run and it would be great to get some help here. Attention: I'm a total noob regarding server-administration..

server environment: NGINX with FCGI-Daemon FCGI in prefork-mode

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

Yeah, uh... don't do that.

django.core.management.call_command('run_job', str(self.pk))
share|improve this answer
    
Ok that s a good hint. I will replace it and I guess this will overcome my problem. Just for curiousity, why do you think subprocess.Popen should be absolutely not used ? Maybe then I should tell the author of django-chronograph.. –  Tom Apr 30 '10 at 7:18
    
Because there's already a perfectly good mechanism for invoking commands from within the app itself. –  Ignacio Vazquez-Abrams Apr 30 '10 at 9:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.