We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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!

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `jwql/website/manage.py`
Content:
```
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 FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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:

{"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"}], "after_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\nfrom jwql.utils.utils import get_config\n\nif __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        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"}]}