I don't really understand what Flask is
--Create a nice folder
--python3 -m venv <name of virtual environment>
Put it in the terminal of the created folder
(If you get angry, try changing py, python, python3 by brute force)
--Maybe there is python ~~ in the lower left, so select that,
--If you want to use the terminal in a virtual environment, you can find it on the toolbar above.
"View"-> "Command Palette"-> "Enter --Open a terminal as described above and enter
--You can check the modules included with --Put the code below and save ("command + s ne") When a link in "" is requested by --Open the terminal as above and open the terminal I put it in. --A link called port 5000 on the local host will be displayed on the terminal, so try moving to it.
It's okay if * Hello World * is displayed properly ――It's said that there is no Flask module, but you should think about it. You can do it. ――Let's take another opportunity to see if it works automatically with debugging.
――I wonder if it is better to make the web_app that rides on the server from the front end or the back end.
Recommended Posts
There should be something like "Python
It's like declaring that you're going to use a Python virtual environment Python: Create Terminal
"
Open with2-2. Installing Flask
pip install flask
pip freeze
, it is better to see if they are included properly 2-3. A little operation check
Display something * text * and check if it works
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello_world():
return "Hello, World!"
@ app.route ("/ ")
, it returns the behavior of the function below.
You shouldn't think about the above two lines yet $ export FLASK_APP=app.py
$ flask run
3. End