Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve 'django.utils.log.NullHandler' in Django 1.9+

Tags:

python

django

After upgrading to Django 1.9 or 1.10, LOGGING configurations with django.utils.log.NullHandler throws an exception saying that the NullHandler is not resolvable:

Unable to configure handler 'null': Cannot resolve 'django.utils.log.NullHandler': No module named NullHandler

This can also happen if copy/pasting commonly suggested log configurations into new projects based upon Django 1.9 or 1.10.

How do I resolve this?

like image 245
Iam Moon Avatar asked Dec 18 '15 04:12

Iam Moon


1 Answers

django.utils.log.NullHandler is actually alias to logging.NullHandler.

Looks like it was removed in 1.9.

Just check your settings (and any other code) and replace django.utils.log.NullHandler with logging.NullHandler.

like image 133
Ivan Klass Avatar answered Oct 18 '22 11:10

Ivan Klass