From 39a877ad10bd0af121b97202b6fb5c12e7112d24 Mon Sep 17 00:00:00 2001 From: Gesche Gierse Date: Tue, 11 May 2021 22:52:00 +0200 Subject: [PATCH] redirect from start page to writing/ --- stories/urls.py | 3 +++ stories/views.py | 5 +++++ 2 files changed, 8 insertions(+) create mode 100644 stories/views.py diff --git a/stories/urls.py b/stories/urls.py index 7e21201..451d604 100644 --- a/stories/urls.py +++ b/stories/urls.py @@ -16,8 +16,11 @@ Including another URLconf from django.contrib import admin from django.urls import path, include +from stories.views import IndexRedirectView + urlpatterns = [ path('writing/', include('writingtogether.urls')), path('accounts/', include('django.contrib.auth.urls')), path('admin/', admin.site.urls), + path('', IndexRedirectView.as_view(), name='main_index') ] diff --git a/stories/views.py b/stories/views.py new file mode 100644 index 0000000..ce916b0 --- /dev/null +++ b/stories/views.py @@ -0,0 +1,5 @@ +from django.views.generic import RedirectView + + +class IndexRedirectView(RedirectView): + pattern_name = 'writing:index' \ No newline at end of file