We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[`Frontend`]  : Move code to specific `web-component`
https://github.com/baseplate-admin/CoreProject/blob/cd436b876f4936b61397a0cc838aa88125527a78/backend/django_core/templates/anime/index.html#L123-L205

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `backend/django_core/apps/pages/views/anime.py`
Content:
```
1 from typing import TYPE_CHECKING
2 
3 from django.http import HttpResponse
4 from django.shortcuts import render
5 
6 from ..data.anime import (
7     anime,
8     anime_episode,
9     icons,
10     latest_animes,
11     latest_episodes,
12     my_list,
13 )
14 
15 if TYPE_CHECKING:
16     from ..request import HtmxHttpRequest
17 
18 
19 async def anime_home_view_partial_slider_view(
20     request: "HtmxHttpRequest",
21     pk: int,
22 ) -> HttpResponse:
23     anime = latest_animes[pk]
24     next_index = (pk + 1) % len(latest_animes)
25     previous_index = (pk - 1) % len(latest_animes)
26 
27     return render(
28         request,
29         "anime/_slider.html",
30         context={
31             "anime": anime,
32             "next_index": next_index,
33             "previous_index": previous_index,
34             "current_index": pk,
35         },
36     )
37 
38 
39 async def anime_home_view(request: "HtmxHttpRequest") -> HttpResponse:
40     if request.htmx:
41         return render(
42             request,
43             "anime/index.html",
44             context={
45                 "latest_animes": latest_animes,
46                 "my_list": my_list,
47                 "latest_episodes": latest_episodes,
48             },
49         )
50 
51     return render(
52         request,
53         "anime/_layout.html",
54         context={
55             "icons": icons,
56             "latest_animes": latest_animes,
57             "my_list": my_list,
58             "latest_episodes": latest_episodes,
59         },
60     )
61 
62 
63 async def anime_explore_view(request: "HtmxHttpRequest") -> HttpResponse:
64     if request.htmx:
65         return render(request, "anime/explore/index.html")
66 
67     return render(request, "anime/_layout.html", context={"icons": icons})
68 
69 
70 async def anime_info_view(
71     request: "HtmxHttpRequest",
72     platform: str,
73     pk: int,
74 ) -> HttpResponse:
75     if request.htmx:
76         return render(
77             request,
78             "anime/info/index.html",
79             context={"anime": anime, "episode": anime_episode},
80         )
81 
82     return render(request, "anime/_layout.html", context={"icons": icons})
83 
84 
85 async def anime_episode_view(
86     request: "HtmxHttpRequest", platform: str, mal_id: int, pk: int
87 ) -> HttpResponse:
88     if request.htmx:
89         return render(
90             request,
91             "anime/episode/index.html",
92             context={},
93         )
94 
95     return render(request, "anime/_layout.html", context={"icons": icons})
96
```
--- 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/backend/django_core/apps/pages/views/anime.py b/backend/django_core/apps/pages/views/anime.py
--- a/backend/django_core/apps/pages/views/anime.py
+++ b/backend/django_core/apps/pages/views/anime.py
@@ -1,3 +1,4 @@
+import json
 from typing import TYPE_CHECKING
 
 from django.http import HttpResponse
@@ -37,6 +38,9 @@
 
 
 async def anime_home_view(request: "HtmxHttpRequest") -> HttpResponse:
+    # cant parse single quoted string
+    latest_episodes_json = json.dumps(latest_episodes)
+
     if request.htmx:
         return render(
             request,
@@ -44,7 +48,7 @@
             context={
                 "latest_animes": latest_animes,
                 "my_list": my_list,
-                "latest_episodes": latest_episodes,
+                "latest_episodes": latest_episodes_json,
             },
         )
 
@@ -55,7 +59,7 @@
             "icons": icons,
             "latest_animes": latest_animes,
             "my_list": my_list,
-            "latest_episodes": latest_episodes,
+            "latest_episodes": latest_episodes_json,
         },
     )

