On Wednesday 10 December 2008 16:46:36 Thomas Guettler wrote: > Hi, > > I follow: http://docs.djangoproject.com/en/dev/topics/db/transactions/ > {{{ > The order is quite important. The transaction middleware applies not > only to view functions, but also for all middleware modules that come > after it. So if you use the session middleware after the transaction > middleware, session creation will be part of the transaction. > }}} > > # settings.py > MIDDLEWARE_CLASSES = [ > > 'djangotools.middleware.HandleExceptionMiddleware.HandleExceptionMiddleware >', 'django.middleware.common.CommonMiddleware', > 'django.middleware.transaction.TransactionMiddleware', > 'django.contrib.sessions.middleware.SessionMiddleware', > 'django.contrib.auth.middleware.AuthenticationMiddleware', > 'django.middleware.doc.XViewMiddleware', > ]
I found the documentation quite confusing on this point too, and I ended up googling for the middleware name to find other examples. I think the cache middleware should be around the whole set of middleware classes. Here's what I've gone with: MIDDLEWARE_CLASSES = ( 'django.middleware.cache.UpdateCacheMiddleware', 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.doc.XViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'MySite.dbtemplates.middleware.FlatpageFallbackMiddleware', 'MySite.dbtemplates.middleware.RedirectFallbackMiddleware', 'django.middleware.cache.FetchFromCacheMiddleware', ) If I'm wrong, someone please correct me! Tim. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---