X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/c6d5dd71ad0d9bae811cc9002248d9399c7fdff7..d69fc5f16ed739c02685e7d695abf6de59c2bf5e:/apps/chunks/views.py diff --git a/apps/chunks/views.py b/apps/chunks/views.py new file mode 100644 index 000000000..cbcf5bf6c --- /dev/null +++ b/apps/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)