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 views.py 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

sys.path.append('/wsgi')
sys.path.append('/wsgi/mysite')

import settings

import django.core.management
django.core.management.setup_environ(settings)
utility = django.core.management.ManagementUtility()
command = utility.fetch_command('runserver')

command.validate()

import django.conf
import django.utils

django.utils.translation.activate(django.conf.settings.LANGUAGE_CODE)

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
</Directory>

Does anyone know how to solve this problem?

thanks

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

Legend

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