Commit b415c1131c6cd5ed0d3cab16bd8741a039be3e1c
- Diff rendering mode:
- inline
- side by side
server/alipi.py
(3 / 6)
  | |||
16 | 16 | app = Flask(__name__) | |
17 | 17 | @app.before_request | |
18 | 18 | def first(): | |
19 | #return "<h1>Hello</h1>"; | ||
20 | #g.connection = pymongo.Connection('localhost',27017) #Create the object once and use it. | ||
21 | #g.db = g.connection['dev_alipi'] | ||
22 | pass | ||
19 | g.connection = pymongo.Connection('localhost',27017) #Create the object once and use it. | ||
20 | g.db = g.connection['dev_alipi'] | ||
23 | 21 | @app.teardown_request | |
24 | 22 | def close(exception): | |
25 | #g.connection.disconnect() | ||
26 | pass | ||
23 | g.connection.disconnect() | ||
27 | 24 | @app.route('/') | |
28 | 25 | def start_page() : | |
29 | 26 | d = {} |