Answer the question
In order to leave comments, you need to log in
Django debug toolbar not showing up?
Hello, please help. Django-debug-toolbar not showing up on site:
Code in:
urls.py:
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('news.urls')),
]
if settings.DEBUG:
import debug_toolbar
urlpatterns = [
path('__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
DEBUG = True
INSTALLED_APPS = [
'django.contrib.staticfiles',
'debug_toolbar',
]
MIDDLEWARE = [
'debug_toolbar.middleware.DebugToolbarMiddleware',
]
STATIC_URL = '/static/'
INTERNAL_IPS = [
'127.0.0.1',
]
Answer the question
In order to leave comments, you need to log in
It turned out to fix in urls.py added "mimetypes.add_type("application/javascript", ".js", True)" - if someone knows what I fixed in this way, please respond.
Looks like this:
if settings.DEBUG:
import debug_toolbar
import mimetypes
mimetypes.add_type("application/javascript", ".js", True)
urlpatterns = [
path('__debug__/', include(debug_toolbar.urls)),
] + urlpatterns
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question