are there learning activities for django-debug-toolbar

  1. Install django-debug-toolbar:
pip install django-debug-toolbar
  1. Add 'debug_toolbar' to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
    # ...
    'debug_toolbar',
    # ...
]
  1. Add 'debug_toolbar.middleware.DebugToolbarMiddleware' to your MIDDLEWARE in settings.py:
MIDDLEWARE = [
    # ...
    'debug_toolbar.middleware.DebugToolbarMiddleware',
    # ...
]
  1. Configure the INTERNAL_IPS setting in settings.py:
INTERNAL_IPS = [
    # ...
    '127.0.0.1',
    # ...
]
  1. Configure the DEBUG_TOOLBAR_PANELS setting in settings.py to include desired panels:
DEBUG_TOOLBAR_PANELS = [
    # ...
    'debug_toolbar.panels.timer.TimerPanel',
    'debug_toolbar.panels.headers.HeadersPanel',
    # Add more panels as needed
    # ...
]
  1. (Optional) Configure other settings as needed, such as DEBUG_TOOLBAR_CONFIG:
DEBUG_TOOLBAR_CONFIG = {
    # ...
    'SHOW_TOOLBAR_CALLBACK': lambda request: True,
    # ...
}
  1. Include the toolbar URLs in your project's urls.py for the development environment:
if settings.DEBUG:
    import debug_toolbar

    urlpatterns = [
        # ...
        path('__debug__/', include(debug_toolbar.urls)),
        # ...
    ] + urlpatterns
  1. Run your Django development server:
python manage.py runserver
  1. Access your application in a web browser, and you should see the debug toolbar.

  2. Explore the debug toolbar panels to analyze various aspects of your Django application's performance and behavior.