]>
git.datanom.net - liogui.git/blob - webapp/__init__.py
3 from flask
import Flask
7 #logging.basicConfig(filename='message.log',
9 # format='%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s')
11 def create_app(test_config
=None):
12 # create and configure the app
13 app
= Flask(__name__
, instance_relative_config
=True)
14 app
.config
.from_mapping(
16 DATABASE
=os
.path
.join(app
.instance_path
, 'app.db'),
19 if test_config
is None:
20 # load the instance config, if it exists, when not testing
21 app
.config
.from_pyfile('config.py', silent
=True)
23 # load the test config if passed in
24 app
.config
.from_mapping(test_config
)
26 # ensure the instance folder exists
28 os
.makedirs(app
.instance_path
)
36 app
.register_blueprint(auth
.bp
)
38 from . import dashboard
39 app
.register_blueprint(dashboard
.bp
)
40 app
.add_url_rule('/', endpoint
='index')
This page took 0.639283 seconds and 6 git commands to generate.