From f9e17dba1ae97c48203fc5cc45798a06df4bb0d9 Mon Sep 17 00:00:00 2001 From: pzinovkin Date: Sun, 9 Oct 2011 10:02:51 +0400 Subject: Fix for error 'Settings' object has no attribute 'DATABASE_ENGINE' --- debug_toolbar/views.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'debug_toolbar/views.py') diff --git a/debug_toolbar/views.py b/debug_toolbar/views.py index e0c80aa..dd9916b 100644 --- a/debug_toolbar/views.py +++ b/debug_toolbar/views.py @@ -82,7 +82,10 @@ def sql_explain(request): params = simplejson.loads(params) cursor = connections[alias].cursor() - if settings.DATABASE_ENGINE == "sqlite3": + conn = connections[alias].connection + engine = conn.__class__.__module__.split('.', 1)[0] + + if engine == "sqlite3": # SQLite's EXPLAIN dumps the low-level opcodes generated for a query; # EXPLAIN QUERY PLAN dumps a more human-readable summary # See http://www.sqlite.org/lang_explain.html for details -- cgit v1.2.3