prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Server error page won't render because of missing context
  If a view throws a 500 error, the 500.html should get rendered. We recently updated the template to inherit from base.html, and now it will not render anymore because it is missing context variables (the 500 view is by default passed an empty context). 
  
  I'm unsure if we should update the 500 view and add the missing context or if we should go back to not inheriting from base.html for the error views? 
  
  
  
  </issue>
  <code>
  [start of app/config/urls/challenge_subdomain.py]
  1 from django.conf import settings
  2 from django.urls import include, path
  3 from django.views.generic import TemplateView
  4 
  5 from grandchallenge.challenges.views import ChallengeUpdate
  6 
  7 urlpatterns = [
  8     path(
  9         "robots.txt",
  10         TemplateView.as_view(
  11             template_name="robots.txt", content_type="text/plain"
  12         ),
  13         name="subdomain_robots_txt",
  14     ),
  15     path(
  16         "evaluation/",
  17         include("grandchallenge.evaluation.urls", namespace="evaluation"),
  18     ),
  19     path("teams/", include("grandchallenge.teams.urls", namespace="teams")),
  20     path(
  21         "participants/",
  22         include("grandchallenge.participants.urls", namespace="participants"),
  23     ),
  24     path("admins/", include("grandchallenge.admins.urls", namespace="admins")),
  25     path("update/", ChallengeUpdate.as_view(), name="challenge-update"),
  26     path("summernote/", include("django_summernote.urls")),
  27     path("", include("grandchallenge.pages.urls", namespace="pages")),
  28 ]
  29 
  30 if settings.DEBUG and settings.ENABLE_DEBUG_TOOLBAR:
  31     import debug_toolbar
  32 
  33     urlpatterns = [
  34         path("__debug__/", include(debug_toolbar.urls))
  35     ] + urlpatterns
  36
  [end of app/config/urls/challenge_subdomain.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/app/config/urls/challenge_subdomain.py b/app/config/urls/challenge_subdomain.py
  --- a/app/config/urls/challenge_subdomain.py
  +++ b/app/config/urls/challenge_subdomain.py
  @@ -4,6 +4,9 @@
   
   from grandchallenge.challenges.views import ChallengeUpdate
   
  +handler500 = "grandchallenge.core.views.handler500"
  +
  +
   urlpatterns = [
       path(
           "robots.txt",
  
verification_info: {"golden_diff": "diff --git a/app/config/urls/challenge_subdomain.py b/app/config/urls/challenge_subdomain.py\n--- a/app/config/urls/challenge_subdomain.py\n+++ b/app/config/urls/challenge_subdomain.py\n@@ -4,6 +4,9 @@\n \n from grandchallenge.challenges.views import ChallengeUpdate\n \n+handler500 = \"grandchallenge.core.views.handler500\"\n+\n+\n urlpatterns = [\n     path(\n         \"robots.txt\",\n", "issue": "Server error page won't render because of missing context\nIf a view throws a 500 error, the 500.html should get rendered. We recently updated the template to inherit from base.html, and now it will not render anymore because it is missing context variables (the 500 view is by default passed an empty context). \r\n\r\nI'm unsure if we should update the 500 view and add the missing context or if we should go back to not inheriting from base.html for the error views? \r\n\r\n\n", "before_files": [{"content": "from django.conf import settings\nfrom django.urls import include, path\nfrom django.views.generic import TemplateView\n\nfrom grandchallenge.challenges.views import ChallengeUpdate\n\nurlpatterns = [\n    path(\n        \"robots.txt\",\n        TemplateView.as_view(\n            template_name=\"robots.txt\", content_type=\"text/plain\"\n        ),\n        name=\"subdomain_robots_txt\",\n    ),\n    path(\n        \"evaluation/\",\n        include(\"grandchallenge.evaluation.urls\", namespace=\"evaluation\"),\n    ),\n    path(\"teams/\", include(\"grandchallenge.teams.urls\", namespace=\"teams\")),\n    path(\n        \"participants/\",\n        include(\"grandchallenge.participants.urls\", namespace=\"participants\"),\n    ),\n    path(\"admins/\", include(\"grandchallenge.admins.urls\", namespace=\"admins\")),\n    path(\"update/\", ChallengeUpdate.as_view(), name=\"challenge-update\"),\n    path(\"summernote/\", include(\"django_summernote.urls\")),\n    path(\"\", include(\"grandchallenge.pages.urls\", namespace=\"pages\")),\n]\n\nif settings.DEBUG and settings.ENABLE_DEBUG_TOOLBAR:\n    import debug_toolbar\n\n    urlpatterns = [\n        path(\"__debug__/\", include(debug_toolbar.urls))\n    ] + urlpatterns\n", "path": "app/config/urls/challenge_subdomain.py"}]}