diff --git a/backend/urls.py b/backend/urls.py index 35c0306..a4a3145 100644 --- a/backend/urls.py +++ b/backend/urls.py @@ -18,8 +18,14 @@ from django.conf import settings from landing.views import HomeView +from django.views.generic import TemplateView urlpatterns = [ path(str(settings.ADMIN_URL), admin.site.urls), path('', HomeView.as_view()), + path('404', TemplateView.as_view(template_name='404.html')), + path('*', TemplateView.as_view(template_name='404.html')), ] + +handler404 = 'landing.views.custom_404' +handler500 = 'landing.views.custom_500' \ No newline at end of file diff --git a/landing/views.py b/landing/views.py index 7e2daa7..291b317 100644 --- a/landing/views.py +++ b/landing/views.py @@ -29,4 +29,12 @@ def post(self, request, *args, **kwargs): context = { 'form': form, } - return render(request, 'home_view.html', context=context) \ No newline at end of file + return render(request, 'home_view.html', context=context) + + + +def custom_404(request, exception, *args, **kwargs): + return render(request, '404.html', status=404) + +def custom_500(request, *args, **kwargs): + return render(request, '500.html', status=500) \ No newline at end of file