-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
43 lines (33 loc) · 1.26 KB
/
app.py
File metadata and controls
43 lines (33 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# -*- coding: utf-8 -*-
from flask import Flask, render_template, request
from bot_logics.bot_logic import _get_todays_message, get_this_week_params
import re
import logging
app = Flask(__name__)
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s %(name)s:%(lineno)d - %(message)s")
logger = logging.getLogger(__name__)
@app.route("/")
def index():
return sauna()
# Here is the new beautiful page
@app.route("/displaysauna")
def displaysauna():
params = get_this_week_params()
first_shift = params["first_shift"]
second_shift = params["second_shift"]
week = params["weeknumber"]
inspiration = params["inspiration"]
return render_template('displaysauna.html',
first_shift=first_shift,
second_shift=second_shift,
week=week,
inspiration=inspiration)
@app.route("/refreshingsauna")
def foundation():
return render_template('refreshingpage.html', text=_get_todays_message(ping_channel=False))
@app.route("/sauna")
def sauna():
return render_template('refreshingpage.html', text=_get_todays_message(ping_channel=False))
if __name__ == "__main__":
logger.info('Start host')
app.run(host='0.0.0.0', port=8000)