3 ms·
'This simplifies things, and you can use an in-memory StringIO object rather than a file. You can then return this string to flask as a text/html response and a
by redfox2 5y ago
'This simplifies things, and you can use an in-memory StringIO object rather than a file. You can then return this string to flask as a text/html response and avoid Jinja2 entirely.'
I didn't think of this until you mentioned this, so might do that. But I don't get the 'avoid Jinja2 entirely' part. Jinja2 is avoided with the current syntax already (which is definitely changing).
About BeautifulSoup, the autoPrettify() function is actually from bs4, it is a dependency.
Yeah I know, camelCase IS unpythonic
Thanks again
- orf 5y agoWhen you do “render_template()” Flask uses jinja2 - it will read it, pass it to jinja2 and render the response. This is what I meant by avoiding jinja2 entirely. Good luck!