2 Comments

I never heard of the @wrap and it's exactly what I was looking for. Great article!

Expand full comment

Nice explanation. I built one that's similar that I use in Flask apps that captures print output and returns it as part of the context either in a Jinja template or directly as a 'text/plain' response. I find this especially useful when I'm constructing a new view and don't want to build the template yet. I started with the 'templated' decorator that's in the Flask documentation and modified that.

Expand full comment