results = strangedb_connection.query('SELECT * FROM my_table')
text = '%s\n%s\n%s\n' % (thread_info, db_info, results)
return HttpResponse(text, content_type='text/plain')
Persistent DB Connection in Django/WSGI application