-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
using phased with contrib.messages #12
Comments
The problem was again in the order of middleware classes. To solve this particular problem PhasedRenderMiddleware needs to be below MessageMiddleware. Here is my current order:
That is FetchFromCacheMiddleware and PhasedRenderMiddleware are on the last places. I hope it won't cause problems somewhere else because in docs PhasedRenderMiddleware is on the first place. |
philipn
added a commit
to philipn/django-phased
that referenced
this issue
Aug 25, 2014
Because of codysoyland#12, I had to move PhasedRenderMiddleware to the bottom(ish) of my `MIDDLEWARE_CLASSES`. This fixed the issue with the `MessageMiddleware`, but caused new issues with other middleware I had that altered the length of the response. Ideally, these other middleware classes would check to see if `Content-Length` was set, and if so, re-adjust the content length header. Unfortunately, this doesn't seem to be the case, and it seems smart for us to check to see if the header's set before adding it in here, anyway.
philipn
added a commit
to philipn/django-phased
that referenced
this issue
Aug 25, 2014
Because of codysoyland#12, I had to move PhasedRenderMiddleware to the bottom(ish) of my `MIDDLEWARE_CLASSES`. This fixed the issue with the `MessageMiddleware`, but caused new issues with other middleware I had that altered the length of the response. Ideally, these other middleware classes would check to see if `Content-Length` was set, and if so, re-adjust the content length header. Unfortunately, this doesn't seem to be the case, and it seems smart for us to check to see if the header's set before adding it in here, anyway.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to apply phased on a snippet where I render flash messages but It doesn't quite work. I get the messages printed on all the pages several times. It's like they are staying in session as not-yet-printed even though they have been already printed by second_pass_renderer.
The text was updated successfully, but these errors were encountered: