I've searched the web and this group, and the consensus seems to be
that I must have a problem with my urls.py in one or more places;
however, I'm at a loss as to where that might be.

I recently transitioned from a fastcgi deployment proxied from nginx
to mod_python. Previously, nginx was handling my trailing slashes, and
I had no errors whatsoever.

With mod_python I now I get the following error when I attempt to
access a page without a trailing slash:

MOD_PYTHON ERROR

ProcessId:      XXXXX
Interpreter:    'mydomain.com'

ServerName:     'mydomain.com'
DocumentRoot:   'htdocs'

URI:            '/admin'
Location:       '/'
Directory:      None
Filename:       'htdocs'
PathInfo:       '/admin'

Phase:          'PythonHandler'
Handler:        'django.core.handlers.modpython'

Traceback (most recent call last):

  File "/python2.5/mod_python/importer.py", line 1537, in
HandlerDispatch
    default=default_handler, arg=req, silent=hlist.silent)

  File "/python2.5/mod_python/importer.py", line 1229, in
_process_target
    result = _execute_target(config, req, object, arg)

  File "/python2.5/mod_python/importer.py", line 1128, in
_execute_target
    result = object(arg)

  File "/python2.5/django/core/handlers/modpython.py", line 188, in
handler
    return ModPythonHandler()(req)

  File "/python2.5/django/core/handlers/modpython.py", line 161, in
__call__
    response = self.get_response(request)

  File "/python2.5/django/core/handlers/base.py", line 64, in
get_response
    response = middleware_method(request)

  File "/python2.5/django/middleware/common.py", line 57, in
process_request
    urlresolvers.resolve(request.path)

  File "/python2.5/django/core/urlresolvers.py", line 292, in resolve
    return get_resolver(urlconf).resolve(path)

  File "/python2.5/django/core/urlresolvers.py", line 231, in resolve
    for pattern in self.urlconf_module.urlpatterns:

AttributeError: 'module' object has no attribute 'urlpatterns'

Now, with mod_python, neither setting append_slash to true or using
apache mod_dir, as suggested by my hosting provider, has taken care of
my slashes.

FWIW, I'm using the most recent django svn checkout. I'm alsomaking
use of the multihost middleware:

MIDDLEWARE_CLASSES = (
    'django.middleware.common.CommonMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.middleware.doc.XViewMiddleware',
    'django.middleware.transaction.TransactionMiddleware',
    'django.contrib.multihost.MultiHostMiddleware'
)

HOST_MIDDLEWARE_URLCONF_MAP = {
   "domainone.com": "project.sites.domainone",
   "www.domainone.com": "project.sites.domainone",
   "domaintwo.com": "project.sites.domaintwo",
   "www.domaintwo.com": "project.sites.domaintwo"
}

**domainone.py**

from django.conf.urls.defaults import *

urlpatterns = patterns('',
    (r'^admin/', include('django.contrib.admin.urls')),
    (r'^/?', include('domainone.pages.urls')),
)

I tried disabling all of my urls.py files with the exception of the
include for 'django.contrib.admin.urls'; however, loading /admin still
failed with the same error.

Any help that can be provided would be greatly appreciated?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to