2023: conditionally import django.core.handlers.modpython?

shig****@gmai***** (Google Code) (Is this you? Claim this profile.)
March 14, 2011
> What version are you running?

> What's the URL of the page containing the problem?
(none yet)

> What steps will reproduce the problem?
1. rb-site install with wsgi
2. try to access reviewboard instance

> What is the expected output? What do you see instead?
Expected: reviewboard interface

Actual result: "taking a nap" page, and error_log contains:

[Sat Mar 12 16:02:27 2011] [error] [client] mod_wsgi (pid=4384): Exception occurred processing WSGI script '/var/www/vhosts/review/htdocs/reviewboard.wsgi'.
[Sat Mar 12 16:02:27 2011] [error] [client] Traceback (most recent call last):
[Sat Mar 12 16:02:27 2011] [error] [client]   File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 232, in __call__
[Sat Mar 12 16:02:27 2011] [error] [client]     self.load_middleware()
[Sat Mar 12 16:02:27 2011] [error] [client]   File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 42, in load_middleware
[Sat Mar 12 16:02:27 2011] [error] [client]     raise exceptions.ImproperlyConfigured('Error importing middleware %s: "%s"' % (mw_module, e))
[Sat Mar 12 16:02:27 2011] [error] [client] ImproperlyConfigured: Error importing middleware reviewboard.admin.middleware: "No module named modpython"

> What operating system are you using? What browser?
Linux, Firefox

> Please provide any additional information below.
This kludge for reviewboard/admin/middleware.py helps just as fine as actually installing python-module-django-mod_python (on ALT Linux):

-from django.core.handlers.modpython import ModPythonRequest
+#from django.core.handlers.modpython import ModPythonRequest

I'd suggest making mod_python optional as per this thread:

...or add the snippet regarding the need to install a django handler to admin docs (installation).
#1 david
Fixed in master (1.6) as 213cac6.
  • +Fixed
#2 shig****@gmai***** (Google Code) (Is this you? Claim this profile.)