diff --git a/app/text/views.py b/app/text/views.py index 23217de..055029b 100755 --- a/app/text/views.py +++ b/app/text/views.py @@ -1,8 +1,12 @@ from django.shortcuts import render, redirect, get_object_or_404 +from django.conf import settings from . import models -def fallback(request): +def fallback(request, slug=''): + if not slug: + return redirect('index') + context = {} return render(request, 'fallback.html', context) diff --git a/app/urls.py b/app/urls.py index 949f300..48d8281 100755 --- a/app/urls.py +++ b/app/urls.py @@ -39,4 +39,5 @@ urlpatterns = [ path(settings.URL_PREFIX + '/', text.page, name='page'), path(settings.URL_PREFIX[:-1], text.index, name='index'), path('', text.fallback, name='fallback'), + path('', text.fallback, name='fallback'), ]