librelist archives

« back to archive

Re: [flask] Returning a rendered file without having the html/head tags

Re: [flask] Returning a rendered file without having the html/head tags

From:
adam.pointer@gmx.com
Date:
2012-05-13 @ 08:27
Are you sure that it's not firebug adding the head tags? To get the actual
response with no browser interference use curl from the command line for 
example.

----- Reply message -----
From: "Simon Sapin" <simon.sapin@exyr.org>
To: <flask@librelist.com>
Subject: [flask] Returning a rendered file without having the html/head	tags
Date: Sun, May 13, 2012 09:09


Le 12/05/2012 15:50, MMN a écrit :
> So I saved the content I need to load inside my html page in a different
> template file and made a url for flask to render it. When I make the
> call(return render_template('customercontacteditpane.html')) though,
> flask seems to be adding a html, head tags to it and returning it as an
> html response. So the whole rendering fails as this gets replaced as the
> response. This is what I saw happening in firebug.

Hi,

I am not aware of anything in Flask that would add HTML that you have 
not written to your responses. But I don’t understand what you’re doing 
either. Could you provide a minimal code sample, what you expected to 
see when running it, and what you see instead?

Regards,
-- 
Simon Sapin