2022-12-28 16:04:42 +01:00
|
|
|
from flask import Flask, render_template, request, session, jsonify
|
2022-12-05 16:13:40 +01:00
|
|
|
import requests
|
2022-12-28 16:04:42 +01:00
|
|
|
import bcrypt
|
2022-12-05 16:13:40 +01:00
|
|
|
import os
|
|
|
|
|
|
|
|
app = Flask(__name__)
|
|
|
|
IMAGE_FOLDER = os.path.join('static', 'images')
|
|
|
|
app.config['UPLOAD_FOLDER'] = IMAGE_FOLDER
|
|
|
|
|
|
|
|
@app.route('/')
|
|
|
|
def homepage():
|
|
|
|
return render_template('html/index.html')
|
|
|
|
#imageList = os.listdir('static/images')
|
|
|
|
#imageList = ['images/' + image for image in imageList]
|
|
|
|
#return render_template('go.html', imageList=imageList)
|
|
|
|
|
|
|
|
@app.route('/orario')
|
|
|
|
def orario():
|
2022-12-28 16:04:42 +01:00
|
|
|
if 'username' in session:
|
|
|
|
return "You are logged in as " + session['username']
|
|
|
|
#return render_template('html/orario.html')
|
2022-12-05 16:13:40 +01:00
|
|
|
|
|
|
|
@app.route('/calendario')
|
|
|
|
def calendario():
|
|
|
|
return render_template('html/calendario.html')
|
|
|
|
|
2022-12-28 16:04:42 +01:00
|
|
|
# Da sistemare
|
2022-12-24 17:38:40 +01:00
|
|
|
@app.route('/api', methods = ['GET', 'POST'])
|
|
|
|
def api():
|
|
|
|
if(request.method == 'GET'):
|
|
|
|
data = "hello world"
|
|
|
|
return jsonify({'data': data})
|
|
|
|
|
2022-12-05 16:13:40 +01:00
|
|
|
if __name__ == '__main__':
|
|
|
|
app.run()
|