complete post request handler
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@ -4,8 +4,9 @@ import sentry_sdk
|
||||
from flask import Flask
|
||||
from flask_restful import Api
|
||||
from sentry_sdk.integrations.flask import FlaskIntegration
|
||||
import pika
|
||||
|
||||
from config import SENTRY_DSN, RELEASE_ID, RELEASEMODE, PORT, DEBUG
|
||||
from config import *
|
||||
import db
|
||||
from resources import *
|
||||
|
||||
@ -27,13 +28,19 @@ if SENTRY_DSN:
|
||||
environment=RELEASEMODE
|
||||
)
|
||||
|
||||
|
||||
app = Flask(__name__)
|
||||
app.config['SQLALCHEMY_DATABASE_URI'] = f"postgresql://{POSTGRES_USERNAME}:{POSTGRES_PASSWORD}@{POSTGRES_HOSTNAME}:5432/{POSTGRES_DB}"
|
||||
api = Api(app)
|
||||
db.init_app(app)
|
||||
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
|
||||
rabbitmq = pika.BlockingConnection(pika.ConnectionParameters(host=RABBITMQ_HOST))
|
||||
rabbitmq_channel = rabbitmq.channel()
|
||||
rabbitmq_channel.queue_declare(RABBITMQ_QUEUE)
|
||||
|
||||
formatter = logging.Formatter(
|
||||
fmt="%(asctime)s - %(levelname)s - %(module)s - %(message)s"
|
||||
)
|
||||
|
Reference in New Issue
Block a user