Closed carlosble closed 14 years ago
What version of Django required this? I can add it no problem, but just curious.
Suggested change is in, when I get more time I want to look if it should return None if the session attribute doesn't exist.
I am using latest django version, 1.1.1
Thanks :-)
ok thanks... for anyone using Django 1.1+, grab the master version to get this change. As I said, when I have more time I will double check the return value requirements for the middleware.
Ok mate, I'll be aware of new versions that you might release. Please update this issue if you apply changes to the middleware so that I can be aware of it.
Hi carlosble, if you get a chance can you confirm the latest update doesn't break anything? I modified it to return None for process_request, and the response object for process_presponse, per the Django Middleware documentation.
closing due to lack of response
Sorry Joe, couldn't try it out till now. It is working fine apparently. Why are the test methods assigned in every request? Wouldn't if affect performance?
Thanks
I modeled it after the current django session middleware. It shouldn't affect performance much if it at all as it's a simple string check without any regex or anything. I suppose it could be optimized, but I'll leave that for anyone who is interested in taking that on.
Hi! Thanks for gae_utitlities, they are great man! :-)
I've had to change the Django SessionMiddleware myself in order to make it work properly. The change was just adding this method:
To the SessionMiddelware class under django-middelware/middelware.py
Now it works pretty well. Cheers