annot-server/webapp/__init__.py
changeset 22 986ee928a866
child 23 16a1925df2df
equal deleted inserted replaced
21:89d235bcbbf3 22:986ee928a866
       
     1 #
       
     2 # See LICENCE for detail
       
     3 # Copyright (c) 2014 IRI
       
     4 #
       
     5 
       
     6 import uuid
       
     7 import json
       
     8 
       
     9 from flask import Flask
       
    10 
       
    11 import config
       
    12 import database
       
    13 
       
    14 app = Flask(__name__)
       
    15 app.secret_key = str(uuid.uuid4())
       
    16 app.debug = config.DEBUG
       
    17 app.config.from_object(config)
       
    18 
       
    19 import webapp.views
       
    20 
       
    21 @app.teardown_appcontext
       
    22 def shutdown_session(exception=None):
       
    23     database.db_session.remove()