prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Display the version number in the footer
  ![screen shot 2018-03-06 at 11 22 17](https://user-images.githubusercontent.com/1609292/37027086-a8dd8482-2130-11e8-8c72-939dae625a64.png)
  
  In the footer, next to "Available on github", we can display the version number from this file: https://github.com/kartoza/projecta/blob/develop/django_project/.version
  
  To be able to know between staging and production which version we are running
  
  Sentry is already reading this file: https://github.com/kartoza/projecta/blob/develop/django_project/core/settings/prod.py#L47
  
  </issue>
  <code>
  [start of django_project/lesson/templatetags/lesson_tags.py]
  1 # coding=utf-8
  2 """Custom tags for lesson app."""
  3 
  4 from django import template
  5 from django.utils.safestring import mark_safe
  6 
  7 register = template.Library()
  8 
  9 
  10 @register.filter(name='is_translation_up_to_date')
  11 def is_translation_up_to_date(value):
  12     if not value.is_translation_up_to_date:
  13         return mark_safe(
  14             '<span title="Translation is outdated"><sup>&#x2757;</sup></span>')
  15     else:
  16         return mark_safe('')
  17
  [end of django_project/lesson/templatetags/lesson_tags.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/django_project/lesson/templatetags/lesson_tags.py b/django_project/lesson/templatetags/lesson_tags.py
  --- a/django_project/lesson/templatetags/lesson_tags.py
  +++ b/django_project/lesson/templatetags/lesson_tags.py
  @@ -1,8 +1,9 @@
   # coding=utf-8
   """Custom tags for lesson app."""
  -
   from django import template
   from django.utils.safestring import mark_safe
  +from core.settings.utils import absolute_path
  +
   
   register = template.Library()
   
  @@ -14,3 +15,16 @@
               '<span title="Translation is outdated"><sup>&#x2757;</sup></span>')
       else:
           return mark_safe('')
  +
  +
  +@register.simple_tag(takes_context=True)
  +def version_tag(context):
  +    """Reads current project release from the .version file."""
  +    version_file = absolute_path('.version')
  +    try:
  +        with open(version_file, 'r') as file:
  +            version = file.read()
  +            context['version'] = version
  +    except IOError:
  +        context['version'] = 'Unknown'
  +    return context['version']
  
verification_info: {"golden_diff": "diff --git a/django_project/lesson/templatetags/lesson_tags.py b/django_project/lesson/templatetags/lesson_tags.py\n--- a/django_project/lesson/templatetags/lesson_tags.py\n+++ b/django_project/lesson/templatetags/lesson_tags.py\n@@ -1,8 +1,9 @@\n # coding=utf-8\n \"\"\"Custom tags for lesson app.\"\"\"\n-\n from django import template\n from django.utils.safestring import mark_safe\n+from core.settings.utils import absolute_path\n+\n \n register = template.Library()\n \n@@ -14,3 +15,16 @@\n             '<span title=\"Translation is outdated\"><sup>&#x2757;</sup></span>')\n     else:\n         return mark_safe('')\n+\n+\n+@register.simple_tag(takes_context=True)\n+def version_tag(context):\n+    \"\"\"Reads current project release from the .version file.\"\"\"\n+    version_file = absolute_path('.version')\n+    try:\n+        with open(version_file, 'r') as file:\n+            version = file.read()\n+            context['version'] = version\n+    except IOError:\n+        context['version'] = 'Unknown'\n+    return context['version']\n", "issue": "Display the version number in the footer\n![screen shot 2018-03-06 at 11 22 17](https://user-images.githubusercontent.com/1609292/37027086-a8dd8482-2130-11e8-8c72-939dae625a64.png)\r\n\r\nIn the footer, next to \"Available on github\", we can display the version number from this file: https://github.com/kartoza/projecta/blob/develop/django_project/.version\r\n\r\nTo be able to know between staging and production which version we are running\r\n\r\nSentry is already reading this file: https://github.com/kartoza/projecta/blob/develop/django_project/core/settings/prod.py#L47\n", "before_files": [{"content": "# coding=utf-8\n\"\"\"Custom tags for lesson app.\"\"\"\n\nfrom django import template\nfrom django.utils.safestring import mark_safe\n\nregister = template.Library()\n\n\n@register.filter(name='is_translation_up_to_date')\ndef is_translation_up_to_date(value):\n    if not value.is_translation_up_to_date:\n        return mark_safe(\n            '<span title=\"Translation is outdated\"><sup>&#x2757;</sup></span>')\n    else:\n        return mark_safe('')\n", "path": "django_project/lesson/templatetags/lesson_tags.py"}]}