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
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
check, that was a bit stupid :)
On 21 apr, 15:16, "Marty Alchin" <[EMAIL PROTECTED]> wrote:
> On Sun, Apr 20, 2008 at 10:45 AM, Hilbert Schraal
>
> <[EMAIL PROTECTED]> wrote:
> > # Make this unique, and don't share it with anybody.
> > SECRET_KEY = '[EMAIL
Some extra info. I printed the _thread_locals variable in the
get_current_user() method and in the process_request() method. They
are different:
middleware:
get_current_user:
Here's the threadlocals.py:
import logging
try:
from threading import local
except ImportError:
from
On Sun, Apr 20, 2008 at 10:45 AM, Hilbert Schraal
<[EMAIL PROTECTED]> wrote:
> # Make this unique, and don't share it with anybody.
> SECRET_KEY = '[EMAIL PROTECTED]@d(5w+m)kpcjffne(pvb+#6w2s_pz*5)b%$f'
As an aside, note the comment: "don't share it with anybody" It's good
that you cleaned the
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
Hi All,
I've followed the CookBook (http://code.djangoproject.com/wiki/
CookBookThreadlocalsAndUser) to have the user available in my model. I
have added the ThreadLocals class to my code and added it to the
middleware class setting. It gets called en sets values that look
valid.
However, when
7 matches
Mail list logo