Redirect root to exercises

This commit is contained in:
Gabriel Augendre 2020-11-22 14:12:53 +01:00
parent ae1f00ef27
commit 6d38be0851
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4
2 changed files with 9 additions and 1 deletions

View file

@ -14,9 +14,12 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
from django.contrib import admin 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 = [ urlpatterns = [
path("", home, name="home"),
path("exercises/", include("exercises.urls", namespace="exercises")), path("exercises/", include("exercises.urls", namespace="exercises")),
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
] ]

View file

@ -0,0 +1,5 @@
from django.shortcuts import redirect
def home(request):
return redirect("exercises:base")