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
Redirect issue when used with Mezzanine 1.4.16 #509
Comments
I'm not sure I understand your explanation. Are you saying that a page of your site displays correctly without the toolbar but returns a 404 not found with the toolbar? The redirects table isn't used by the debug_toolbar. It's used by Mezzanine as shown in your traceback and in the Mezzanine source code: |
I don't know where to start with the information available in the ticket :-/ It could be a middleware ordering issue. |
What other information do you need? |
yes the page displays correctly without the toolbar, but gives a 404 error when I try and view the page with debug_toolbar enabled. From: Aymeric Augustin I'm not sure I understand your explanation. Are you saying that a page of your site displays correctly without the toolbar but returns a 404 not found with the toolbar? The redirects table isn't used by the debug_toolbar. It's used by Mezzanine as shown in your traceback and in the Mezzanine source code: — This email is free from viruses and malware because avast! Antivirus protection is active. |
I have commited what I have setup in my virtualenv and you can look at it at https://github.com/moltra/mezz . admin name is mark and password is password if you want to run it and see the error yourself. From: Aymeric Augustin I don't know where to start with the information available in the ticket :-/ It could be a middleware ordering issue. — This email is free from viruses and malware because avast! Antivirus protection is active. |
I can confirm this issue - |
Extra background: Mezzanine will automatically configure DDT if available - in which case it puts DDT's middleware to the top of the middleware order. I don't recall the reasoning for this, and since it does this explicitly I'm certain there was a specific reason for it at some point, but that code is several years old so I can't recall. Now prior to DDT 1.0, Unrelated to DDT, but the reason for the above description around 404s being generated is that Mezzanine actually depends on its own middleware executing to correctly identify content to load, and if that doesn't happen a 404 response is returned. I'll be changing the setup code in Mezzanine to put |
Further, this appears to be a duplicate of #497 |
@stephenmcd Thanks a lot for the detailed explanation! It's very helpful. (I had tried to run the project provided by @moltra but couldn't make it work; settings didn't seem to be correct.) In fact before 1.0 the DDT would execute each view twice, once under profiling in process_view (but the generated response wasn't returned) and once normally. This resulted in duplicates as soon as a view wasn't idempotent. I can't really blame the middleware ordering on Mezzanine as the DDT's automatic setup code also puts the middleware in first position: https://github.com/django-debug-toolbar/django-debug-toolbar/blob/master/debug_toolbar/models.py#L43-L46 Anyway, this is indeed a duplicate of #497, and I will copy relevant parts of this comment over there. |
I am working on a site using Mezzanine 1.4.16. When I enable debug_toolbar, I start getting redirect errors. The django_redirect table is totally empty, but with debug_toolbar enabled it is used for some reason.
I get the below information when I have the debug_toolbar enabled.
This is the SQL generated by debug_toolbar when it is enabled and I try and go to page.
This is what I have installed in the virtualenv
The text was updated successfully, but these errors were encountered: