I made this code on Flask:
from flask import Flask app = Flask(__name__) @app.route('/') def index(): return "hi"
Even so, fi I try to run it with
flask run it shows this message:
* Serving Flask app "app.py" * Environment: production WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Debug mode: off Usage: flask run [OPTIONS] Error: Could not import "app".
What am I doing wrong?
website/ | - app.py
from flask import Flask app = Flask(__name__) @app.route('/') def index(): return "hi" if __name__ == '__main__': app.run(host='0.0.0.0', port=30006, debug=True)
Run in the same directory where this code is placed.
You can access it on