Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4020318
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T10:12:48+00:00 2026-05-20T10:12:48+00:00

I have a custom django filefield that makes use of sox, a commandline audiotool.

  • 0

I have a custom django filefield that makes use of sox, a commandline audiotool. This works pretty well as long as i use the django development server. But as soon as i switch to the production server, using apache2 and mod_wsgi, mod_wsgi catches every output to stdout. This makes it impossible to use the commandline tool to evaluate the file, for example use it to check if the uploaded file really is an audio file like this:

filetype=subprocess.Popen([sox,'--i','-t','%s'%self.path], shell=False,\
                          stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(filetype,error)=filetype.communicate()
if error:
    raise EnvironmentError((1,'AudioFile error while determining audioformat: %s'%error))  

Is there a way to workaround for this?

edit
the error i get is “missing filename”. I am using mod_wsgi 2.5, standard with ubuntu 8.04.

edit2
What exactly happens, when i call subprocess.Popen from within django in mod_wsgi? Shouldn’t subprocess stdin/stdout be independent from django stdin/stdout? In that case mod_wsgi should not affect programms called via subprocess. Is it possible to use a commandlinetool like that from mod_wsgi?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T10:12:49+00:00Added an answer on May 20, 2026 at 10:12 am

    Add debug to your program to log to stderr the value of ‘self.path’ to ensure it is actually set to something. The message ‘missing filename’ suggest it may be empty. Also be aware that when running on Apache/mod_wsgi you must use absolute path names to files because the current working directory will not be the project directory like with the Django development server. Finally, Apache runs as a special user, so it needs to have appropriate read and/or write access to the directories you need it to access/write to. The path and access issues are documented in:

    http://code.google.com/p/modwsgi/wiki/ApplicationIssues

    BTW, for stdout issues, you really should upgrade to mod_wsgi 3.3. Read:

    http://blog.dscpl.com.au/2009/04/wsgi-and-printing-to-standard-output.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have custom exceptions in my django project that look like this: class CustomFooError(Exception):
I have a Django 1.4 project that makes use of django-registration which calls a
I have a custom model fields, that can have 'chain' argument. from django.db import
Background I have a custom authentication back end for our django applications that refers
I have a custom session class that I've built to extend the Django SessionBase.
Currently, we have a custom cms product for schools that is built in django
I have a custom property on my Django model that returns the full name
I have this line in a custom django-admin command: logger.info(%d records updated, records_updated) When
I have written 2 custom template tags in Django. The goal is to use
I currently have my Django custom template filter like this: from django import template

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.