forked from futureshocked/RaspberryPiFullStack_Raspbian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello_v2.py
53 lines (35 loc) · 708 Bytes
/
hello_v2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
'''
FILE NAME
hello_v2.py
1. WHAT IT DOES
Serves a web page by applying a template to the user's web browser.
2. REQUIRES
* Any Raspberry Pi
3. ORIGINAL WORK
Raspberry Full stack 2018, Peter Dalmaris
4. HARDWARE
None
5. SOFTWARE
Command line terminal
Simple text editor
Libraries:
from flask import Flask
from flask import render_template
6. WARNING!
None
7. CREATED
8. TYPICAL OUTPUT
A web page
// 9. COMMENTS
--
// 10. END
'''
from flask import Flask
from flask import render_template
app = Flask(__name__)
app.debug = True
@app.route("/")
def hello():
return render_template('hello.html', message="Hello World!")
if __name__ == "__main__":
app.run(host='0.0.0.0', port=8080)