diff --git a/testloginserver.py b/testloginserver.py deleted file mode 100644 index 1cb3a9abdc0a10574357b2d40b3b6d9aabe675b3..0000000000000000000000000000000000000000 --- a/testloginserver.py +++ /dev/null @@ -1,50 +0,0 @@ -import os -import sqlite3 -from flask import Flask, request, render_template, send_from_directory - -app = Flask(__name__) - -ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif']) - -@app.route("/home", methods=["GET"]) -def load(): - return render_template('landingpage.html') - -@app.route("/locations", methods=["GET"]) -def loadlocations(): - return send_from_directory('static', 'locations.html') - -@app.route("/coworking", methods=["GET"]) -def loadcoworking(): - return render_template('manage_coworking_spaces.html') - -@app.route("/login", methods=["GET"]) -def loadlogin(): - return render_template('login.html') - -@app.route("/signin", methods=['GET', 'POST']) -def login(): - error = None - if (request.method =='POST'): - recordEmail = request.form.get('recordEmail') - print(recordEmail) - recordPassword = request.form.get('recordPassword') - print(recordPassword) - try: - conn = sqlite3.connect("login.db") - cur = conn.cursor() - cur.execute("INSERT INTO login ('Email','Password') values (?,?)", (recordEmail, recordPassword)) - conn.commit() - recordData = cur.fetchall() - print(recordData) - return recordData - except Exception as e: - recordData = e - print(f"Error: {e}") - conn.close() - finally: - conn.close() - return render_template('locations.html') - -if __name__ == "__main__": - app.run(debug=True) \ No newline at end of file