Skip to content

Commit

Permalink
Add home page redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
arkid15r committed Aug 30, 2024
1 parent c0f4b2d commit 7318104
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
11 changes: 11 additions & 0 deletions backend/apps/owasp/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
"""OWASP app views."""

import requests
from django.http import HttpResponseRedirect
from django.views.decorators.cache import cache_page


@cache_page(60 * 68 * 24)
def home_page(_):
"""Homepage view."""
return HttpResponseRedirect("https://owasp.org/www-project-nest", status=requests.codes.found)
6 changes: 5 additions & 1 deletion backend/settings/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
from django.contrib import admin
from django.urls import path

from apps.owasp import views as owasp_views

urlpatterns = [
path("", owasp_views.home_page),
path("a/", admin.site.urls),
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
if settings.DEBUG:
urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

0 comments on commit 7318104

Please sign in to comment.