|
|
@ -1,7 +1,7 @@
|
|
|
|
from functools import wraps
|
|
|
|
from functools import wraps
|
|
|
|
from flask import Flask
|
|
|
|
from flask import Flask
|
|
|
|
from flask import render_template, send_from_directory, request, Response, redirect, url_for
|
|
|
|
from flask import render_template, send_from_directory, request, Response, redirect, url_for
|
|
|
|
import json, time
|
|
|
|
import json, time, subprocess
|
|
|
|
app = Flask(__name__)
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
def check_auth(username, password):
|
|
|
|
def check_auth(username, password):
|
|
|
@ -36,6 +36,9 @@ def status():
|
|
|
|
@app.route('/open/<what>')
|
|
|
|
@app.route('/open/<what>')
|
|
|
|
@requires_auth
|
|
|
|
@requires_auth
|
|
|
|
def users(what):
|
|
|
|
def users(what):
|
|
|
|
|
|
|
|
if what == "fridge":
|
|
|
|
|
|
|
|
subprocess.call("/home/pi/ELAB-RFID-I2C/RPi/i2c_challenge", shell=True)
|
|
|
|
|
|
|
|
|
|
|
|
print 'opened', what
|
|
|
|
print 'opened', what
|
|
|
|
return redirect(url_for('status'))
|
|
|
|
return redirect(url_for('status'))
|
|
|
|
|
|
|
|
|
|
|
|