Optimization request - give ``request.session`` lazy read

2012-09-30 Thread Yo-Yo Ma
With ``contrib.sessions`` installed and ``SessionMiddleware`` in use, I noticed that when Django session cookie is set the ``django_session`` table is queried on every request, regardless of whether any session data is used during the request cycle. Making the ``session`` attribute of request a

Re: Feature request: collectstatic shouldn't recopy files that already exist in destination

2012-09-30 Thread Dan Loewenherz
I think it's an API limitation. Many backends don't support last modified times, and even if they all did, it's incorrect to assume that last modified time is an accurate heuristic for whether a file has already been uploaded or not. It might be a better idea to let the backends decide when a file

Re: Feature request: collectstatic shouldn't recopy files that already exist in destination

2012-09-30 Thread Stephen Burrows
I use S3 as well, and I have seen cases where files get copied that I know don't need to be. That being said, it was never so slow that it was an issue for me. Is there clear evidence that this is something which can't be handled by the S3 backend due to an inadequate API on the django side? --

Re: django.test.client.Client tests in Django development?

2012-09-30 Thread Łukasz Rekucki
Hi everyone, After a quick peekat the code in get_user(), I'm curious is there any reason we currently don't flush the user's session (or at least remove the SESSION_KEY and BACKEND_SESSION_KEY) if the backend returns None for the user's id? I can't see how being able to hang on to an unauthorize

Re: django.test.client.Client tests in Django development?

2012-09-30 Thread Aymeric Augustin
Le 30 sept. 2012 à 10:57, Mateusz Haligowski a écrit : > I wanted to contribute to Django and decided to fix #18998. Starting with > writing tests, is seems to me that the easiest to write and read the test > would be using django.test.client.Client tool (sessions and stuff). Is it OK > to use

django.test.client.Client tests in Django development?

2012-09-30 Thread Mateusz Haligowski
Hi, I wanted to contribute to Django and decided to fix #18998. Starting with writing tests, is seems to me that the easiest to write and read the test would be using django.test.client.Client tool (sessions and stuff). Is it OK to use that in testin