This repository was archived by the owner on Aug 31, 2025. It is now read-only.
Web Mode: Could Mu include a default app.py? #2320
prcutler
started this conversation in
Ideas & New Features
Replies: 2 comments 1 reply
-
I believe if you are in the "Web mode" and click the "New" button it will open a new tab with this Python code by default, no? # A simple web application.
from flask import Flask, render_template
app = Flask(__name__)
@app.route("/")
def index():
return render_template('index.html') Or maybe I misunderstood what you meant? |
Beta Was this translation helpful? Give feedback.
0 replies
-
You're correct, I think I didn't understand. When I click new, I do get the code you mention. But when I hit "Run", it opens up a save dialog, which is what led to my confusion. And I think it would lead to new user confusion - what are they supposed to be saving? (File name, etc) I hope that makes sense. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm playing around with Web mode as it needs a tutorial written (issue #2271 ) and Mu ships with HTML files and directories (static, templates) with a "Hello from Mu" page and sub-pages. If a basic app.py was included, when the user hits "Run" in Mu, it would load the "Hello from Mu" page. The code that worked for me looks like:
Is there interest in possibly including something like this to help get users one step closer to running a Flask app?
Beta Was this translation helpful? Give feedback.
All reactions