Setting up Flask

Setting up Flask

Postby iFunction » Thu Sep 08, 2016 10:20 am

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.

Posts: 41
Joined: Mon Apr 04, 2016 2:33 pm

Re: Setting up Flask

Postby nilamo » Thu Sep 08, 2016 5:04 pm

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.
This forum is shutting down. Future discussion should take place at
User avatar
Posts: 87
Joined: Thu Jul 21, 2016 8:00 pm
Location: Michigan

Re: Setting up Flask

Postby snippsat » Thu Sep 08, 2016 6:43 pm

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.
We will be moving to on October 1 2016
User avatar
Posts: 1251
Joined: Thu Feb 21, 2013 12:04 am

Re: Setting up Flask

Postby iFunction » Fri Sep 23, 2016 10:37 am

@ 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.
Posts: 41
Joined: Mon Apr 04, 2016 2:33 pm

Return to Web Development

Who is online

Users browsing this forum: No registered users and 1 guest