Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialWilfredo Casas
6,174 PointsI can't see my code in the browser: workspace unavailable?
I tried to run my first Flask code in the browser but this message appeared:
Workspace Unavailable This is a preview link for a Treehouse Workspace that is not currently active. If you are the workspace owner, you can launch it again via the Treehouse site.
What is happening? This is my code:
from flask import Flask
app = Flask(__name__)
@app.route('/mynewroute')
def index():
return "Hello Treehouse"
app.run(debug=True, port=8000, host:'0.0.0.0')
Chris Freeman
Treehouse Moderator 68,457 PointsWhat command was used in the console window to launch the flask server app? Can you post the console output?
1 Answer
Wilfredo Casas
6,174 PointsI solved the problem, it was for not writing the name of the file on the terminal.
Chris Freeman
Treehouse Moderator 68,457 PointsGreat! Moved comment to Answer.
Joseph Martin Nograles
4,696 PointsI have this same problem. How did you fix it?
Anders Axelsen
3,471 PointsJoseph Martin Nograles, in console, type python + the name of your project.py.
My command is:
python simple_app.py
This sends the new information and the new code to the door.
Chris Freeman
Treehouse Moderator 68,457 PointsChris Freeman
Treehouse Moderator 68,457 PointsSometimes helps to try a different port such as 8080 instead of 8000.