Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-621] chore: 404 page not found (#3859)

Bavisetti Narayan4572b7378df0
diff --git a/apiserver/plane/app/views/__init__.py b/apiserver/plane/app/views/__init__.py
index 6af60ff9c1..910ea006d6 100644
--- a/apiserver/plane/app/views/__init__.py
+++ b/apiserver/plane/app/views/__init__.py
@@ -187,4 +187,6 @@ from .webhook import (
from .dashboard import (
DashboardEndpoint,
WidgetsEndpoint
-)
\ No newline at end of file
+)
+
+from .error_404 import custom_404_view
diff --git a/apiserver/plane/app/views/error_404.py b/apiserver/plane/app/views/error_404.py
new file mode 100644
index 0000000000..3c31474e0a
--- /dev/null
+++ b/apiserver/plane/app/views/error_404.py
@@ -0,0 +1,5 @@
+# views.py
+from django.http import JsonResponse
+
+def custom_404_view(request, exception=None):
+ return JsonResponse({"error": "Page not found."}, status=404)
diff --git a/apiserver/plane/urls.py b/apiserver/plane/urls.py
index 669f3ea73d..3b042ea1fa 100644
--- a/apiserver/plane/urls.py
+++ b/apiserver/plane/urls.py
@@ -7,6 +7,7 @@ from django.views.generic import TemplateView
from django.conf import settings
+handler404 = "plane.app.views.error_404.custom_404_view"
urlpatterns = [
path("", TemplateView.as_view(template_name="index.html")),