On Thu, Sep 17, 2009 at 8:41 PM, steve <st...@lonetwin.net> wrote: > Hello Vishwajeet, > > On 09/16/2009 11:21 PM, vishwajeet singh wrote: > >> 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. >> >> The '.' notation is fairly new and also uncommon AFAIK > http://docs.python.org/tutorial/modules.html#intra-package-references > > This import statement is throwing an error ImportError: cannot import >> name log. >> > The reasons it can't import using this 'from . import' notation would be > the same as for any other import errors. Check your PYTHONPATH and paste the > entire traceback if it still does not work. > > cheers, > - steve > > -- > random non tech spiel: http://lonetwin.blogspot.com/ > tech randomness: http://lonehacks.blogspot.com/ > what i'm stumbling into: http://lonetwin.stumbleupon.com/ >
Thanks steve for your help I was able to fix the probelm. -- Cheers, Vishwajeet http://www.singhvishwajeet.com
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor