This commit is contained in:
35
program_service/app.py
Normal file
35
program_service/app.py
Normal file
@@ -0,0 +1,35 @@
|
||||
#!/usr/bin/env python3
|
||||
from config import Config
|
||||
import sentry_sdk
|
||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||
from flask import Flask
|
||||
|
||||
from utils import register_all_error_handlers
|
||||
|
||||
# import views
|
||||
from views import ProgramView
|
||||
|
||||
# Setup sentry
|
||||
|
||||
if Config.SENTRY_DSN:
|
||||
sentry_sdk.init(
|
||||
dsn=Config.SENTRY_DSN,
|
||||
integrations=[FlaskIntegration()],
|
||||
send_default_pii=True,
|
||||
release=Config.RELEASE_ID,
|
||||
environment=Config.RELEASEMODE
|
||||
)
|
||||
|
||||
# create flask app
|
||||
app = Flask(__name__)
|
||||
app.config.from_object(Config)
|
||||
register_all_error_handlers(app)
|
||||
|
||||
|
||||
# register views
|
||||
for view in [ProgramView]:
|
||||
view.register(app, trailing_slash=False)
|
||||
|
||||
# start debuggig if needed
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
Reference in New Issue
Block a user