diff options
| author | Dennis Fink | 2026-11-12 19:57:08 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-12 19:57:08 +0100 |
| commit | 4bd1d9e348918b2e55db47a1ac3489d035cf55e2 (patch) | |
| tree | f7ed41a374a8a4136792039a262dc62aa8cf8c59 /webmentions_ssg/extensions.py | |
| parent | 7035e9f9467684cccae2b7ff3faaa62e6a9f91aa (diff) | |
| download | webmentions-ssg-4bd1d9e348918b2e55db47a1ac3489d035cf55e2.tar.gz webmentions-ssg-4bd1d9e348918b2e55db47a1ac3489d035cf55e2.zip | |
refactor(core): split modules by responsibility
Break up monolithic views, task helpers, networking, CLI, and
application extension setup so each module owns a focused concern.
Reorganize the test suite around the new boundaries while preserving
existing Webmention behavior and coverage.
Diffstat (limited to 'webmentions_ssg/extensions.py')
| -rw-r--r-- | webmentions_ssg/extensions.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/webmentions_ssg/extensions.py b/webmentions_ssg/extensions.py new file mode 100644 index 0000000..0afec9c --- /dev/null +++ b/webmentions_ssg/extensions.py @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me> +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Unbound extensions shared across Flask application instances.""" + +from flask_bootstrap import Bootstrap5 +from flask_limiter import Limiter +from flask_limiter.util import get_remote_address +from flask_mail import Mail +from flask_migrate import Migrate +from flask_sqlalchemy import SQLAlchemy +from flask_wtf.csrf import CSRFProtect +from sqlalchemy.orm import DeclarativeBase + +from .tasks.extension import Huey + + +class Base(DeclarativeBase): + pass + + +CSRF = CSRFProtect() +BOOTSTRAP = Bootstrap5() +DATABASE = SQLAlchemy(model_class=Base) +MIGRATE = Migrate() +HUEY = Huey() +MAIL = Mail() +LIMITER = Limiter(key_func=get_remote_address) |
