first commit, raspi temp display

This commit is contained in:
2019-08-13 23:28:00 -05:00
commit 585f5c4c51
8 changed files with 31 additions and 0 deletions

Binary file not shown.

5
app/__init__.py Normal file
View File

@@ -0,0 +1,5 @@
from flask import Flask
app = Flask(__name__)
from app import routes

Binary file not shown.

Binary file not shown.

9
app/routes.py Normal file
View 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
View File

@@ -0,0 +1,8 @@
<html>
<head>
<title>{{ title }} - Microblog</title>
</head>
<body>
<h1>Hello, {{ user.username }}!</h1>
</body>
</html>

View 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
View File

@@ -0,0 +1 @@
from app import app