Opened 20 years ago
Closed 20 years ago
#545 closed defect (duplicate)
Checkin [670] breaks modpython
| Reported by: | 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)
Change History (4)
comment:1 by , 20 years ago
| Summary: | Checkin [671] breaks modpython → Checkin [670] breaks modpython |
|---|
by , 20 years ago
| Attachment: | django-avoid-import-hack.patch added |
|---|
avoids importing from settings before environment set up in apache
comment:2 by , 20 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 , 20 years ago
| Resolution: | → duplicate |
|---|---|
| Status: | new → closed |
This is a duplicate of #543; and the patch is a poor hack. I'm dumping it.
Erm, [670] actually.