Opened 10 years ago

Closed 10 years ago

#543 closed defect (fixed)

[patch] Django under mod_python broken

Reported by: sune.kirkeby@… Owned by: adrian
Component: Core (Other) Version:
Severity: blocker Keywords: mod_python modpython
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Mod_python error: "PythonHandler django.core.handlers.modpython"

Traceback (most recent call last):

  File "/usr/local/opt/python/lib/python2.4/site-packages/mod_python/", line 287, in HandlerDispatch

  File "/usr/local/opt/python/lib/python2.4/site-packages/mod_python/", line 457, in import_module
    module = imp.load_module(mname, f, p, d)

  File "/home/sune/django/django/core/handlers/", line 1, in ?
    from django.core.handlers.base import BaseHandler

  File "/home/sune/django/django/core/handlers/", line 1, in ?
    from django.utils import httpwrappers

  File "/home/sune/django/django/utils/", line 5, in ?
    from django.conf.settings import DEFAULT_MIME_TYPE

  File "/home/sune/django/django/conf/", line 29, in ?
    raise EnvironmentError, "Environment variable %s is undefined." % ENVIRONMENT_VARIABLE

EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined.

This is what you get, if you do not set DJANGO_SETTINGS_MODULE in your environment before starting
your mod_python-Apache. Some recent changeset did not heed the warning at the top of the
I'll attach a patch in a moment.

Attachments (1)

modpython.patch (1.1 KB) - added by sune.kirkeby@… 10 years ago.

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by sune.kirkeby@…

comment:1 Changed 10 years ago by sune.kirkeby@…

  • Summary changed from Django under mod_python broken to [patch] Django under mod_python broken

Added [patch] to summary.

comment:2 Changed 10 years ago by anonymous

  • Keywords mod_python modpython added

comment:3 Changed 10 years ago by adrian

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [672].

Note: See TracTickets for help on using tickets.
Back to Top