X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/6280673f35e13e75e81c5b7821bd2a44a1831eab..357027375ff8867f42ca34bcbfb5a78b5b185fc3:/src/chunks/views.py diff --git a/src/chunks/views.py b/src/chunks/views.py new file mode 100644 index 000000000..cbcf5bf6c --- /dev/null +++ b/src/chunks/views.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# This file is part of Wolnelektury, licensed under GNU Affero GPLv3 or later. +# Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. +# +from django.http import HttpResponse +from ssify import ssi_included +from .models import Chunk + +@ssi_included +def chunk(request, key): + chunk, created = Chunk.objects.get_or_create(key=key) + return HttpResponse(chunk.content)