From 53a4734cae3936435229181582491a35459c8cf4 Mon Sep 17 00:00:00 2001 From: Walter Date: Fri, 14 Feb 2025 13:28:33 +0100 Subject: [PATCH] Added clean redirects to the game --- app/bloonsa_game/urls.py | 7 ++++--- app/settings/urls.py | 7 ++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/bloonsa_game/urls.py b/app/bloonsa_game/urls.py index 350e4ad..2a8ed53 100644 --- a/app/bloonsa_game/urls.py +++ b/app/bloonsa_game/urls.py @@ -1,13 +1,14 @@ from django.urls import path, include +from django.views.generic import RedirectView from bloonsa_game.views import IndexView, TermsView, GameView, WIPView app_name = "bloonsa_game" urlpatterns = [ - path("", IndexView.as_view(), name="index"), + path("", RedirectView.as_view(pattern_name="bloonsa_game:game", permanent=False), name="index"), path("game", GameView.as_view(), name="game"), path("game/", GameView.as_view(), name="gameSelect"), - path("terms", TermsView.as_view(), name="terms"), - path("contact", WIPView.as_view(), name="contact"), + # path("terms", TermsView.as_view(), name="terms"), + # path("contact", WIPView.as_view(), name="contact"), ] diff --git a/app/settings/urls.py b/app/settings/urls.py index a040c54..a95adae 100644 --- a/app/settings/urls.py +++ b/app/settings/urls.py @@ -17,14 +17,11 @@ from django.contrib import admin from django.urls import path, include, re_path from django.views.generic.base import RedirectView -crossdomain_view = RedirectView.as_view(url='/static/bloonsa_game/misc/crossdomain.xml', permanent=True) - - urlpatterns = [ - path('admin/', admin.site.urls), + path("", RedirectView.as_view(pattern_name="bloonsa_game:game", permanent=False), name="index"), + path("admin/", admin.site.urls), path("bloonsa_api/", include("bloonsa_api.urls", namespace="bloonsa_api")), path("a/", include("bloonsa_game.urls", namespace="bloonsa_game")), path("users/", include("users.urls", namespace="users")), - re_path(r'^crossdomain\.xml$', crossdomain_view) ]