Middleware order

30 views
Skip to first unread message

David

unread,
May 15, 2012, 11:23:17 AM5/15/12
to django...@googlegroups.com
Hi

This is how my middleware is currently ordered:

    'django.middleware.cache.UpdateCacheMiddleware',
    'django.middleware.gzip.GZipMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.transaction.TransactionMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
    'django.middleware.cache.FetchFromCacheMiddleware',
    'debug_toolbar.middleware.DebugToolbarMiddleware',
    'reversion.middleware.RevisionMiddleware',

My problem for example is this. I have a form editting an object. If I submit/save the object it is saved successfully, however when redirecting back to that edit object form the old data persists. I suspect this is down to the order of my middleware.

Have I gone wrong somewhere?

Thank you

Furbee

unread,
May 15, 2012, 11:33:31 AM5/15/12
to django...@googlegroups.com
I don't know, but the revision middleware smells like it could be the culprit. It is the last module in processing the request, and the first one processing the response back up the chain. Maybe it is returning the old data. Just a stab in the dark.

Furbee

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/jkFCQ_SsvtoJ.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Reply all
Reply to author
Forward
0 new messages