mirror of
https://github.com/ajurna/cbwebreader.git
synced 2025-12-06 14:17:19 +00:00
added redirection from / to /comic/
This commit is contained in:
@@ -17,6 +17,7 @@ from django.conf.urls import include, url
|
|||||||
from django.contrib import admin
|
from django.contrib import admin
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
|
url(r'^$', 'comic.views.comic_redirect'),
|
||||||
url(r'^login/', 'comic_auth.views.comic_login'),
|
url(r'^login/', 'comic_auth.views.comic_login'),
|
||||||
url(r'^logout/', 'comic_auth.views.comic_logout'),
|
url(r'^logout/', 'comic_auth.views.comic_logout'),
|
||||||
url(r'^comic/', include('comic.urls')),
|
url(r'^comic/', include('comic.urls')),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from django.utils.http import urlsafe_base64_decode
|
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 django.contrib.auth.decorators import login_required
|
||||||
|
|
||||||
from comic.models import Setting, ComicBook
|
from comic.models import Setting, ComicBook
|
||||||
@@ -56,3 +56,6 @@ def get_image(_, comic_path, page):
|
|||||||
full_path = path.join(base_dir, decoded_path)
|
full_path = path.join(base_dir, decoded_path)
|
||||||
img, content = book.get_image(full_path, page)
|
img, content = book.get_image(full_path, page)
|
||||||
return HttpResponse(img.read(), content_type=content)
|
return HttpResponse(img.read(), content_type=content)
|
||||||
|
|
||||||
|
def comic_redirect(request):
|
||||||
|
return redirect('/comic/')
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
from django.shortcuts import render, redirect
|
from django.shortcuts import render, redirect, RequestContext
|
||||||
from django.shortcuts import RequestContext
|
|
||||||
from django.contrib.auth import authenticate, login, logout
|
from django.contrib.auth import authenticate, login, logout
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user