This discussion is archived
0 Replies Latest reply: Aug 15, 2012 3:38 AM by 537206 RSS

dbxml django mod_wsgi not working with error: 'finally' pops bad exception

537206 Newbie
Currently Being Moderated
Dear experts

I have a python/django application, 'mysite', which connects to bdbxml. The application works fine using the django development server but fails when run using mod_wsgi with apache - my chosen route for production. Specifically it is the parts of the application that connect to the database that fail with a very unhelpful message, 'finally' pops bad exception.

I believe from googling that this error is a generic error that is generated by C++ applications when there is no other error message to generate, but I am not a C++ expert so don't really know what it means.

My function looks like:

def dbquery(request):
     mgr = XmlManager()
     container = mgr.openContainer("/wsgi/mysite/mysite.bdbxml")
     results = container.getAllDocuments(0)
     for value in results:
          document = value.asDocument()
          return HttpResponse (document.getName())

my django.wsgi file (using the suggested format from Graham Dumpleton) looks like:

import os, sys


import settings

utility =
command = utility.fetch_command('runserver')


import django.conf
import django.utils


import django.core.handlers.wsgi

application = django.core.handlers.wsgi.WSGIHandler()

and httpd.conf looks like:

WSGIApplicationGroup %{GLOBAL}

WSGIScriptAlias / /wsgi/mysite/apache/django.wsgi

<Directory /wsgi/mysite>
Order deny,allow
Allow from all

Does anyone know how to solve this problem?


Edited by: dbxml_explorer on Aug 15, 2012 11:31 AM

Edited by: dbxml_explorer on Aug 15, 2012 11:36 AM

Edited by: dbxml_explorer on Aug 15, 2012 11:37 AM


  • Correct Answers - 10 points
  • Helpful Answers - 5 points