Yeah! I found the solution. Instead of:

  'XXX.cms.middleware.session.ThreadLocals',

I need to do:

  'cms.middleware.session.ThreadLocals',

So, specify the middleware class without the project name.

The strange thing is that the middleware itself works when the project
is specified, however the model class methods seem to run in a
different thread. There must be an explanation for this somewhere deep
down Django. Does someone know why?

cheers,
Hilbert

On 22 apr, 11:14, Hilbert Schraal <[EMAIL PROTECTED]> wrote:
> Thanks for the tip. I fiddled around with the imports, but no
> results.... :(
>
> On 20 apr, 21:33, Doug B <[EMAIL PROTECTED]> wrote:
>
> > Its been a while, but I had problems getting this to work at first
> > too.  It turned out to be how I was importing the module that
> > contained thread locals.  I needed to specify the project as well as
> > the app when doing the import.
>
> > I couldn't just do from myapp import mymiddleware, I had to do from
> > myproject.myapp import mymiddleware.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to