X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/7aaf5361e7b27567ee43bff98d44f9c66ab12943..9e41863c3cff14cbbc65b783ee57120fb59fa22c:/wolnelektury/views.py?ds=sidebyside diff --git a/wolnelektury/views.py b/wolnelektury/views.py old mode 100644 new mode 100755 index d3a8192e8..808a0feaa --- a/wolnelektury/views.py +++ b/wolnelektury/views.py @@ -1,9 +1,10 @@ -# -*- coding: utf-8 -*- +from django.template import RequestContext +from django.shortcuts import render_to_response +from catalogue.models import Book -from django import http -from django.template import RequestContext, loader -def server_error(request): - t = loader.get_template('500.html') - return http.HttpResponseServerError(t.render(RequestContext(request))) +def main_page(request): + last_published = Book.objects.exclude(html_file='').order_by('-created_at')[:4] + return render_to_response("main_page.html", locals(), + context_instance=RequestContext(request)) \ No newline at end of file