{"golden_diff": "diff --git a/backend/django_core/apps/pages/views/anime.py b/backend/django_core/apps/pages/views/anime.py\n--- a/backend/django_core/apps/pages/views/anime.py\n+++ b/backend/django_core/apps/pages/views/anime.py\n@@ -1,3 +1,4 @@\n+import json\n from typing import TYPE_CHECKING\n \n from django.http import HttpResponse\n@@ -37,6 +38,9 @@\n \n \n async def anime_home_view(request: \"HtmxHttpRequest\") -> HttpResponse:\n+    # cant parse single quoted string\n+    latest_episodes_json = json.dumps(latest_episodes)\n+\n     if request.htmx:\n         return render(\n             request,\n@@ -44,7 +48,7 @@\n             context={\n                 \"latest_animes\": latest_animes,\n                 \"my_list\": my_list,\n-                \"latest_episodes\": latest_episodes,\n+                \"latest_episodes\": latest_episodes_json,\n             },\n         )\n \n@@ -55,7 +59,7 @@\n             \"icons\": icons,\n             \"latest_animes\": latest_animes,\n             \"my_list\": my_list,\n-            \"latest_episodes\": latest_episodes,\n+            \"latest_episodes\": latest_episodes_json,\n         },\n     )\n", "issue": "[`Frontend`]  : Move code to specific `web-component`\nhttps://github.com/baseplate-admin/CoreProject/blob/cd436b876f4936b61397a0cc838aa88125527a78/backend/django_core/templates/anime/index.html#L123-L205\n", "before_files": [{"content": "from typing import TYPE_CHECKING\n\nfrom django.http import HttpResponse\nfrom django.shortcuts import render\n\nfrom ..data.anime import (\n    anime,\n    anime_episode,\n    icons,\n    latest_animes,\n    latest_episodes,\n    my_list,\n)\n\nif TYPE_CHECKING:\n    from ..request import HtmxHttpRequest\n\n\nasync def anime_home_view_partial_slider_view(\n    request: \"HtmxHttpRequest\",\n    pk: int,\n) -> HttpResponse:\n    anime = latest_animes[pk]\n    next_index = (pk + 1) % len(latest_animes)\n    previous_index = (pk - 1) % len(latest_animes)\n\n    return render(\n        request,\n        \"anime/_slider.html\",\n        context={\n            \"anime\": anime,\n            \"next_index\": next_index,\n            \"previous_index\": previous_index,\n            \"current_index\": pk,\n        },\n    )\n\n\nasync def anime_home_view(request: \"HtmxHttpRequest\") -> HttpResponse:\n    if request.htmx:\n        return render(\n            request,\n            \"anime/index.html\",\n            context={\n                \"latest_animes\": latest_animes,\n                \"my_list\": my_list,\n                \"latest_episodes\": latest_episodes,\n            },\n        )\n\n    return render(\n        request,\n        \"anime/_layout.html\",\n        context={\n            \"icons\": icons,\n            \"latest_animes\": latest_animes,\n            \"my_list\": my_list,\n            \"latest_episodes\": latest_episodes,\n        },\n    )\n\n\nasync def anime_explore_view(request: \"HtmxHttpRequest\") -> HttpResponse:\n    if request.htmx:\n        return render(request, \"anime/explore/index.html\")\n\n    return render(request, \"anime/_layout.html\", context={\"icons\": icons})\n\n\nasync def anime_info_view(\n    request: \"HtmxHttpRequest\",\n    platform: str,\n    pk: int,\n) -> HttpResponse:\n    if request.htmx:\n        return render(\n            request,\n            \"anime/info/index.html\",\n            context={\"anime\": anime, \"episode\": anime_episode},\n        )\n\n    return render(request, \"anime/_layout.html\", context={\"icons\": icons})\n\n\nasync def anime_episode_view(\n    request: \"HtmxHttpRequest\", platform: str, mal_id: int, pk: int\n) -> HttpResponse:\n    if request.htmx:\n        return render(\n            request,\n            \"anime/episode/index.html\",\n            context={},\n        )\n\n    return render(request, \"anime/_layout.html\", context={\"icons\": icons})\n", "path": "backend/django_core/apps/pages/views/anime.py"}], "after_files": [{"content": "import json\nfrom typing import TYPE_CHECKING\n\nfrom django.http import HttpResponse\nfrom django.shortcuts import render\n\nfrom ..data.anime import (\n    anime,\n    anime_episode,\n    icons,\n    latest_animes,\n    latest_episodes,\n    my_list,\n)\n\nif TYPE_CHECKING:\n    from ..request import HtmxHttpRequest\n\n\nasync def anime_home_view_partial_slider_view(\n    request: \"HtmxHttpRequest\",\n    pk: int,\n) -> HttpResponse:\n    anime = latest_animes[pk]\n    next_index = (pk + 1) % len(latest_animes)\n    previous_index = (pk - 1) % len(latest_animes)\n\n    return render(\n        request,\n        \"anime/_slider.html\",\n        context={\n            \"anime\": anime,\n            \"next_index\": next_index,\n            \"previous_index\": previous_index,\n            \"current_index\": pk,\n        },\n    )\n\n\nasync def anime_home_view(request: \"HtmxHttpRequest\") -> HttpResponse:\n    # cant parse single quoted string\n    latest_episodes_json = json.dumps(latest_episodes)\n\n    if request.htmx:\n        return render(\n            request,\n            \"anime/index.html\",\n            context={\n                \"latest_animes\": latest_animes,\n                \"my_list\": my_list,\n                \"latest_episodes\": latest_episodes_json,\n            },\n        )\n\n    return render(\n        request,\n        \"anime/_layout.html\",\n        context={\n            \"icons\": icons,\n            \"latest_animes\": latest_animes,\n            \"my_list\": my_list,\n            \"latest_episodes\": latest_episodes_json,\n        },\n    )\n\n\nasync def anime_explore_view(request: \"HtmxHttpRequest\") -> HttpResponse:\n    if request.htmx:\n        return render(request, \"anime/explore/index.html\")\n\n    return render(request, \"anime/_layout.html\", context={\"icons\": icons})\n\n\nasync def anime_info_view(\n    request: \"HtmxHttpRequest\",\n    platform: str,\n    pk: int,\n) -> HttpResponse:\n    if request.htmx:\n        return render(\n            request,\n            \"anime/info/index.html\",\n            context={\"anime\": anime, \"episode\": anime_episode},\n        )\n\n    return render(request, \"anime/_layout.html\", context={\"icons\": icons})\n\n\nasync def anime_episode_view(\n    request: \"HtmxHttpRequest\", platform: str, mal_id: int, pk: int\n) -> HttpResponse:\n    if request.htmx:\n        return render(\n            request,\n            \"anime/episode/index.html\",\n            context={},\n        )\n\n    return render(request, \"anime/_layout.html\", context={\"icons\": icons})\n", "path": "backend/django_core/apps/pages/views/anime.py"}]}