Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apiserver/plane/app/views/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,4 +186,6 @@
from .dashboard import (
DashboardEndpoint,
WidgetsEndpoint
)
)

from .error_404 import custom_404_view
5 changes: 5 additions & 0 deletions apiserver/plane/app/views/error_404.py
Original file line number Diff line number Diff line change
@@ -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)
1 change: 1 addition & 0 deletions apiserver/plane/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

from django.conf import settings

handler404 = "plane.app.views.error_404.custom_404_view"

urlpatterns = [
path("", TemplateView.as_view(template_name="index.html")),
Expand Down
Loading