0

I am on my final project and i have a simple flask app and and index html template. There are no errors in my app, however when i run flask, flask run, it says Running on http://127.0.0.1:5000/ (Press CTRL+C to quit). But when i landed on that page, i get a:

This site can’t be reached
127.0.0.1 refused to connect.

then i went online and searched for a similar problem like the one here.

So i ran flask run --host=0.0.0.0 --port=8080, and this time it said:

This page isn’t working
0c4c5d63-0061-4153-a69e-b033f15e1099-ide.cs50.xyz didn’t send any data.

I am able to access 127.0.0.1 through a different program like Sublime text 3, which i use for my flask development. But i am building an app with a database and i prefer using the CS50 IDE which i am familiar with. But i can't seem to get it running.

Any ideas?

4
  • IMO take the path of least resistance: if you want to run it on the ide, serve it on the ide (0c4c5d63-0061-4153-a69e-b033f15e1099-ide.cs50.xyz). Apr 20 '20 at 11:17
  • So do you mean, flask run --host=0c4c5d63-0061-4153-a69e-b033f15e1099-ide.cs50.xyz --port=8080 or how would i implement what you said? Apr 20 '20 at 14:27
  • If one executes flask run in the "vanilla" ide, the environment and configuration will automagically run it on the "ide address". Is anything changed in app.py to redirect somehow? Is anything changed in environment, for instance to run Sublime? Apr 20 '20 at 15:32
  • Nope, i even switched to the CS50 Finance application.py that i made last week and tried to run it. Same thing. All i'm doing in my current project is putting up the necessary parameters for flask and asking it to render_template. It should be running on http://127.0.0.1:5000 but didn't work. I ran the same file in Sublime with the same host and port, and it worked fine. I don't think its my app or sublime, but it's the CS50 IDE instead. I checked their status page to see if everything is working well, and i noticed that they had a maintenance for the IDE the same day i got the error. Apr 21 '20 at 4:29
1

Alright so my IDE is back up and running. I was given a solution by a helpful staff member in the CS50 Reddit Community, and it looks like i installed Flask on my own. I did remember actually installing a later or sooner version. It was part of a project's requirements.txt file.

But i'd like to thank everyone anyways for helping me solve the problem!

2
  • hey, i have been facing the same problem. can you share the solution?Thx. May 4 '20 at 12:33
  • @DannyDurandNzi Hi, sorry for the late response. In my case, i imported a random project to the IDE and installed a requirements.txt file. In it, were newer versions of Flask. One of the staff said, that i installed a newer version of Flask which will not work on the CS50 IDE. I had to do pip3 uninstall flask then close the console, open up another one, and type flask run. And that will install the default Flask version, in which for my case was the solution. Here's the whole conversation: reddit.com/r/cs50/comments/g5axbc/… May 7 '20 at 3:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .