-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
41 lines (31 loc) · 1.28 KB
/
main.py
File metadata and controls
41 lines (31 loc) · 1.28 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
from flask import Flask, render_template
from flask_appconfig import AppConfig
from flask_bootstrap import Bootstrap
from integrals import integral_blueprint
from os import walk, path
def create_app(configfile=None):
flask_app = Flask(__name__)
AppConfig(flask_app, configfile) # Flask-Appconfig is not necessary, but
# highly recommend =)
# https://github.com/mbr/flask-appconfig
Bootstrap(flask_app)
# in a real app, these should be configured through Flask-Appconfig
flask_app.config['SECRET_KEY'] = 'devkey'
flask_app.config['RECAPTCHA_PUBLIC_KEY'] = \
'6Lfol9cSAAAAADAkodaYl9wvQCwBMr3qGR_PPHcw'
flask_app.register_blueprint(integral_blueprint)
@flask_app.route('/')
def index():
return render_template('index.html')
return flask_app
app = create_app()
extra_dirs = ['templates', 'static']
extra_files = extra_dirs[:]
for extra_dir in extra_dirs:
for dirname, dirs, files in walk(extra_dir):
for filename in files:
filename = path.join(dirname, filename)
if path.isfile(filename):
extra_files.append(filename)
if __name__ == '__main__':
app.run(debug=True, extra_files=extra_files)