prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Django Debug Toolbar doesn't display in local Docker development environment
  Created from work in #193.
  
  </issue>
  <code>
  [start of csunplugged/config/settings/local.py]
  1 # -*- coding: utf-8 -*-
  2 """
  3 Django settings for local development environment.
  4 
  5 - Run in Debug mode
  6 - Add custom dev application
  7 - Add Django Debug Toolbar
  8 - Add django-extensions
  9 - Use console backend for emails
  10 """
  11 
  12 import socket
  13 import os
  14 from .base import *  # noqa: F403
  15 
  16 # DATABASE CONFIGURATION
  17 # ----------------------------------------------------------------------------
  18 # See: https://docs.djangoproject.com/en/dev/ref/settings/#databases
  19 DATABASES = {
  20     'default': env.db('DATABASE_URL'),  # noqa: F405
  21 }
  22 DATABASES['default']['ATOMIC_REQUESTS'] = True
  23 
  24 # DEBUG
  25 # ----------------------------------------------------------------------------
  26 DEBUG = env.bool('DJANGO_DEBUG', default=True)  # noqa: F405
  27 TEMPLATES[0]['OPTIONS']['debug'] = DEBUG  # noqa: F405
  28 
  29 # SECRET CONFIGURATION
  30 # ----------------------------------------------------------------------------
  31 # See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
  32 # Note: This key only used for development and testing.
  33 SECRET_KEY = env('DJANGO_SECRET_KEY', default='l@@)w&&%&u37+sjz^lsx^+29y_333oid3ygxzucar^8o(axo*f')  # noqa: F405
  34 
  35 # Mail settings
  36 # ----------------------------------------------------------------------------
  37 
  38 EMAIL_PORT = 1025
  39 
  40 EMAIL_HOST = 'localhost'
  41 EMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend')  # noqa: F405
  42 
  43 
  44 # CACHING
  45 # ----------------------------------------------------------------------------
  46 CACHES = {
  47     'default': {
  48         'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
  49         'LOCATION': ''
  50     }
  51 }
  52 
  53 # django-debug-toolbar
  54 # ----------------------------------------------------------------------------
  55 MIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware', ]  # noqa: F405
  56 INSTALLED_APPS += ['debug_toolbar', ]  # noqa: F405
  57 
  58 INTERNAL_IPS = ['127.0.0.1', '10.0.2.2', ]
  59 # tricks to have debug toolbar when developing with docker
  60 if os.environ.get('USE_DOCKER') == 'yes':
  61     ip = socket.gethostbyname(socket.gethostname())
  62     INTERNAL_IPS += [ip[:-1] + '1']
  63 
  64 DEBUG_TOOLBAR_CONFIG = {
  65     'DISABLE_PANELS': [
  66         'debug_toolbar.panels.redirects.RedirectsPanel',
  67     ],
  68     'SHOW_TEMPLATE_CONTEXT': True,
  69 }
  70 
  71 # django-extensions
  72 # ----------------------------------------------------------------------------
  73 INSTALLED_APPS += ['django_extensions', ]
  74 
  75 # TESTING
  76 # ----------------------------------------------------------------------------
  77 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
  78 
  79 
  80 # Your local stuff: Below this line define 3rd party library settings
  81 # ----------------------------------------------------------------------------
  82 LOCAL_APPS + ['dev.apps.DevConfig']  # noqa: F405
  83
  [end of csunplugged/config/settings/local.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/csunplugged/config/settings/local.py b/csunplugged/config/settings/local.py
  --- a/csunplugged/config/settings/local.py
  +++ b/csunplugged/config/settings/local.py
  @@ -9,8 +9,6 @@
   - Use console backend for emails
   """
   
  -import socket
  -import os
   from .base import *  # noqa: F403
   
   # DATABASE CONFIGURATION
  @@ -56,16 +54,23 @@
   INSTALLED_APPS += ['debug_toolbar', ]  # noqa: F405
   
   INTERNAL_IPS = ['127.0.0.1', '10.0.2.2', ]
  -# tricks to have debug toolbar when developing with docker
  -if os.environ.get('USE_DOCKER') == 'yes':
  -    ip = socket.gethostbyname(socket.gethostname())
  -    INTERNAL_IPS += [ip[:-1] + '1']
  +
  +
  +def show_django_debug_toolbar(request):
  +    """Show Django Debug Toolbar in every request when running locally.
  +
  +    Args:
  +        request: The request object.
  +    """
  +    return True
  +
   
   DEBUG_TOOLBAR_CONFIG = {
       'DISABLE_PANELS': [
           'debug_toolbar.panels.redirects.RedirectsPanel',
       ],
       'SHOW_TEMPLATE_CONTEXT': True,
  +    "SHOW_TOOLBAR_CALLBACK": show_django_debug_toolbar,
   }
   
   # django-extensions
  @@ -79,4 +84,4 @@
   
   # Your local stuff: Below this line define 3rd party library settings
   # ----------------------------------------------------------------------------
  -LOCAL_APPS + ['dev.apps.DevConfig']  # noqa: F405
  +INSTALLED_APPS += ['dev.apps.DevConfig']  # noqa: F405
  
verification_info: {"golden_diff": "diff --git a/csunplugged/config/settings/local.py b/csunplugged/config/settings/local.py\n--- a/csunplugged/config/settings/local.py\n+++ b/csunplugged/config/settings/local.py\n@@ -9,8 +9,6 @@\n - Use console backend for emails\n \"\"\"\n \n-import socket\n-import os\n from .base import *  # noqa: F403\n \n # DATABASE CONFIGURATION\n@@ -56,16 +54,23 @@\n INSTALLED_APPS += ['debug_toolbar', ]  # noqa: F405\n \n INTERNAL_IPS = ['127.0.0.1', '10.0.2.2', ]\n-# tricks to have debug toolbar when developing with docker\n-if os.environ.get('USE_DOCKER') == 'yes':\n-    ip = socket.gethostbyname(socket.gethostname())\n-    INTERNAL_IPS += [ip[:-1] + '1']\n+\n+\n+def show_django_debug_toolbar(request):\n+    \"\"\"Show Django Debug Toolbar in every request when running locally.\n+\n+    Args:\n+        request: The request object.\n+    \"\"\"\n+    return True\n+\n \n DEBUG_TOOLBAR_CONFIG = {\n     'DISABLE_PANELS': [\n         'debug_toolbar.panels.redirects.RedirectsPanel',\n     ],\n     'SHOW_TEMPLATE_CONTEXT': True,\n+    \"SHOW_TOOLBAR_CALLBACK\": show_django_debug_toolbar,\n }\n \n # django-extensions\n@@ -79,4 +84,4 @@\n \n # Your local stuff: Below this line define 3rd party library settings\n # ----------------------------------------------------------------------------\n-LOCAL_APPS + ['dev.apps.DevConfig']  # noqa: F405\n+INSTALLED_APPS += ['dev.apps.DevConfig']  # noqa: F405\n", "issue": "Django Debug Toolbar doesn't display in local Docker development environment\nCreated from work in #193.\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n\"\"\"\nDjango settings for local development environment.\n\n- Run in Debug mode\n- Add custom dev application\n- Add Django Debug Toolbar\n- Add django-extensions\n- Use console backend for emails\n\"\"\"\n\nimport socket\nimport os\nfrom .base import *  # noqa: F403\n\n# DATABASE CONFIGURATION\n# ----------------------------------------------------------------------------\n# See: https://docs.djangoproject.com/en/dev/ref/settings/#databases\nDATABASES = {\n    'default': env.db('DATABASE_URL'),  # noqa: F405\n}\nDATABASES['default']['ATOMIC_REQUESTS'] = True\n\n# DEBUG\n# ----------------------------------------------------------------------------\nDEBUG = env.bool('DJANGO_DEBUG', default=True)  # noqa: F405\nTEMPLATES[0]['OPTIONS']['debug'] = DEBUG  # noqa: F405\n\n# SECRET CONFIGURATION\n# ----------------------------------------------------------------------------\n# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key\n# Note: This key only used for development and testing.\nSECRET_KEY = env('DJANGO_SECRET_KEY', default='l@@)w&&%&u37+sjz^lsx^+29y_333oid3ygxzucar^8o(axo*f')  # noqa: F405\n\n# Mail settings\n# ----------------------------------------------------------------------------\n\nEMAIL_PORT = 1025\n\nEMAIL_HOST = 'localhost'\nEMAIL_BACKEND = env('DJANGO_EMAIL_BACKEND', default='django.core.mail.backends.console.EmailBackend')  # noqa: F405\n\n\n# CACHING\n# ----------------------------------------------------------------------------\nCACHES = {\n    'default': {\n        'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',\n        'LOCATION': ''\n    }\n}\n\n# django-debug-toolbar\n# ----------------------------------------------------------------------------\nMIDDLEWARE += ['debug_toolbar.middleware.DebugToolbarMiddleware', ]  # noqa: F405\nINSTALLED_APPS += ['debug_toolbar', ]  # noqa: F405\n\nINTERNAL_IPS = ['127.0.0.1', '10.0.2.2', ]\n# tricks to have debug toolbar when developing with docker\nif os.environ.get('USE_DOCKER') == 'yes':\n    ip = socket.gethostbyname(socket.gethostname())\n    INTERNAL_IPS += [ip[:-1] + '1']\n\nDEBUG_TOOLBAR_CONFIG = {\n    'DISABLE_PANELS': [\n        'debug_toolbar.panels.redirects.RedirectsPanel',\n    ],\n    'SHOW_TEMPLATE_CONTEXT': True,\n}\n\n# django-extensions\n# ----------------------------------------------------------------------------\nINSTALLED_APPS += ['django_extensions', ]\n\n# TESTING\n# ----------------------------------------------------------------------------\nTEST_RUNNER = 'django.test.runner.DiscoverRunner'\n\n\n# Your local stuff: Below this line define 3rd party library settings\n# ----------------------------------------------------------------------------\nLOCAL_APPS + ['dev.apps.DevConfig']  # noqa: F405\n", "path": "csunplugged/config/settings/local.py"}]}