From 6d38be0851f3967db3d2ccc60eaa37fa78ecb3bd Mon Sep 17 00:00:00 2001 From: Gabriel Augendre Date: Sun, 22 Nov 2020 14:12:53 +0100 Subject: [PATCH] Redirect root to exercises --- src/workout_suggest/urls.py | 5 ++++- src/workout_suggest/views.py | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/workout_suggest/views.py diff --git a/src/workout_suggest/urls.py b/src/workout_suggest/urls.py index 444d0d6..5cc2df3 100644 --- a/src/workout_suggest/urls.py +++ b/src/workout_suggest/urls.py @@ -14,9 +14,12 @@ Including another URLconf 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from django.contrib import admin -from django.urls import include, path, re_path +from django.urls import include, path + +from workout_suggest.views import home urlpatterns = [ + path("", home, name="home"), path("exercises/", include("exercises.urls", namespace="exercises")), path("admin/", admin.site.urls), ] diff --git a/src/workout_suggest/views.py b/src/workout_suggest/views.py new file mode 100644 index 0000000..a7f4f51 --- /dev/null +++ b/src/workout_suggest/views.py @@ -0,0 +1,5 @@ +from django.shortcuts import redirect + + +def home(request): + return redirect("exercises:base")