feat: show warning if threads blueprint is missing

This commit is contained in:
Ayo Ayco 2024-05-18 22:35:41 +02:00
parent 24cdb8f620
commit c81887024a

7
web.py
View file

@ -2,10 +2,15 @@ from flask import Flask, send_from_directory
from flask_caching import Cache from flask_caching import Cache
import sentry_sdk import sentry_sdk
import json import json
from threads.threads import threads
app = Flask(__name__) app = Flask(__name__)
try:
from threads.threads import threads
app.register_blueprint(threads, url_prefix='/threads') app.register_blueprint(threads, url_prefix='/threads')
except ImportError:
print(' ! threads blueprint missing')
app.config.from_file("config.json", load=json.load) app.config.from_file("config.json", load=json.load)
# caching # caching