-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Accommodate sites where middleware toggles between URL configurations. #161
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
Conversation
What was the reasoning behind copying the url patterns? |
To avoid changing them in place. I guess I'm not sure if urlpatterns are immutable, now that I think about it. |
Ah that makes sense. It wasn't obvious to me since it was the DJDT url conf that was being copied, rather than the original. |
Just did some looking, and I'm no longer certain that the copy is needed; looks like concatenation may be enough to make a new copy of the patterns object. I'll take a look at it tomorrow and update the pull request. |
This accomodates sites where middleware may change the urlconf for two different request.
find_template_and_decorate will decorate the render method of Template classes in order to emit signals needed by Django Debug Toolbar.
Looks like there's some extra commits in here. Will try to get a selective merge done tomorrow. |
The extra commits are to make DjDT work with non-Django templates (>=1.2). We (Eventbrite) would love to see those merged, too. To make things easier I created a feature-branch merge request (#165). I'll create a feature-branch merge request for the other functionality once we've done some more testing. |
@nyergler thanks -- I didn't have time to dig through in in full detail today (I want to ensure I've added proper test coverage when merging it), but I'm hoping to before this week is up |
This commit creates a new URL configuration when adding the debug toolbar URLs and then caches it by name. This accommodates sites where other middleware may change the URL configuration between two requests. Previously the first request's url configuration would "win".