Added mongodb stuff
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
Pünkösd Marcell 2021-04-14 19:30:04 +02:00
parent 7a3cb2afd8
commit 85fc2aeecb
5 changed files with 10 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import sentry_sdk
from sentry_sdk.integrations.flask import FlaskIntegration
from flask import Flask
from utils import register_all_error_handlers
from utils import register_all_error_handlers, mongo
# import views
from views import ProgramView
@ -25,6 +25,8 @@ app = Flask(__name__)
app.config.from_object(Config)
register_all_error_handlers(app)
# init mongodb
mongo.init_app(app)
# register views
for view in [ProgramView]:

View File

@ -7,6 +7,7 @@ Configuration
class Config:
MONGO_URI = os.environ["MONGO_URI"]
SECRET_KEY = os.environ.get("SECRET_KEY", os.urandom(12))
CORS_ORIGINS = os.environ.get("ALLOWED_ORIGINS", "*")

View File

@ -1,3 +1,4 @@
#!/usr/bin/env python3
from .require_decorators import json_required
from .error_handlers import register_all_error_handlers
from .error_handlers import register_all_error_handlers
from .db import mongo

View File

@ -0,0 +1,3 @@
from flask_pymongo import PyMongo
mongo = PyMongo()

View File

@ -7,3 +7,4 @@ marshmallow
Flask-Classful
sentry-sdk
Flask-PyMongo~=2.3.0