-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (20 loc) · 770 Bytes
/
Copy pathmain.py
File metadata and controls
31 lines (20 loc) · 770 Bytes
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
import datetime
import ephem
from babel.dates import format_date, format_datetime
from flask import Flask, render_template, send_file
app = Flask(__name__)
@app.route('/')
def index():
date_today = datetime.date.today()
date_time_full_moon = ephem.next_full_moon(date_today)
date_today = format_date(date_today, locale='FR')
date = format_datetime(date_time_full_moon.datetime(), locale='FR')
return render_template("index.html", today=date_today, date=date)
@app.route('/sw.js')
def serve_sw():
return send_file('sw.js', mimetype='application/javascript')
@app.route('/manifest.json')
def serve_manifest():
return send_file('manifest.json', mimetype='application/manifest+json')
if __name__ == '__main__':
app.run(debug=True)