added login form from tutorial
This commit is contained in:
@@ -1,11 +1,27 @@
|
||||
from flask import render_template
|
||||
from app import app
|
||||
from app.forms import LoginForm
|
||||
from flask import send_file
|
||||
from flask import send_from_directory
|
||||
|
||||
@app.route('/')
|
||||
@app.route('/index')
|
||||
def index():
|
||||
user = {'username': 'Miguel'}
|
||||
posts = [
|
||||
{
|
||||
'author': {'username': 'John'},
|
||||
'body': 'Beautiful day in Portland!'
|
||||
},
|
||||
{
|
||||
'author': {'username': 'Susan'},
|
||||
'body': 'The Avengers movie was so cool!'
|
||||
}
|
||||
]
|
||||
return render_template('index.html', title='Home', user=user, posts=posts)
|
||||
|
||||
@app.route('/status')
|
||||
def getstatus():
|
||||
device = {'name': 'find how to get name later'}
|
||||
status = {'temperature': float(open('/sys/class/thermal/thermal_zone0/temp').read()) / 1000}
|
||||
return render_template('status.html', device=device, status=status)
|
||||
|
||||
Reference in New Issue
Block a user