first commit, raspi temp display
This commit is contained in:
BIN
__pycache__/microblog.cpython-37.pyc
Normal file
BIN
__pycache__/microblog.cpython-37.pyc
Normal file
Binary file not shown.
5
app/__init__.py
Normal file
5
app/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from flask import Flask
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
from app import routes
|
||||
BIN
app/__pycache__/__init__.cpython-37.pyc
Normal file
BIN
app/__pycache__/__init__.cpython-37.pyc
Normal file
Binary file not shown.
BIN
app/__pycache__/routes.cpython-37.pyc
Normal file
BIN
app/__pycache__/routes.cpython-37.pyc
Normal file
Binary file not shown.
9
app/routes.py
Normal file
9
app/routes.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from flask import render_template
|
||||
from app import app
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/index')
|
||||
def index():
|
||||
device = {'name': 'find how to get name later'}
|
||||
status = {'temperature': float(open('/sys/class/thermal/thermal_zone0/temp').read())}
|
||||
return render_template('status.html', device=device, status=status)
|
||||
8
app/templates/index.html
Normal file
8
app/templates/index.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ title }} - Microblog</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello, {{ user.username }}!</h1>
|
||||
</body>
|
||||
</html>
|
||||
8
app/templates/status.html
Normal file
8
app/templates/status.html
Normal file
@@ -0,0 +1,8 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>{{ device.name }} Status</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Temperature: {{ status.temperature }}</h1>
|
||||
</body>
|
||||
</html>
|
||||
1
microblog.py
Normal file
1
microblog.py
Normal file
@@ -0,0 +1 @@
|
||||
from app import app
|
||||
Reference in New Issue
Block a user