[Tutor] ImportError: cannot import name log

vishwajeet singh dextrous85 at gmail.com
Wed Sep 16 19:51:54 CEST 2009


Hi,

Below is the content of __init__.py

import sys
from django.core.signals import got_request_exception
from . import log
logger = log._get_logger()

def got_request_exception_callback(sender, **kwargs):
    """Logging all unhandled exceptions."""
    type, exception, traceback = sys.exc_info()
    logger.error(unicode(exception))
got_request_exception.connect(got_request_exception_callback)

My question here is that what does *from . import log* doing I can see a
module name log in the same folder.

This import statement is throwing an error ImportError: cannot import name
log.

Thanks for all your help

-- 
Cheers,
Vishwajeet
http://www.singhvishwajeet.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090916/4ba27242/attachment-0001.htm>


More information about the Tutor mailing list