This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
2018-07-17 18:57:29 +00:00
|
|
|
"""
|
|
|
|
Example app with minimal configuration.
|
|
|
|
|
|
|
|
Use this as a starting point.
|
|
|
|
"""
|
2022-01-17 11:55:42 +00:00
|
|
|
from flask_wtf.csrf import CSRFProtect
|
|
|
|
|
|
|
|
from ereuse_devicehub.config import DevicehubConfig
|
|
|
|
from ereuse_devicehub.devicehub import Devicehub
|
|
|
|
from ereuse_devicehub.inventory.views import devices
|
2022-04-04 11:41:36 +00:00
|
|
|
from ereuse_devicehub.labels.views import labels
|
2022-01-17 11:55:42 +00:00
|
|
|
from ereuse_devicehub.views import core
|
|
|
|
|
|
|
|
app = Devicehub(inventory=DevicehubConfig.DB_SCHEMA)
|
|
|
|
app.register_blueprint(core)
|
|
|
|
app.register_blueprint(devices)
|
2022-04-04 11:41:36 +00:00
|
|
|
app.register_blueprint(labels)
|
2018-07-17 18:57:29 +00:00
|
|
|
|
2022-01-17 11:55:42 +00:00
|
|
|
# configure & enable CSRF of Flask-WTF
|
|
|
|
# NOTE: enable by blueprint to exclude API views
|
|
|
|
# TODO(@slamora: enable by default & exclude API views when decouple of Teal is completed
|
|
|
|
csrf = CSRFProtect(app)
|
|
|
|
csrf.protect(core)
|
|
|
|
csrf.protect(devices)
|