Exemplo n.º 1
0
"""

import os
from HelloFlask import app

if __name__ == '__main__':

    HOST = os.environ.get('SERVER_HOST', 'localhost')

    try:
        PORT = int(os.environ.get('SERVER_PORT', '5555'))

    except ValueError:
        PORT: 5555

app.run(HOST, PORT)

#from flask import Flask
##import flask
#app = Flask(__name__)

## Make the WSGI interface available at the top level so wfastcgi can get it.
#wsgi_app = app.wsgi_app

#@app.route('/')
#@app.route('/hello/<name>?message=<msg>')
#def hello(name,msg):
#    """Renders a sample page."""
#    return "Hello World!" +name + "! Message is " + msg + "."

#if __name__ == '__main__':
Exemplo n.º 2
0
#redirects here if not a match
@app.route('/NotSuccessful')
def NotSuccessful():
    return render_template(
        "NotSuccessful.html",
        no_match="Face was not a match, decryption not successful")


#clearing files
@app.route('/deleteFiles')
def deleteFiles():
    #clearing files
    os.remove("HelloFlask/static/image_uploads/first_image.jpeg")
    os.remove("HelloFlask/static/image_uploads/second_image.jpeg")
    os.remove("HelloFlask/static/encryption_folder/EncryptedFile.enc")
    os.remove("HelloFlask/static/encryption_folder/ivFile")
    os.remove("HelloFlask/static/encryption_folder/lock")
    os.remove("HelloFlask/static/encryption_folder/randomKey")
    os.remove("HelloFlask/static/encryption_folder/DecryptedFile.txt")

    file = os.listdir("HelloFlask/static/file_uploads")[0]
    filePath = os.path.join("HelloFlask/static/file_uploads", file)
    os.remove(filePath)

    return redirect('http://localhost:5555/')


if __name__ == '__main__':
    app.run(debug=True)