redirect main page
This commit is contained in:
parent
3035dc3ccf
commit
e0f0e3897a
2 changed files with 6 additions and 1 deletions
|
@ -1,8 +1,12 @@
|
||||||
from django.shortcuts import render, redirect, get_object_or_404
|
from django.shortcuts import render, redirect, get_object_or_404
|
||||||
|
from django.conf import settings
|
||||||
|
|
||||||
from . import models
|
from . import models
|
||||||
|
|
||||||
def fallback(request):
|
def fallback(request, slug=''):
|
||||||
|
if not slug:
|
||||||
|
return redirect('index')
|
||||||
|
|
||||||
context = {}
|
context = {}
|
||||||
return render(request, 'fallback.html', context)
|
return render(request, 'fallback.html', context)
|
||||||
|
|
||||||
|
|
|
@ -39,4 +39,5 @@ urlpatterns = [
|
||||||
path(settings.URL_PREFIX + '<str:slug>/', text.page, name='page'),
|
path(settings.URL_PREFIX + '<str:slug>/', text.page, name='page'),
|
||||||
path(settings.URL_PREFIX[:-1], text.index, name='index'),
|
path(settings.URL_PREFIX[:-1], text.index, name='index'),
|
||||||
path('', text.fallback, name='fallback'),
|
path('', text.fallback, name='fallback'),
|
||||||
|
path('<str:slug>', text.fallback, name='fallback'),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue