Last active
May 27, 2018 00:38
-
-
Save NanoDano/9602633817f703c74a2ebec088067183 to your computer and use it in GitHub Desktop.
Raspberry Pi camera viewing tool over HTTPS (Flask web server)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from flask import Flask, render_template | |
from picamera import PiCamera, Color | |
BASE_DIR = '/home/pi/pycammy' | |
app = Flask(__name__) | |
camera = PiCamera() | |
@app.route('/') | |
def index(): | |
image_url = '/static/image.jpg' | |
camera.capture( + image_url) | |
return render_template('index.html', image_url=image_url) | |
if __name__ == '__main__': | |
ssl_context=('cert.pem', 'key.pem') | |
app.run(host="0.0.0.0", port=8080, ssl_context=ssl_context) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment