comparison src/ltpdarepo/admin.py @ 201:ac0a27a72b9e

Reorganize Flask application setup code.
author Daniele Nicolodi <daniele@grinta.net>
date Wed, 16 Nov 2011 16:09:39 +0100
parents fbab144c296c
children 10801d55c5d5
comparison
equal deleted inserted replaced
200:6bcf931c0e59 201:ac0a27a72b9e
17 import sqlalchemy 17 import sqlalchemy
18 HAS_SQL_ALCHEMY = True 18 HAS_SQL_ALCHEMY = True
19 except ImportError: 19 except ImportError:
20 HAS_SQL_ALCHEMY = False 20 HAS_SQL_ALCHEMY = False
21 21
22 from . import app
23 app.config.from_pyfile('config.py')
24 22
25 from .user import User 23 from .user import User
26 from .database import Database 24 from .database import Database
27 from .config import HOSTNAME, DATABASE, USERNAME, PASSWORD 25 from .config import HOSTNAME, DATABASE, USERNAME, PASSWORD
26
27
28 from . import Application
29 app = Application()
28 30
29 31
30 @contextmanager 32 @contextmanager
31 def interact(app): 33 def interact(app):
32 # fake request 34 # fake request