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

The Archive Base Latest Questions

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

We use Apache+mod_wsgi to host our Django application. Apache: WSGIScriptAlias / /home/rls/django_wsgi.py django_wsgi.py: import

  • 0

We use Apache+mod_wsgi to host our Django application.

Apache:

WSGIScriptAlias / /home/rls/django_wsgi.py

django_wsgi.py:

import os, sys
sys.path.append('data/misc/django')
os.environ['DJANGO_SETTINGS_MODULE'] = 'rls.settings'

import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

Everything works fine, but occasionally we get 500 Internal Server Error with this in the logs:

mod_wsgi (pid=4825): Exception occurred processing WSGI script '/home/rls/django_wsgi.py'.
Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/django/core/handlers/wsgi.py", line 230, in __call__
self.load_middleware()
File "/usr/lib/python2.5/site-packages/django/core/handlers/base.py", line 33, in load_middleware
for middleware_path in settings.MIDDLEWARE_CLASSES:
File "/usr/lib/python2.5/site-packages/django/utils/functional.py", line 276, in __getattr__
self._setup()
File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 40, in _setup
self._wrapped = Settings(settings_module)
File "/usr/lib/python2.5/site-packages/django/conf/__init__.py", line 75, in __init__
raise ImportError("Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'rls.settings' (Is it on sys.path? Does it have syntax errors?): No module named rls.settings

Of course there are no syntax errors in settings.py since it loads fine every other time. What I’m missing? Thanks very much for your help.

  • 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-20T17:48:21+00:00Added an answer on May 20, 2026 at 5:48 pm

    Try to set the absolute path to the directory that contains the file settings.py.
    In your case should be something like:

    sys.path.append('/%s/data/misc/django'%ROOT_2_DATA)
    

    You must also check that apache group has permissions to read/write the folder.

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

Sidebar

Related Questions

What to use for a medium to large python WSGI application, Apache + mod_wsgi
I have been looking into IKVMing Apache's FOP project to use with our .NET
I've had some problems with a Django application after I deployed it. I use
I am deploying a mod_wsgi application on top of Apache, and have a client
While developing a Django app deployed on Apache mod_wsgi I found that in case
Can someone explain the difference between apache mod_wsgi in daemon mode and django fastcgi
Is it possible to use Apache Subversion (SVN) as general purpose backup tool? (As
I'm trying to create a self signed certificate for use with Apache Tomcat 6.
I come from a mainly PHP background and make good use of the Apache
I'm trying to use the StringEscapeUtils.escapeXML() function from org.apache.commons.lang... There are two versions of

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.