This repository was archived by the owner on Dec 19, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 11SECRET_KEY = ' dwellingly'
22PYTHONPATH = ${ PWD } :${ PYTHONPATH }
33
4- # To set the database to postgresql. Uncomment the env vars below
4+ # # Uncomment to see logging from sqlalchemy
5+ # DB_LOGGING=ON
6+
7+ # # To set the database to postgresql. Uncomment the env vars below
58# DEV_DATABASE_URL=postgresql://localhost/dwellingly_development
69# TEST_DATABASE_URL=postgresql://localhost/dwellingly_test
Original file line number Diff line number Diff line change 1+ import os
12import logging
23from flask import Flask
34from flask_jwt_extended import JWTManager
@@ -55,8 +56,10 @@ def check_if_token_in_blocklist(jwt_header, decrypted_token):
5556 def format_unauthorized_message (message ):
5657 return {app .config ["JWT_ERROR_MESSAGE_KEY" ]: message .capitalize ()}, 401
5758
58- logging .basicConfig ()
59- logging .getLogger ("sqlalchemy.engine" ).setLevel (logging .INFO )
59+ if os .getenv ("DB_LOGGING" ):
60+ logging .basicConfig ()
61+ logging .getLogger ("sqlalchemy.engine" ).setLevel (logging .INFO )
62+
6063 db .init_app (app )
6164 ma .init_app (app )
6265 return app
You can’t perform that action at this time.
0 commit comments