Skip to content
Snippets Groups Projects
Commit 9b480c90 authored by Arianne Bayliss's avatar Arianne Bayliss
Browse files

deleting test server

parent 964a02c5
Branches 2-as-a-user-i-want-to-be-authorized-if-i-am-a-member
No related tags found
1 merge request!61deleting test server
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment