Skip to content

Instantly share code, notes, and snippets.

@akrito
Created June 9, 2010 21:41
Show Gist options
  • Save akrito/432217 to your computer and use it in GitHub Desktop.
Save akrito/432217 to your computer and use it in GitHub Desktop.
/home/alex/v/ellington/src/django/django/middleware/cache.py(116)process_request()
114 """
115 if self.cache_anonymous_only:
--> 116 assert hasattr(request, 'user'), "The Django cache middleware with CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True requires authentication middleware to be installed. Edit your MIDDLEWARE_CLASSES setting to insert 'django.contrib.auth.middleware.AuthenticationMiddleware' before the CacheMiddleware."
117
118 if not request.method in ('GET', 'HEAD') or request.GET:
/home/alex/v/ellington/src/django/django/contrib/auth/middleware.py(9)__get__()
7 if not hasattr(request, '_cached_user'):
8 from django.contrib.auth import get_user
----> 9 request._cached_user = get_user(request)
10 return request._cached_user
11
/home/alex/v/ellington/src/django/django/contrib/auth/__init__.py(97)get_user()
95 from django.contrib.auth.models import AnonymousUser
96 try:
---> 97 user_id = request.session[SESSION_KEY]
98 backend_path = request.session[BACKEND_SESSION_KEY]
99 backend = load_backend(backend_path)
/home/alex/v/ellington/src/django/django/contrib/sessions/backends/base.py(46)__getitem__()
44
45 def __getitem__(self, key):
---> 46 return self._session[key]
47
48 def __setitem__(self, key, value):
> /home/alex/v/ellington/src/django/django/contrib/sessions/backends/base.py(166)_get_session()
164 """
165 import ipdb; ipdb.set_trace()
--> 166 self.accessed = True
167 try:
168 return self._session_cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment