-
Notifications
You must be signed in to change notification settings - Fork 170
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
CachedLoader breaks application #73
Comments
Oh, and i should mention that we are using version from master (0.7.0dev1), because earlier version do not work with our project (django 1.9). |
Hm, this sounds strange as the Maybe try hooking some print statements in the |
Hello, and thank you for response. We do not have custom flavour detection middleware, also we are loading template in request/response cycle. I will hook prints into cached loader's cache_key function and send message here. |
Okay, i did some debugging: Thats how i modified cached loader: class CachedLoader(DjangoCachedLoader):
This code returned this output to me:
Our configurations is like this: templates/home.html → first request goes here templates/base.html → desktop version So it looks like this: Incoming request starts the homepage view, which tries to render This is how templates looks: base.html: just a simple template home.html: {% extends "base.html" %} mobile/base.html: {% extends "base.html" %} → this recursive extend does not work with CachedLoader. I should note that Django supports recursive loading of templates (and it is working with non cached loader version). TEMPLATES configuration variable looks like this:
I will be happy if it will be fixed, or at least some workaround found. Thanks! |
Hello!
We are using django-mobile in our project.
We use Django 1.9 and experienced trouble with cached loader: it ruined the application down with exceptions:
./manage.py runserver
just crashed when tried to set flavour to mobileuwsgi
has a maximum recursion depth exceeded when tried to set flavour to mobileOur templates configuration is like this:
templates/base.html
templates/mobile/base.html
mobile/base.html has {% extends "base.html" %}
In this situation problem started to appear.
We had to turn off cached loaders at all, because django-mobile's loader is broken and Django's cached loader do not working with django-mobile.
As far as i see, the problem is in django-mobile's CachedLoader implementation — it does not understand what current flavour is, so it generate broken cache key for both base.html and mobile/base.html, which looks like this:
full:base.html
So the mobile template tries to extend "base.html", but gets itself content (with extend) instead of original, root base.html.
The text was updated successfully, but these errors were encountered: