added redirection from / to /comic/

This commit is contained in:
2015-06-24 09:45:50 +01:00
parent b7dcdc5d94
commit 8a99514c18
3 changed files with 6 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ from django.conf.urls import include, url
from django.contrib import admin
urlpatterns = [
url(r'^$', 'comic.views.comic_redirect'),
url(r'^login/', 'comic_auth.views.comic_login'),
url(r'^logout/', 'comic_auth.views.comic_logout'),
url(r'^comic/', include('comic.urls')),

View File

@@ -1,7 +1,7 @@
from django.http import HttpResponse
from django.template import RequestContext
from django.utils.http import urlsafe_base64_decode
from django.shortcuts import render
from django.shortcuts import render, redirect
from django.contrib.auth.decorators import login_required
from comic.models import Setting, ComicBook
@@ -56,3 +56,6 @@ def get_image(_, comic_path, page):
full_path = path.join(base_dir, decoded_path)
img, content = book.get_image(full_path, page)
return HttpResponse(img.read(), content_type=content)
def comic_redirect(request):
return redirect('/comic/')

View File

@@ -1,5 +1,4 @@
from django.shortcuts import render, redirect
from django.shortcuts import RequestContext
from django.shortcuts import render, redirect, RequestContext
from django.contrib.auth import authenticate, login, logout