Page 1 of 1

Setting up Flask

PostPosted: Thu Sep 08, 2016 10:20 am
by iFunction
Hi there,

I am following this tutorial: ... -cms-22972
but unfortunately it has completely omitted what to do if the browser is unable to connect to localhost:5000 which is what my browser is doing.

gives the Apache2 Debian Default Page.

How can I get the Flask bit to work please?

UPDATE: apologies, here is some more information:
Raspbian fresh install
Apache2 installed
Flask installed using pip
no other things have been changed as yet.


Re: Setting up Flask

PostPosted: Thu Sep 08, 2016 5:04 pm
by nilamo
It's a little odd, but the tutorial has different code than their github repo (which is linked at the bottom of the tutorial). The tutorial never actually tells flask what port to listen to. The github has this at the bottom instead: wrote:
Code: Select all
if __name__ == "__main__":

Try that out, and see if it works for you.

Re: Setting up Flask

PostPosted: Thu Sep 08, 2016 6:43 pm
by snippsat
gives the Apache 2 Debian Default Page.

The tutorial dos not mention Apache,they use Flask build web-server to run it.
Clone from GitHub.
Code: Select all
λ git clone         

Cd to PythonFlaskMySQLApp---Part-1 folder.
In browser.

Re: Setting up Flask

PostPosted: Fri Sep 23, 2016 10:37 am
by iFunction
@ nilamo, Yes, I spotted that and just copied the extra bits into my code and it worked, thanks for that.

@ snippsat, Yes, i have Apache installed on here too as I am trying to learn how to build a LAMP stack, rather unsuccessfully it seems.