dj-angles doesn't seem to play well with missing template context variables #12
joshuadavidthomas
started this conversation in
General
Replies: 2 comments 3 replies
-
I'll try and get a minimum repro here soon (or even better, a unit test or two), I wanted to capture this asap while I was working through it. |
Beta Was this translation helpful? Give feedback.
2 replies
-
Thanks for the initial discussion! If you can reproduce it, that would be great. I have noticed that |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Okay, so I'm starting this discussion primarily to track me trying to debug this issue. The title is a hypothesis, I'm not totally sure what's going on TBH, but it does seem to involve something with dj-angles.
I installed and configured dj-angles on one of our projects at work and immediately one of the views I was working on refused to load. It's a view that contains a couple of django-tables2 tables (one big one, with a bunch of sub-tables on each row) and a django-bird component for modals on each of the rows. The template is pretty standard, with if checks for context variables that may exist and if they don't fall back to the else, for example here's the table header:
When attempting to load this view, the browser just spins and never resolves while the development server logs show nothing. Enabling
DEBUG
logging helped, as it starts to output logs like this:I'm only including a small portion of the logs related to what I think is happening with the above table header snippet. There's actually a log entry for all of the undefined variables in the template.
This seems to be related to this portion of the table header:
What ends up happening is an endless loop, where browser is continuously loading and the logs keep scrolling past showing the same logs as seen above, over and over again on repeat.
If I remove
dj_angles.template_loader.Loader
from the list of template loaders, the problem goes away -- the logs show theVariableDoesNotExist
error logs, but just once and the browser is able to load the page just fine.Beta Was this translation helpful? Give feedback.
All reactions