diff --git a/main.py b/main.py index fef7650..e6ed35d 100644 --- a/main.py +++ b/main.py @@ -3,6 +3,7 @@ from mail import sendEmail from flask import Flask, render_template, Response from camera import VideoCamera +from flask_basicauth import BasicAuth import time import threading @@ -12,6 +13,11 @@ # App Globals (do not edit) app = Flask(__name__) +app.config['BASIC_AUTH_USERNAME'] = 'CHANGE_ME_USERNAME' +app.config['BASIC_AUTH_PASSWORD'] = 'CHANGE_ME_PLEASE' +app.config['BASIC_AUTH_FORCE'] = True + +basic_auth = BasicAuth(app) last_epoch = 0 def check_for_objects(): @@ -28,6 +34,7 @@ def check_for_objects(): print "Error sending email: ", sys.exc_info()[0] @app.route('/') +@basic_auth.required def index(): return render_template('index.html') diff --git a/requirements.txt b/requirements.txt index a2ba31f..e217f6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ imutils flask picamera[array] +Flask-BasicAuth==0.2.0 \ No newline at end of file