forked from eea/european.cache.registry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanage.py
executable file
·29 lines (23 loc) · 822 Bytes
/
manage.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
#!/usr/bin/env python
import logging
from fcs.app import create_app, create_manager
app = create_app()
def main():
default_format = '%(asctime)s - %(name)s - %(levelname)s: %(message)s'
default_datefmt = '%d-%m-%Y %H:%M'
logging.basicConfig(loglevel=logging.DEBUG,
format=default_format,
datefmt=default_datefmt)
logging.getLogger('werkzeug').setLevel(logging.INFO)
manager = create_manager(app)
manager.run()
if __name__ == "__main__":
try:
main()
except Exception as e:
if app.config['DEBUG'] or not app.config.get('SENTRY_DSN'):
raise
else:
if not (isinstance(e, SystemExit) and e.code == 0):
sentry = app.extensions['sentry']
sentry.captureException()