On Mon, Dec 17, 2012 at 12:41 PM, dariyoosh <[email protected]> wrote:
> Hello there,
>
>
> Thank you very much for your time and your attention to my question.
> Your solution solved the problem !
>
> It works pretty well now. :)
>
> Just one question, initially I had written
> *'djangodblog.DBLogMiddleware'*
> simply because this was what author has suggested in the book.
>
> But now thanks to your solution, that is, *'djangodblog.middleware.
> DBLogMiddleware'*
> it works without any problem.
>
> So, does this mean that *'djangodblog.DBLogMiddleware'* is wrong? and
> therefore
> the author made a mistake that I have to report to the Errata web site of
> the book? or
> simply this is a component missing from my Django installation?
>
Yes, I suspect so. Try the following:
python manage.py shell
import djangodblog
djangodblog.__file__
(That's two underscores on each side of the word file). This will print a
string that I expect will end with '.../djangodblog/__init__.pyc'.
Whatever is there instead of "..." will tell you how to find the djangdblog
directory. In it you will find both __init__.py and middleware.py, and
only in middleware.py will you find the definition of DBLogMiddleware.
That's normal by convention. There's no physical reason that
DBLogMiddleware could not have been defined in __init__.py, or imported
there from the middlware module, in which case your original
djangdblog.DBLogMiddleware would have worked. But that's not the usual
convention.
>
> Once again, thanks a lot for your help!
>
> Regards,
> Dariyoosh
>
>
>
>
> On Monday, December 17, 2012 6:04:01 PM UTC+1, ke1g wrote:
>>
>>
>> I don't have djangodblog handy, but, at a guess try changing settings to
>> use:
>>
>> *'djangodblog.middleware.DBLogMiddleware'*
>>
>> instead of:
>>
>> *'djangodblog.DBLogMiddleware'*
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/django-users/-/o0OD_xvrNhgJ.
>
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.