Changes for page How to serve a webpage using python flask
Last modified by Leon Poon on 2021/03/23 13:17
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1,9 +1,8 @@ 1 -First, [[set up a virtualenv>>doc :Main.How.WebHome]].1 +First, [[set up a virtualenv>>url:https://wiki.codepowered.com/wiki/How_to_Create_a_VirtualEnv]]. 2 2 3 -[[In the virtualenv, install flask>>doc :Main.How.WebHome]], then try out this .py file.3 +[[In the virtualenv, install flask>>url:https://wiki.codepowered.com/wiki/How_to_add_libraries_to_a_virtualenv]], then try out this .py file. 4 4 5 -{{code language="python"}} 6 -from flask import Flask 5 +{{{from flask import Flask 7 7 8 8 app = Flask(__name__) 9 9 ... ... @@ -12,8 +12,8 @@ 12 12 return 'Hi' 13 13 14 14 app.run() 15 - {{/code}}14 +}}} 16 16 17 -Run this script [[in the virtualenv>>doc :Main.How.WebHome]]. It will not exit.16 +Run this script [[in the virtualenv>>url:https://wiki.codepowered.com/wiki/How_to_Run_a_Python_Script_in_a_VirtualEnv]]. It will not exit. 18 18 19 19 Now you should be able to access [[http:~~/~~/localhost:5000/>>url:http://localhost:5000/]] in your web browser.