feat: show warning if threads blueprint is missing
This commit is contained in:
parent
24cdb8f620
commit
c81887024a
1 changed files with 7 additions and 2 deletions
9
web.py
9
web.py
|
@ -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__)
|
||||||
app.register_blueprint(threads, url_prefix='/threads')
|
|
||||||
|
try:
|
||||||
|
from threads.threads import 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
|
||||||
|
|
Loading…
Reference in a new issue