-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.py
More file actions
54 lines (35 loc) · 1.2 KB
/
app.py
File metadata and controls
54 lines (35 loc) · 1.2 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
44
45
46
47
48
49
50
51
52
53
54
import os.path
from flask import Flask, render_template, send_file
from markupsafe import escape
from werkzeug.middleware.proxy_fix import ProxyFix
app = Flask(__name__)
@app.route('/')
def hello_world():
return render_template('index.html')
@app.route('/building/')
def building():
return render_template('building/index.html')
@app.route('/contributing/')
def contributing():
return render_template('contributing/index.html')
@app.route('/learning/')
def learning():
return render_template('learning/index.html')
@app.route('/learning/days/<day>')
def learning_day(day):
return render_template(f'learning/days/{escape(day)}')
@app.route('/learning/resources/')
def learning_resources():
return render_template('learning/resources.html')
@app.route('/learning/downloads/<file>')
def learning_file(file):
return send_file(f'./static/learning/downloads/{escape(file)}', as_attachment=True)
@app.route('/kernel-api/')
def kernel_api():
return render_template('kernel-api/index.html')
app.wsgi_app = ProxyFix(
app.wsgi_app, x_for=1, x_proto=1, x_host=1, x_prefix=1
)
app.config['TEMPLATES_AUTO_RELOAD'] = True
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0')