db_info = 'We made a connection for %r' % username
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')
Постоянное соединение с БД в приложении Django/WSGI