[Tutor] Fwd: Re: Unexpected result when running flask application.

Albert-Jan Roskam sjeik_appie at hotmail.com
Fri Jun 28 16:32:30 EDT 2019


Ooops, forgot to 'reply all'
---------- Forwarded message ----------
From: Albert-Jan Roskam <sjeik_appie at hotmail.com>
Date: 28 Jun 2019 21:31
Subject: Re: [Tutor] Unexpected result when running flask application.
To: Cameron Simpson <cs at cskk.id.au>
Cc:



On 20 Jun 2019 00:56, Cameron Simpson <cs at cskk.id.au> wrote:

On 19Jun2019 09:54, Alan Gauld <alan.gauld at yahoo.co.uk> wrote:
>On 19/06/2019 05:18, Cravan wrote:
>>                 I am experiencing an unexpected result when I try to
>>                 run my flask application.
>> The movie.html page prints out nothing except those in the <h1>. This appears on my webpage:
>
>Note that the mail server does not allow (for security reasons)
>binary attachments so we lost your image.

Cravan, you might find it useful to "View Source" of that page in your
browser.

You can also use command line tools like "curl" or "wget" to directly
fetch the page content.

>However, your html files are not in HTML.
>I'm not a Flask expert but every time I've used Flask the
>html pages have been real HTML. Yours appear to be in some
>strange pseudo markup language.

It is very common in Flask to write HTML pages using Jinja templates,
which is what his examples look like.

Of course this adds more complexity, if he forgets to use Jinja to
render the content to HTML before returning it.

>If this is something unique to Flask then I suspect you will
>need to ask on a Flask support page or list. It doesn't seem
>to be a Python language related issue at this point.

==》 I haven't seen the templates, but your view function should probably retun flas.render_template('some.html', **kwargs), where kwargs will be e.g. your database values that are going to be displayed/{{interpolated}}.




More information about the Tutor mailing list