-
-
Notifications
You must be signed in to change notification settings - Fork 340
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
Check to see if process_request of SilkyMiddleware has been called, and issue warnings on middleware placement if not #42
Comments
Hey, So I don't think this is an issue with This should def be clearer anyway, could probably build something in that checks to see if |
Oh okay, my bad. When I place it as first middleware on that example, it seems to work nicely. Yet, on my own project, I can't place SilkyMiddleware before Localemiddleware - when I do, things break in such a way that I can only access the main locale (all the URLs for the other locales give me 404s). I can still use it on all the URLs that are still served, but I'm wondering why what I see happens. There might just be something wrong with my configuration. That's why I'm trying to find a small example to understand what's going on. |
That's weird, I wouldn't expect the silk middleware to interfere with any others if placed first. It doesn't return anything from Maybe it's something to do with the fact that |
After adding LANGUAGES = ( [12/Nov/2014 17:39:01] "GET /de/example_app/ HTTP/1.1" 404 2425 Page not found (404) Using the URLconf defined in django_silky.urls, Django tried these URL patterns, in this order:
The current URL, de/example_app/, didn't match any of these. Uncommenting SilkyMiddleware, the page is served normally. Uncommenting @silk_meta_profiler in middleware.py doesn't seem to make any difference. That seems to be the same issue I have in my project with LocaleMiddleware. I totally agree that it's pretty mysterious. At least I've now nailed it down to a pretty small example. |
Ok weird, others in the past have had issues with Silk and the url conf, in fact someone made a pull request making some changes which was supposed to have fixed these kind of issues (assuming Silk is indeed the problem here). I've had a ton of issues myself getting the urls to work properly. Unfortunately I have zero experience with locale. I'll take a look at the example you've put together at some point tomorrow |
Done. |
When I use django.middleware.locale.LocaleMiddleware together with silk, I'm able to trigger the following error by going to /admin/ and /example_app/ (you need to go to both of them to trigger the error):
AttributeError: 'thread._local' object has no attribute 'temp_identifier'
Trace and settings:
https://gist.github.com/grumpi/f0867ac818b6c193fa62
Modified example app to trigger this behavior:
https://github.com/grumpi/silk/tree/localemiddleware-bug
I tested this on Django 1.7.1 and Django 1.6.5. It looks like, somehow self.local.temp_identifier isn't set up properly. Might or might not be related to the duplicate key issue.
The text was updated successfully, but these errors were encountered: