prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Add code to manage.py to create necessesary symlinks to run web app locally 
  In order to run the JWQL web app locally, one must create symbolic links to the `outputs`, `thumbnails`, `preview_images`, and `filesystem` directories.  We can add some code in `website.manage.py` in order to do this automatically.  Something like this:
  
  
  ```python
  from jwql.utils.utils import get_config()
  
  if __name__ == "__main__":
  
      os.environ.setdefault("DJANGO_SETTINGS_MODULE", "jwql_proj.settings")
  
      # Create symbolic links here (if they don't already exist)
      for directory in ['filesystem', 'outputs', 'preview_image_filesystem', 'thumbnails_filesystem']:
          path = get_config()[directory]
          # code to create symlink
  
      try:
          from django.core.management import execute_from_command_line
      except ImportError as exc:
          raise ImportError(
              "Couldn't import Django. Are you sure it's installed and "
              "available on your PYTHONPATH environment variable? Did you "
              "forget to activate a virtual environment?"
          ) from exc
      execute_from_command_line(sys.argv)
  ```
  
  Credit @york-stsci for the suggestion!
  
  </issue>
  <code>
  [start of jwql/website/manage.py]
  1 #! /usr/bin/env python
  2 
  3 """Utility module for administrative tasks.
  4 
  5 A python script version of Django's command-line utility for
  6 administrative tasks (``django-admin``). Additionally, puts the project
  7 package on ``sys.path`` and defines the ``DJANGO_SETTINGS_MODULE``
  8 variable to point to the jwql ``settings.py`` file.
  9 
  10 Generated by ``django-admin startproject`` using Django 2.0.1.
  11 
  12 Use
  13 ---
  14 
  15     To run the web app server:
  16     ::
  17 
  18         python manage.py runserver
  19 
  20     To start the interactive shellL:
  21     ::
  22 
  23         python manage.py shell
  24 
  25     To run tests for all installed apps:
  26     ::
  27 
  28         python manage.py test
  29 
  30 References
  31 ----------
  32 For more information please see:
  33     ``https://docs.djangoproject.com/en/2.0/ref/django-admin/``
  34 """
  35 
  36 import os
  37 import sys
  38 
  39 if __name__ == "__main__":
  40 
  41     os.environ.setdefault("DJANGO_SETTINGS_MODULE", "jwql_proj.settings")
  42 
  43     try:
  44         from django.core.management import execute_from_command_line
  45     except ImportError as exc:
  46         raise ImportError(
  47             "Couldn't import Django. Are you sure it's installed and "
  48             "available on your PYTHONPATH environment variable? Did you "
  49             "forget to activate a virtual environment?"
  50         ) from exc
  51     execute_from_command_line(sys.argv)
  52
  [end of jwql/website/manage.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/jwql/website/manage.py b/jwql/website/manage.py
  --- a/jwql/website/manage.py
  +++ b/jwql/website/manage.py
  @@ -36,10 +36,25 @@
   import os
   import sys
   
  +from jwql.utils.utils import get_config
  +
   if __name__ == "__main__":
   
       os.environ.setdefault("DJANGO_SETTINGS_MODULE", "jwql_proj.settings")
   
  +    directory_mapping = {
  +        'filesystem': 'filesystem',
  +        'outputs': 'outputs',
  +        'preview_image_filesystem': 'preview_images',
  +        'thumbnail_filesystem': 'thumbnails'
  +        }
  +
  +    for directory in ['filesystem', 'outputs', 'preview_image_filesystem', 'thumbnail_filesystem']:
  +        symlink_location = os.path.join(os.path.dirname(__file__), 'apps', 'jwql', 'static', directory_mapping[directory])
  +        if not os.path.exists(symlink_location):
  +            symlink_path = get_config()[directory]
  +            os.symlink(symlink_path, symlink_location)
  +
       try:
           from django.core.management import execute_from_command_line
       except ImportError as exc:
  
verification_info: {"golden_diff": "diff --git a/jwql/website/manage.py b/jwql/website/manage.py\n--- a/jwql/website/manage.py\n+++ b/jwql/website/manage.py\n@@ -36,10 +36,25 @@\n import os\n import sys\n \n+from jwql.utils.utils import get_config\n+\n if __name__ == \"__main__\":\n \n     os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"jwql_proj.settings\")\n \n+    directory_mapping = {\n+        'filesystem': 'filesystem',\n+        'outputs': 'outputs',\n+        'preview_image_filesystem': 'preview_images',\n+        'thumbnail_filesystem': 'thumbnails'\n+        }\n+\n+    for directory in ['filesystem', 'outputs', 'preview_image_filesystem', 'thumbnail_filesystem']:\n+        symlink_location = os.path.join(os.path.dirname(__file__), 'apps', 'jwql', 'static', directory_mapping[directory])\n+        if not os.path.exists(symlink_location):\n+            symlink_path = get_config()[directory]\n+            os.symlink(symlink_path, symlink_location)\n+\n     try:\n         from django.core.management import execute_from_command_line\n     except ImportError as exc:\n", "issue": "Add code to manage.py to create necessesary symlinks to run web app locally \nIn order to run the JWQL web app locally, one must create symbolic links to the `outputs`, `thumbnails`, `preview_images`, and `filesystem` directories.  We can add some code in `website.manage.py` in order to do this automatically.  Something like this:\r\n\r\n\r\n```python\r\nfrom jwql.utils.utils import get_config()\r\n\r\nif __name__ == \"__main__\":\r\n\r\n    os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"jwql_proj.settings\")\r\n\r\n    # Create symbolic links here (if they don't already exist)\r\n    for directory in ['filesystem', 'outputs', 'preview_image_filesystem', 'thumbnails_filesystem']:\r\n        path = get_config()[directory]\r\n        # code to create symlink\r\n\r\n    try:\r\n        from django.core.management import execute_from_command_line\r\n    except ImportError as exc:\r\n        raise ImportError(\r\n            \"Couldn't import Django. Are you sure it's installed and \"\r\n            \"available on your PYTHONPATH environment variable? Did you \"\r\n            \"forget to activate a virtual environment?\"\r\n        ) from exc\r\n    execute_from_command_line(sys.argv)\r\n```\r\n\r\nCredit @york-stsci for the suggestion!\n", "before_files": [{"content": "#! /usr/bin/env python\n\n\"\"\"Utility module for administrative tasks.\n\nA python script version of Django's command-line utility for\nadministrative tasks (``django-admin``). Additionally, puts the project\npackage on ``sys.path`` and defines the ``DJANGO_SETTINGS_MODULE``\nvariable to point to the jwql ``settings.py`` file.\n\nGenerated by ``django-admin startproject`` using Django 2.0.1.\n\nUse\n---\n\n    To run the web app server:\n    ::\n\n        python manage.py runserver\n\n    To start the interactive shellL:\n    ::\n\n        python manage.py shell\n\n    To run tests for all installed apps:\n    ::\n\n        python manage.py test\n\nReferences\n----------\nFor more information please see:\n    ``https://docs.djangoproject.com/en/2.0/ref/django-admin/``\n\"\"\"\n\nimport os\nimport sys\n\nif __name__ == \"__main__\":\n\n    os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"jwql_proj.settings\")\n\n    try:\n        from django.core.management import execute_from_command_line\n    except ImportError as exc:\n        raise ImportError(\n            \"Couldn't import Django. Are you sure it's installed and \"\n            \"available on your PYTHONPATH environment variable? Did you \"\n            \"forget to activate a virtual environment?\"\n        ) from exc\n    execute_from_command_line(sys.argv)\n", "path": "jwql/website/manage.py"}]}