Skip to content

Commit

Permalink
Load debugtoolbar in a cleaner way
Browse files Browse the repository at this point in the history
  • Loading branch information
TheReverend403 committed Feb 23, 2024
1 parent fc6694d commit 6002bc3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ RUN addgroup --gid 1000 --system $APP_USER && \

WORKDIR /app

ENV FLASK_ENV="development"
ENV FLASK_DEBUG=1 \
FLASK_ENV="development"

VOLUME ["/static", "/config", "/data"]
EXPOSE 5000
Expand Down
10 changes: 6 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions pste/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# You should have received a copy of the GNU General Public License
# along with pste. If not, see <https://www.gnu.org/licenses/>.

from importlib.util import find_spec

from dynaconf import Dynaconf, FlaskDynaconf
from flask_assets import Environment
from flask_login import LoginManager
Expand All @@ -29,16 +31,11 @@
assets = Environment()
debugbar = None

try:
import flask_debugtoolbar # noqa: F401
except ImportError:
pass
else:
if find_spec("flask_debugtoolbar"):
from flask_debugtoolbar import DebugToolbarExtension

debugbar = DebugToolbarExtension()


dynaconf = FlaskDynaconf(
dynaconf_instance=Dynaconf(
environments=False,
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Flask-Session = "^0.6.0"

[tool.poetry.group.dev.dependencies]
pre-commit = "^3.5.0"
Flask-DebugToolbar = "^0.13.0"
Flask-DebugToolbar = "^0.14.0"
ruff = "^0.2.1"
pre-commit-hooks = "^4.5.0"

Expand Down

0 comments on commit 6002bc3

Please sign in to comment.