dcramer / django-devserver

A drop-in replacement for Django's runserver.
BSD 3-Clause "New" or "Revised" License
1.27k stars 159 forks source link

add devserver.settings.DEBUG #54

Closed vicalloy closed 11 years ago

vicalloy commented 12 years ago

add devserver.settings.DEBUG

dcramer commented 12 years ago

What was the reason for this?

vicalloy commented 12 years ago

django-devserver / devserver / modules / sql.py line 82,105 if not (debug_toolbar or settings.DEBUG): I get a error.

stephenmuss commented 12 years ago

I can confirm that I get this error too. See below for a link to my traceback.

http://pastebin.com/bz9cLLVw

zacharyvoase commented 12 years ago

+1 from me. It looks like this only arises where the Django Debug Toolbar is not available, or DatabaseStatTracker is not defined in debug_toolbar.panels.sql. See: https://github.com/dcramer/django-devserver/blob/master/devserver/modules/sql.py#L82

The short-circuit logic means that this won't raise an error if the DDT stuff works, but if it doesn't you'll get an attribute error, because it inspects settings.DEBUG without realizing that settings is devserver.settings, not django.conf.settings. Excuse my 3AM-English :)

dcramer commented 11 years ago

fixed in 69c86890aa9fd3cdc58d2130a693d5c5cc48e5df