6
This code I placed at the bottom of settings and solved my problems:
settings.py
import mimetypes
mimetypes.add_type("application/javascript", ".js", True)
DEBUG_TOOLBAR_PATCH_SETTINGS = False
def show_toolbar(request):
return True
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
"SHOW_TOOLBAR_CALLBACK": show_toolbar,
'INSERT_BEFORE': '</head>',
'INTERCEPT_REDIRECTS': False,
'RENDER_PANELS': True,
}
Another problem I have got it was no debug_tolbar/css files in my_project/static/ file. Collectstatic did not solve my problem.
Solution: I have copied from: python3.8/site-packages/debug_toolbar/static/debug_toolbar/css/ to my_project/static/debug_toolbar/css/
2
I had the same issue with application django debug toolbar
In settings.py, everything is correctly, but the application did not showing in the browser.
If you look by the inspect mode, you could see a javascript error because he sees it as text and not as js code.
Solution:
In the registry Editor ("Ctrl+r" "regedit") find HKEY_CLASSES_ROOT.js
then dubble click on the "Content Type" the "Value data" should be "text/javascript"
Then restart server "python manage.py runserver", remove cookies of your browser and that’s all.
At the worst restart your machine.
- [Django]-Django ManyToMany field returns None but it has related records
- [Django]-How to make DRF serializer compatible with uppercase
0
Try to add in your settings.py
:
import socket
hostname, _, ips = socket.gethostbyname_ex(socket.gethostname())
INTERNAL_IPS = [ip[:-1] + "1" for ip in ips]