We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Using turbolinks everything works as expected on the first page load.
After transitioning to another page, all css/js/html is correctly loaded and created, but the djdt.init function bound to the DOMContentLoaded event doesn't fire (https://github.com/jazzband/django-debug-toolbar/blob/master/debug_toolbar/static/debug_toolbar/js/toolbar.js#L329) so click handlers and setup aren't initialized
The text was updated successfully, but these errors were encountered:
Was dealing with flakiness for a while until I realized there's a nice INSERT_BEFORE config option. Final solution I landed on was this setting
INSERT_BEFORE
def show_toolbar(request): return True DEBUG_TOOLBAR_CONFIG = { "SHOW_TOOLBAR_CALLBACK" : show_toolbar, "INSERT_BEFORE": '</head>' }
And this js snippet
// django debug toolbar document.addEventListener("turbolinks:load", (event) => { if ("djdt" in window) { window.djdt.init(); } });
And some custom things to make sure these only run in dev. Hope this helps!
Sorry, something went wrong.
Just got this working with HTMX boosted links - similar snippet,
<script> document.addEventListener("htmx:afterSettle", (event) => { if ("djdt" in window) { window.djdt.init(); } }); </script>
Just make sure to put it in the header
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Using turbolinks everything works as expected on the first page load.
After transitioning to another page, all css/js/html is correctly loaded and created, but the djdt.init function bound to the DOMContentLoaded event doesn't fire (https://github.com/jazzband/django-debug-toolbar/blob/master/debug_toolbar/static/debug_toolbar/js/toolbar.js#L329) so click handlers and setup aren't initialized
The text was updated successfully, but these errors were encountered: