Opened 19 years ago

Closed 19 years ago

#545 closed defect (duplicate)

Checkin [670] breaks modpython

Reported by: robert@… Owned by: Adrian Holovaty
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: no UI/UX: no

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@… 19 years ago.
avoids importing from settings before environment set up in apache

Download all attachments as: .zip

Change History (4)

comment:1 by robert@…, 19 years ago

Summary: Checkin [671] breaks modpython Checkin [670] breaks modpython

Erm, [670] actually.

by robert@…, 19 years ago

avoids importing from settings before environment set up in apache

comment:2 by robert@…, 19 years ago

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

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

comment:3 by sune.kirkeby@…, 19 years ago

Resolution: duplicate
Status: newclosed

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