Skip to content

Commit

Permalink
Get Flask version from metadata
Browse files Browse the repository at this point in the history
This fixes the __version__ deprecation warning.
nickjj committed Nov 15, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 3d1256b commit 0feecc7
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@ Changelog](https://keepachangelog.com/en/1.0.0/).

### Changed

- Get Flask version in `hello/page/views.py` with metadata instead of `__version__`

#### Languages and services

- Update `Python` to `3.13.0`
4 changes: 2 additions & 2 deletions hello/page/views.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from importlib.metadata import version

from flask import Blueprint
from flask import __version__
from flask import render_template

from config.settings import DEBUG
@@ -13,7 +13,7 @@
def home():
return render_template(
"page/home.html",
flask_ver=__version__,
flask_ver=version("flask"),
python_ver=os.environ["PYTHON_VERSION"],
debug=DEBUG,
)

0 comments on commit 0feecc7

Please sign in to comment.