1 HTML open mode effect is as follows
2 Writing in Python background
# Coding:utf-8
# import multiple tools from the same location,
# These tools can be separated by commas and imported
# Render_template Render Master
From flask Import Flask,render_template
App=flask (__name__)
# adorners, which are used to encapsulate links while returning data
@app. Route ('/index ')
Def index_xxx ():
# import HTML
# need to create a Templates folder on the desktop,
# put the HTML into this folder
Return render_template (' home1.html ')
# in the function, as long as the code behind the import Return,return is not executed.
Return ' python!! '
@app. Route ('/login ')
def login ():
# import HTML
# return Render_template (' home.html ')
# in the function, as long as the code behind the import Return,return is not executed.
Return ' python!! '
App.debug=true
# Run Server
App.run ()
# if it's an absolute path, create a folder templates,
# because the default is this one folder
3. And also use vs code to write the basic page shown in the foreground
<body><div> Welcome to Jaoany's Blog! </div> <!--action= "/commit" is the link to access the landing page--><form action= "/commit" ><!--<div>html is the front </div>--><input type= "text" name= "username" placeholder= "Please enter user name:" ><input type= "password" name= " PSW "placeholder=" Please enter the password: "><input type=" submit "value=" Login ">
</form> </body> 4 Writing background and foreground environment Subline Text 2 is written in the background, VS code is writing the foreground
Python writes a simple HTML landing page (1)