fix, if the settings is a threading.local() instance it does not have the items() function, but its iterable through the __dict__ property

This commit is contained in:
Fabio Miranda Costa 2011-12-21 16:38:27 -03:00
parent 8e87498aaa
commit d2d8c7e3c2

View file

@ -125,7 +125,7 @@ class DjangoServer(HTTPServer, object):
thread = current_thread() thread = current_thread()
if not hasattr(thread, "settings"): if not hasattr(thread, "settings"):
thread.settings = local() thread.settings = local()
for key, value in settings.items(): for key, value in getattr(settings, '__dict__', settings).items():
setattr(thread.settings, key, value) setattr(thread.settings, key, value)
while True: while True:
self.handle_request() self.handle_request()