-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Script loading failure from djdt 3.0 #1336
Comments
Hi @tari Thanks for the report. This sounds like an issue with Django or even with your development environment, and is probably not specific to django-debug-toolbar? I just checked and the runserver in my current project delivers JS with the correct |
Seems like it's Windows-specific, since I can't reproduce this on Linux (Python 3.8 for both). I guess it's related to where |
So Python loads MIME types from the registry ( It looks like there's no MIME type configured in Windows by default, since there isn't a I'm not sure what (if anything) could be done about this, since it's a deep platform issue. I also found an old Go bug around the same problem. I can fix it on this machine by setting |
I think that the Django maintainers may be sympathetic towards adding some code to work around limitations when developing on Windows. I think you should open a ticket at https://code.djangoproject.com/ticket/ (I checked and didn't find an existing ticket) and propose a code change in Django itself. My current thinking is that we shouldn't add code to django-debug-toolbar to fix this. It should be fixed, but not in django-debug-toolbar. |
Sounds reasonable. I've filed Django ticket #32041 about this so I'll close this issue and reopen if I think it warrants further discussion here later. |
I've seen that the Django ticket has been closed as well. I understand the argument raised by Mariusz, it's the same argument for not fixing it in django-debug-toolbar after all. JavaScript not working by default on Windows when served by the Django development server is really unfriendly to beginners though, so – if you want to – you could raise the issue on the django-developers mailing list or in the forum if you prefer that, arguing that (By the way, I'm working on Windows right now too, but inside WSL/2, so I'm sympathetic but not affected directly.) |
That's rather frustrating. I've solicited opinions on working around the problem (it's Windows at fault here!) on the mailing list. Seems like it may have been held for moderation since I don't see it on the web yet. I appreciate the moral support. 😃 |
Yes that may happen. Hopefully moderators will clear your message soon :) |
The documentation patch has landed in Django, yay :) django/django@f87b0ec |
Hi.Sorry for asking. How exactly you fixed this with that stackowerflowanswer. Could you please provide a code snippet? |
I edited the registry as described in my own answer: set |
Thanks, works for me |
Hi, apologies for not complying with the Q&A guidelines here. Also edited the registry key as in the image below, but still cannot get the toolbar to show up. Any possibility of solving this? Edit: Ignore the content type in the meta tag in the image background. Was trying somthing... |
Using Django 3.1, I've fount that django-debug-toolbar>=3.0 fails to load scripts and the toolbar doesn't show up at all when running a local development server (
manage.py runserver
).Firefox (81.0) has this error message in the console, and Chrome 87 seems to have the same issue:
I can work around it by setting the MIME type for .js files manually, but it seems like this should either be documented or automatically worked around.
The text was updated successfully, but these errors were encountered: