News for hackers. Stuff that matters.
Re:Show HN: A Python native engine for web development by redfox2 on Sunday July 11, 2021 @07:20AM (#27799974)
'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

Re:Show HN: A Python native engine for web development by orf on Sunday July 11, 2021 @07:26AM (#27799995)
When 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!

Re:Show HN: A Python native engine for web development by redfox2 on Monday July 12, 2021 @12:10AM (#27806963)
But the issue when I avoid render_template() is this: I can't add the CSS file along with the HTML one, unless I create a <style> tag at the end of the file that has all of the CSS content. Can you comment on that?
Re:Show HN: A Python native engine for web development by redfox2 on Sunday July 11, 2021 @07:55AM (#27800112)
Oh render_template(), yeah. Thanks