Re: Discuss https://github.com/django/django/pull/11157

2019-07-21 Thread Petr Glotov
Overriding render_to_response() would take creating an instance of StreamingHttpResponse with streaming_content kwarg using self.resolve_template(), self.resolve_content() and applying self.make_bytes() to it? It's possible but as a user i'd rather not need to know how Django's TemplateView ope

Re: Discuss https://github.com/django/django/pull/11157

2019-07-20 Thread Carlton Gibson
I’m exactly -1 on this, for exactly the reasons given. ALL it takes for you to implement this is to subclass TemplateView and override render_to_response(). That’s it. This was Tom’s point in his review four years ago: the ease of directly implementing it means the added API surface area isn’t w

Re: Discuss https://github.com/django/django/pull/11157

2019-07-20 Thread Petr Glotov
What if we keep *StreamingTemplateResponse* and do *TemplateView(stream=True) *flag? I just want to have something out of the box to use. On Friday, July 19, 2019 at 5:40:52 PM UTC-7, Petr Glotov wrote: > > Hi All, there is a PR where > template st

Re: Discuss https://github.com/django/django/pull/11157

2019-07-20 Thread Adam Johnson
I've had a quick look at the PR and discussions. The ability to stream template rendering looks fantastic and I know I've seen on a few features in projects that could take advantage of it. I agree with Carlton's last comment on the PR though. Adding all the extra classes to Django is a bit of a

Re: Discuss https://github.com/django/django/pull/11157

2019-07-19 Thread Carlton Gibson
It's not really a recent discussion. 🙂 The original mailing list thread here was from 2015: https://groups.google.com/d/topic/django-developers/kuGeu7ffJsc/discussion I based my comments on the PR on a review + Aymeric and Tom's previous reviews there, which were never acted on. I quoted Tom

Discuss https://github.com/django/django/pull/11157

2019-07-19 Thread Petr Glotov
Hi All, there is a PR where template streaming is introduced, and recently a discussion emerged on wether a *StreamingTemplateView* class belongs in Django. I know for sure I'd be glad to replace *TemlateView *based views in one of project I'm worki