Django

Code

Ticket #5004 (closed: duplicate)

Opened 1 year ago

Last modified 1 year ago

Keyword Devel collision

Reported by: petek@google.com Assigned to: jacob
Milestone: Component: Uncategorized
Version: 0.96 Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description (Last modified by mtredinnick)

Setting up mod_python, when I put in PythonPath="['/usr/local/django/devel'].sys.path" , I get :

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

Traceback (most recent call last):

  File "/usr/lib/python2.4/site-packages/mod_python/apache.py", line 299, in HandlerDispatch
    result = object(req)

  File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 177, in handler
    return ModPythonHandler()(req)

  File "/usr/lib/python2.4/site-packages/django/core/handlers/modpython.py", line 145, in __call__
    self.load_middleware()

  File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py", line 22, in load_middleware
    for middleware_path in settings.MIDDLEWARE_CLASSES:

  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 28, in __getattr__
    self._import_settings()

  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 55, in _import_settings
    self._target = Settings(settings_module)

  File "/usr/lib/python2.4/site-packages/django/conf/__init__.py", line 83, in __init__
    raise EnvironmentError, "Could not import settings '%s' (Is it on sys.path? Does it have syntax errors?): %s" % (self.SETTINGS_MODULE, e)

EnvironmentError: Could not import settings 'settings' (Is it on sys.path? Does it have syntax errors?): No module named settings

However....with ['/usr/local/django/']+sys.path it works fine......

Attachments

Change History

07/29/07 01:20:03 changed by mtredinnick

  • status changed from new to closed.
  • description changed.
  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.
  • resolution set to invalid.

There is no bug here. The first thing you tried is not valid Python syntax and the second version is. The documentation uses an example very similar to the second version, too.

07/29/07 02:52:24 changed by petek@google.com

  • status changed from closed to reopened.
  • resolution deleted.

Sorry, reopening. My mistake on the first syntax. Copied incorrectly.

"/usr/local/django/devel?+sys.path" (no good)

vs

"/usr/local/django/?+sys.path" (ok)

07/29/07 04:34:17 changed by Simon G. <dev@simon.net.nz>

  • status changed from reopened to closed.
  • resolution set to duplicate.

dupe of #4296.


Add/Change #5004 (Keyword Devel collision)




Change Properties
Action