prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Disabling webclient does not actually disable it
  #### Steps to reproduce the issue / Reasons for adding feature:
  
  1. Set WEBCLIENT_ENABLED to False
  2. Link disappears from index page
  3. Go to http://example.com/webclient
  4. Webclient loads.
  
  #### Error output / Expected result of feature
  Setting WEBCLIENT_ENABLED to False should disable it, not hide it.
  
  #### Extra information, such as Evennia revision/repo/branch, operating system and ideas for how to solve / implement:
  The status check needs to happen in urls.py, not just on the navbar template. If disabled, the url for the webclient should not be added to the list of urlpatterns.
  
  </issue>
  <code>
  [start of evennia/web/webclient/views.py]
  1 
  2 """
  3 This contains a simple view for rendering the webclient
  4 page and serve it eventual static content.
  5 
  6 """
  7 from __future__ import print_function
  8 from django.shortcuts import render
  9 from django.contrib.auth import login, authenticate
  10 
  11 from evennia.accounts.models import AccountDB
  12 from evennia.utils import logger
  13 
  14 
  15 def webclient(request):
  16     """
  17     Webclient page template loading.
  18 
  19     """
  20     # auto-login is now handled by evennia.web.utils.middleware
  21     
  22     # make sure to store the browser session's hash so the webclient can get to it!
  23     pagevars = {'browser_sessid': request.session.session_key}
  24 
  25     return render(request, 'webclient.html', pagevars)
  26
  [end of evennia/web/webclient/views.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/evennia/web/webclient/views.py b/evennia/web/webclient/views.py
  --- a/evennia/web/webclient/views.py
  +++ b/evennia/web/webclient/views.py
  @@ -5,6 +5,8 @@
   
   """
   from __future__ import print_function
  +from django.conf import settings
  +from django.http import Http404
   from django.shortcuts import render
   from django.contrib.auth import login, authenticate
   
  @@ -19,6 +21,10 @@
       """
       # auto-login is now handled by evennia.web.utils.middleware
       
  +    # check if webclient should be enabled
  +    if not settings.WEBCLIENT_ENABLED:
  +        raise Http404
  +    
       # make sure to store the browser session's hash so the webclient can get to it!
       pagevars = {'browser_sessid': request.session.session_key}
  
verification_info: {"golden_diff": "diff --git a/evennia/web/webclient/views.py b/evennia/web/webclient/views.py\n--- a/evennia/web/webclient/views.py\n+++ b/evennia/web/webclient/views.py\n@@ -5,6 +5,8 @@\n \n \"\"\"\n from __future__ import print_function\n+from django.conf import settings\n+from django.http import Http404\n from django.shortcuts import render\n from django.contrib.auth import login, authenticate\n \n@@ -19,6 +21,10 @@\n     \"\"\"\n     # auto-login is now handled by evennia.web.utils.middleware\n     \n+    # check if webclient should be enabled\n+    if not settings.WEBCLIENT_ENABLED:\n+        raise Http404\n+    \n     # make sure to store the browser session's hash so the webclient can get to it!\n     pagevars = {'browser_sessid': request.session.session_key}\n", "issue": "Disabling webclient does not actually disable it\n#### Steps to reproduce the issue / Reasons for adding feature:\r\n\r\n1. Set WEBCLIENT_ENABLED to False\r\n2. Link disappears from index page\r\n3. Go to http://example.com/webclient\r\n4. Webclient loads.\r\n\r\n#### Error output / Expected result of feature\r\nSetting WEBCLIENT_ENABLED to False should disable it, not hide it.\r\n\r\n#### Extra information, such as Evennia revision/repo/branch, operating system and ideas for how to solve / implement:\r\nThe status check needs to happen in urls.py, not just on the navbar template. If disabled, the url for the webclient should not be added to the list of urlpatterns.\n", "before_files": [{"content": "\n\"\"\"\nThis contains a simple view for rendering the webclient\npage and serve it eventual static content.\n\n\"\"\"\nfrom __future__ import print_function\nfrom django.shortcuts import render\nfrom django.contrib.auth import login, authenticate\n\nfrom evennia.accounts.models import AccountDB\nfrom evennia.utils import logger\n\n\ndef webclient(request):\n    \"\"\"\n    Webclient page template loading.\n\n    \"\"\"\n    # auto-login is now handled by evennia.web.utils.middleware\n    \n    # make sure to store the browser session's hash so the webclient can get to it!\n    pagevars = {'browser_sessid': request.session.session_key}\n\n    return render(request, 'webclient.html', pagevars)\n", "path": "evennia/web/webclient/views.py"}]}