-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (24 loc) · 836 Bytes
/
app.py
File metadata and controls
30 lines (24 loc) · 836 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
import logging
from flask import Flask, render_template
from whcfix.fixtures import fixtures
from whcfix.base import base
import whcfix.settings as settings
import os
app = Flask(__name__, template_folder='whcfix/templates',
static_folder='whcfix/static', static_url_path='/static')
app.secret_key = settings.DEVELOPMENT_KEY
app.config['UPLOAD_FOLDER'] = settings.UPLOAD_FOLDER
@app.errorhandler(Exception)
def handle_exception(err):
logging.exception("")
return render_template("501.html")
app.register_blueprint(base)
app.register_blueprint(fixtures)
if __name__ == '__main__':
current_directory = os.path.dirname(os.path.realpath(__file__))
os.chdir(current_directory)
logging.basicConfig(level=logging.DEBUG)
app.debug = True
app.run()
else:
logging.basicConfig(level=logging.INFO)