prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  portal API not working anymore
  **Describe the bug**
  When trying to access the following URLs:
  /api/lastconnectedsince/YYYY/MM/DD
  .../registered/YYYY/MM/DD
  .../userspercountry/CC
  On any of our servers, we get a 500 error.
  Google console says: 
  
  > TemplateSyntaxError: 'url' is not a valid tag or filter in tag library 'future'
  
  It happens even with the right to access them.
  
  **To Reproduce**
  If you have an authorised google account, go to https://www.codeforlife.education/api/lastconnectedsince/2018/07/20/ and you will see a 500 error
  
  **Expected behaviour**
  This page to display a number when your google account is autorised
  
  **Desktop (please complete the following information):**
  
  - OS:Ubuntu 16.04
  - Browser:Chrome
   
  **Additional context**
  The urls.py file has been reworked for forward compatibility
  
  </issue>
  <code>
  [start of setup.py]
  1 # -*- coding: utf-8 -*-
  2 from setuptools import find_packages, setup
  3 import versioneer
  4 setup(name='codeforlife-portal',
  5       cmdclass=versioneer.get_cmdclass(),
  6       version=versioneer.get_version(),
  7       packages=find_packages(),
  8       include_package_data=True,
  9       install_requires=[
  10           'django==1.9.13',
  11           'django-appconf==1.0.1',
  12           'django-countries==3.4.1',
  13           'djangorestframework==3.1.3',
  14           'django-jquery==1.9.1',
  15           'django-autoconfig==0.8.0',
  16           'django-pipeline==1.5.4',
  17           'django-recaptcha==1.3.1',  # 1.4 dropped support for < 1.11
  18 
  19           'pyyaml==3.10',
  20           'rapid-router >= 1.0.0.post.dev1',
  21           'six==1.11.0',
  22           'aimmo',
  23           'docutils==0.12',
  24           'reportlab==3.2.0',
  25           'postcodes==0.1',
  26           'django-formtools==1.0',
  27           'django-two-factor-auth==1.5.0',
  28           'urllib3==1.22',
  29           'requests==2.18.4',
  30 
  31           'django-classy-tags==0.6.1',
  32           'django-treebeard==4.3',
  33           'django-sekizai==0.10.0',
  34 
  35           'django-online-status==0.1.0',
  36 
  37           'Pillow==3.3.2',
  38           'django-reversion==2.0.0',
  39           'sqlparse',
  40           'libsass',
  41           'django-forms-bootstrap'
  42       ],
  43       tests_require=[
  44           'django-setuptest==0.2.1',
  45           'django-selenium-clean==0.3.0',
  46           'responses==0.4.0',
  47           'selenium==2.48.0',
  48       ],
  49       test_suite='setuptest.setuptest.SetupTestSuite',
  50       zip_safe=False,
  51       )
  52
  [end of setup.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/setup.py b/setup.py
  --- a/setup.py
  +++ b/setup.py
  @@ -10,7 +10,7 @@
             'django==1.9.13',
             'django-appconf==1.0.1',
             'django-countries==3.4.1',
  -          'djangorestframework==3.1.3',
  +          'djangorestframework==3.2.3',
             'django-jquery==1.9.1',
             'django-autoconfig==0.8.0',
             'django-pipeline==1.5.4',
  
verification_info: {"golden_diff": "diff --git a/setup.py b/setup.py\n--- a/setup.py\n+++ b/setup.py\n@@ -10,7 +10,7 @@\n           'django==1.9.13',\n           'django-appconf==1.0.1',\n           'django-countries==3.4.1',\n-          'djangorestframework==3.1.3',\n+          'djangorestframework==3.2.3',\n           'django-jquery==1.9.1',\n           'django-autoconfig==0.8.0',\n           'django-pipeline==1.5.4',\n", "issue": "portal API not working anymore\n**Describe the bug**\r\nWhen trying to access the following URLs:\r\n/api/lastconnectedsince/YYYY/MM/DD\r\n.../registered/YYYY/MM/DD\r\n.../userspercountry/CC\r\nOn any of our servers, we get a 500 error.\r\nGoogle console says: \r\n\r\n> TemplateSyntaxError: 'url' is not a valid tag or filter in tag library 'future'\r\n\r\nIt happens even with the right to access them.\r\n\r\n**To Reproduce**\r\nIf you have an authorised google account, go to https://www.codeforlife.education/api/lastconnectedsince/2018/07/20/ and you will see a 500 error\r\n\r\n**Expected behaviour**\r\nThis page to display a number when your google account is autorised\r\n\r\n**Desktop (please complete the following information):**\r\n\r\n- OS:Ubuntu 16.04\r\n- Browser:Chrome\r\n \r\n**Additional context**\r\nThe urls.py file has been reworked for forward compatibility\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\nfrom setuptools import find_packages, setup\nimport versioneer\nsetup(name='codeforlife-portal',\n      cmdclass=versioneer.get_cmdclass(),\n      version=versioneer.get_version(),\n      packages=find_packages(),\n      include_package_data=True,\n      install_requires=[\n          'django==1.9.13',\n          'django-appconf==1.0.1',\n          'django-countries==3.4.1',\n          'djangorestframework==3.1.3',\n          'django-jquery==1.9.1',\n          'django-autoconfig==0.8.0',\n          'django-pipeline==1.5.4',\n          'django-recaptcha==1.3.1',  # 1.4 dropped support for < 1.11\n\n          'pyyaml==3.10',\n          'rapid-router >= 1.0.0.post.dev1',\n          'six==1.11.0',\n          'aimmo',\n          'docutils==0.12',\n          'reportlab==3.2.0',\n          'postcodes==0.1',\n          'django-formtools==1.0',\n          'django-two-factor-auth==1.5.0',\n          'urllib3==1.22',\n          'requests==2.18.4',\n\n          'django-classy-tags==0.6.1',\n          'django-treebeard==4.3',\n          'django-sekizai==0.10.0',\n\n          'django-online-status==0.1.0',\n\n          'Pillow==3.3.2',\n          'django-reversion==2.0.0',\n          'sqlparse',\n          'libsass',\n          'django-forms-bootstrap'\n      ],\n      tests_require=[\n          'django-setuptest==0.2.1',\n          'django-selenium-clean==0.3.0',\n          'responses==0.4.0',\n          'selenium==2.48.0',\n      ],\n      test_suite='setuptest.setuptest.SetupTestSuite',\n      zip_safe=False,\n      )\n", "path": "setup.py"}]}