commit 585f5c4c5167ad94abdb019674c0af3f1140a40e Author: Cameron Date: Tue Aug 13 23:28:00 2019 -0500 first commit, raspi temp display diff --git a/__pycache__/microblog.cpython-37.pyc b/__pycache__/microblog.cpython-37.pyc new file mode 100644 index 0000000..050d6d0 Binary files /dev/null and b/__pycache__/microblog.cpython-37.pyc differ diff --git a/app/__init__.py b/app/__init__.py new file mode 100644 index 0000000..82b47ea --- /dev/null +++ b/app/__init__.py @@ -0,0 +1,5 @@ +from flask import Flask + +app = Flask(__name__) + +from app import routes \ No newline at end of file diff --git a/app/__pycache__/__init__.cpython-37.pyc b/app/__pycache__/__init__.cpython-37.pyc new file mode 100644 index 0000000..0c56110 Binary files /dev/null and b/app/__pycache__/__init__.cpython-37.pyc differ diff --git a/app/__pycache__/routes.cpython-37.pyc b/app/__pycache__/routes.cpython-37.pyc new file mode 100644 index 0000000..174a992 Binary files /dev/null and b/app/__pycache__/routes.cpython-37.pyc differ diff --git a/app/routes.py b/app/routes.py new file mode 100644 index 0000000..b78a9d6 --- /dev/null +++ b/app/routes.py @@ -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) \ No newline at end of file diff --git a/app/templates/index.html b/app/templates/index.html new file mode 100644 index 0000000..d11b3c4 --- /dev/null +++ b/app/templates/index.html @@ -0,0 +1,8 @@ + + + {{ title }} - Microblog + + +

Hello, {{ user.username }}!

+ + \ No newline at end of file diff --git a/app/templates/status.html b/app/templates/status.html new file mode 100644 index 0000000..2263e06 --- /dev/null +++ b/app/templates/status.html @@ -0,0 +1,8 @@ + + + {{ device.name }} Status + + +

Temperature: {{ status.temperature }}

+ + \ No newline at end of file diff --git a/microblog.py b/microblog.py new file mode 100644 index 0000000..e524e69 --- /dev/null +++ b/microblog.py @@ -0,0 +1 @@ +from app import app \ No newline at end of file