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 8876371
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T19:11:54+00:00 2026-06-14T19:11:54+00:00

I am experimenting on running two wsgi applications configured on the same VirtualHost .

  • 0

I am experimenting on running two wsgi applications configured on the same VirtualHost. One of the apps myapp is the standard hello-world code specified here. It is loading absolutely fine. The other app, uiapp is a Django site. It fails with an ImportError.

I read in wsgi docs that value of python-path is appended to the sys.path, so that’s what I have specified in my WSGIDaemonProcess for uiapp.

I can’t figure out if the problem is with the Python code, or the Apache configuration.

This is my virtualhost configuration:

    [ . . . ]

    # processGroups
    WSGIProcessGroup uiapp
    WSGIProcessGroup myapp

    # configurations for django sites
    WSGIScriptAlias /uiapp "/some/path/ui_dir/site_prod/wsgi.py"
    WSGIScriptAlias /myapp "/some/other/path/myapp.wsgi"

    # daemons
    WSGIDaemonProcess uiapp processes=2 threads=25 display-name=site_prod_wsgi python-path=/some/path/ui_dir
    WSGIDaemonProcess myapp processes=2 threads=25 display-name=helloworld_wsgi

    # doc root for /uiapp
    <Directory "/some/path/ui_dir/site_prod">
        Order allow,deny
        Allow from all
    </Directory>

    # doc root for /myapp
    <Directory "/some/other/path">
        Order allow,deny
        Allow from all
    </Directory>

    [ . . . ]

I have tried to change the python-path for uiapp to /some/path/ui_dir/site_prod, but even that is failing with the same error.

The error-log is:

 mod_wsgi (pid=32652): Exception occurred processing WSGI script '/some/path/ui_dir/site_prod/wsgi.py'.
 Traceback (most recent call last):
   File "/home/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 219, in __call__
     self.load_middleware()
   File "/home/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 39, in load_middleware
     for middleware_path in settings.MIDDLEWARE_CLASSES:
   File "/home/usr/local/lib/python2.7/site-packages/django/utils/functional.py", line 184, in inner
     self._setup()
   File "/home/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 42, in _setup
     self._wrapped = Settings(settings_module)
   File "/home/usr/local/lib/python2.7/site-packages/django/conf/__init__.py", line 95, in __init__
     raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
 ImportError: Could not import settings 'site_prod.settings' (Is it on sys.path?): No module named site_prod.settings

This is the source for /some/path/ui_dir/site_prod/wsgi.py

import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "site_prod.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()

# Apply WSGI middleware here.
# from helloworld.wsgi import HelloWorldApplication
# application = HelloWorldApplication(application)

Kindly help me figure out what I am doing wrong.

  • 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-06-14T19:11:55+00:00Added an answer on June 14, 2026 at 7:11 pm

    You can’t have two WSGIProcessGroup directives in a row like that. Only the last will be used. Thus you are actually sending both applications to the same daemon process group instead of different ones. Having done that and having them in the same process you are hitting the setdefault() issue described in:

    • http://blog.dscpl.com.au/2012/10/requests-running-in-wrong-django.html

    Move the WSGIProcessGroup directives inside of the Directory blocks pertaining to the respective WSGI script file locations.

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

Sidebar

Related Questions

I want to try experimenting with running low level code my Nexus One phone,
I'm experiencing two intermittent problems with Silverlight 3.0, running on Windows 7 with Visual
I'm experimenting with the Search API with appengine, and am consistently running into the
Has anyone had any success running two different web servers -- such as Apache
I am experiencing problems when running some code that I am developing. It should
Recently two users of our software from the same company started experiencing random closures
I have two computers behind a router on the same network. On computer A,
I am experimenting with Multithreading in java, basically I want to make two threads,
I own a server running whm / cpanel, and I have recently been experimenting
We are running a .NET 2.0 Web Application. One of our clients is experiencing

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.