-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
39 lines (31 loc) · 969 Bytes
/
app.py
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
import sys, os
from flask import Flask, render_template
from flask_flatpages import FlatPages
from flask_frozen import Freezer # Added
#from flaskext.markdown import Markdown
DEBUG = True
FLATPAGES_AUTO_RELOAD = DEBUG
FLATPAGES_EXTENSION = '.json'
app = Flask(__name__)
app.config.from_object(__name__)
pages = FlatPages(app)
freezer = Freezer(app)
@app.route("/")
def index():
infos = pages.get_or_404("info")
return render_template('index.html', infos=infos)
@app.route("/experiences/")
def experience():
infos = pages.get_or_404("experiences")
return render_template('experiences.html', infos=infos)
@app.route("/projects/")
def project():
infos = pages.get_or_404("projects")
return render_template('projects.html', infos=infos)
if __name__ == "__main__":
if len(sys.argv) > 1 and sys.argv[1] == "build":
app.debug = False
app.testing = True
freezer.freeze()
else:
app.run(port=10001)