Issue
the toolbar shows nice and clean, but when i click on a panel to see if it really works, it gives me a 404: Not Found error. I have checked lots of answers and etc but they were from really old versions and i'm afraid i missed some important changelog.
my urls.py
import debug_toolbar
from django.conf import settings
from django.urls import include, path
from django.contrib import admin
from django.urls import path
from wagtail.admin import urls as wagtailadmin_urls
from wagtail.core import urls as wagtail_urls
from wagtail.documents import urls as wagtaildocs_urls
from search import views as search_views
urlpatterns = [
path('django-admin/', admin.site.urls),
path('admin/', include(wagtailadmin_urls)),
path('documents/', include(wagtaildocs_urls)),
path('search/', search_views.search, name='search'),
]
urlpatterns = urlpatterns + [
path("", include(wagtail_urls)),
path('__debug__/', include(debug_toolbar.urls)),
]
if settings.DEBUG:
from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
and my dev.py
from .base import *
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'hidden'
# SECURITY WARNING: define the correct hosts in production!
ALLOWED_HOSTS = ['*']
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
INSTALLED_APPS = INSTALLED_APPS + [
'debug_toolbar'
]
MIDDLEWARE = MIDDLEWARE + [
'debug_toolbar.middleware.DebugToolbarMiddleware',
]
INTERNAL_IPS = ("127.0.0.1")
try:
from .local import *
except ImportError:
pass
i'm following this video tutorial for it https://youtu.be/jxUeJsR_XSs?list=PLMQHMcNi6ocsS8Bfnuy_IDgJ4bHRRrvub
EDIT: i fixed it by putting
path('__debug__/', include(debug_toolbar.urls)),
in my urlpatterns function at urls.py
Solution
EDIT: i fixed it by putting
path('__debug__/', include(debug_toolbar.urls)),
in my urlpatterns function at urls.py
Answered By - pedro henrique garcia pinto
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.