2018-05-04 23:25:07 +02:00
|
|
|
|
from flask import Flask, render_template, request
|
2018-05-11 23:12:21 +02:00
|
|
|
|
import redis
|
2018-05-04 23:25:07 +02:00
|
|
|
|
app = Flask(__name__)
|
|
|
|
|
|
2018-05-11 23:12:21 +02:00
|
|
|
|
|
|
|
|
|
def load_parishes(directory):
|
|
|
|
|
return {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parishes = load_parishes('dir')
|
|
|
|
|
|
|
|
|
|
|
2018-05-04 23:25:07 +02:00
|
|
|
|
def post_action():
|
|
|
|
|
return get_action()
|
|
|
|
|
|
2018-05-11 23:12:21 +02:00
|
|
|
|
|
2018-05-04 23:25:07 +02:00
|
|
|
|
def get_action():
|
|
|
|
|
hour = '12.00'
|
|
|
|
|
left_context = 'Dawno, dawno temu był sobia para młoda, bardzo piękna para młoda. Msza rozpocznie się o godzinie '
|
2018-05-11 23:12:21 +02:00
|
|
|
|
right_context = '. Następnie para młoda uda się na wesele do Kubusia i będą się bawić do białegop prana.'
|
|
|
|
|
return render_template(
|
|
|
|
|
'index.html',
|
|
|
|
|
hour=hour,
|
|
|
|
|
left_context=left_context,
|
|
|
|
|
right_context=right_context)
|
|
|
|
|
|
2018-05-04 23:25:07 +02:00
|
|
|
|
|
|
|
|
|
@app.route("/", methods=['GET', 'POST'])
|
|
|
|
|
def root():
|
|
|
|
|
if request.method == 'POST':
|
2018-05-11 23:12:21 +02:00
|
|
|
|
return post_action()
|
2018-05-04 23:25:07 +02:00
|
|
|
|
else:
|
2018-05-11 23:12:21 +02:00
|
|
|
|
return get_action()
|
2018-05-04 23:25:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
app.run(host='0.0.0.0', debug=True)
|