forked from cofablab/tokenscan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
33 lines (22 loc) · 738 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
import commands
from flask import Flask
from live import views
def create_app():
"""An application factory, as explained here: http://flask.pocoo.org/docs/patterns/appfactories/.
:param config_object: The configuration object to use.
"""
app = Flask(__name__.split('.')[0])
register_commands(app)
register_blueprints(app)
return app
def register_commands(app):
"""Register Click commands."""
app.cli.add_command(commands.test)
app.cli.add_command(commands.lint)
app.cli.add_command(commands.clean)
app.cli.add_command(commands.urls)
def register_blueprints(app):
"""Register Flask blueprints."""
app.register_blueprint(views.blueprint)
return None
app = create_app()