Opened 10 years ago

Closed 10 years ago

#545 closed defect (duplicate)

Checkin [670] breaks modpython

Reported by: robert@… Owned by: adrian
Component: Core (Other) Version:
Severity: critical Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Due to a chain of imports, the environment never gets updated in modpython after [671]

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

Traceback (most recent call last):

File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 287, in HandlerDispatch

log=debug)

File "/usr/lib/python2.3/site-packages/mod_python/apache.py", line 457, in import_module

module = imp.load_module(mname, f, p, d)

File "/usr/lib/python2.3/site-packages/django/core/handlers/modpython.py", line 1, in ?

from django.core.handlers.base import BaseHandler

File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py", line 1, in ?

from django.utils import httpwrappers

File "/usr/lib/python2.3/site-packages/django/utils/httpwrappers.py", line 5, in ?

from django.conf.settings import DEFAULT_MIME_TYPE

File "/usr/lib/python2.3/site-packages/django/conf/settings.py", line 29, in ?

raise EnvironmentError, "Environment variable %s is undefined." % (ENVIRONMENT_VARIABLE)

EnvironmentError: Environment variable DJANGO_SETTINGS_MODULE is undefined.

Attachments (1)

django-avoid-import-hack.patch (559 bytes) - added by robert@… 10 years ago.
avoids importing from settings before environment set up in apache

Download all attachments as: .zip

Change History (4)

comment:1 Changed 10 years ago by robert@…

  • Summary changed from Checkin [671] breaks modpython to Checkin [670] breaks modpython

Erm, [670] actually.

Changed 10 years ago by robert@…

avoids importing from settings before environment set up in apache

comment:2 Changed 10 years ago by robert@…

The django-avoid-import-hack.patch just avoids importing.

It is probably better to just do the import lazily or something.

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

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

This is a duplicate of #543; and the patch is a poor hack. I'm dumping it.

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