Skip to content

Commit

Permalink
Conditional Flask settings, refs #7
Browse files Browse the repository at this point in the history
  • Loading branch information
danielperna84 committed Jan 19, 2020
1 parent 5721cb2 commit b8b26e8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions hass_wh_triggers/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,12 @@
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///{}'.format(
os.path.join(os.path.dirname(os.path.abspath(__name__)), 'webauthn.db'))
app.config.update(
SQLALCHEMY_TRACK_MODIFICATIONS=False,
#SERVER_NAME=ORIGIN.split('/')[-1],
#SESSION_COOKIE_SECURE=True
)
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
if ORIGIN != 'localhost':
app.config.update(
SERVER_NAME=ORIGIN.split('/')[-1],
SESSION_COOKIE_SECURE=True
)
sk = os.environ.get('FLASK_SECRET_KEY')
app.secret_key = sk if sk else os.urandom(40)
db.init_app(app)
Expand Down

0 comments on commit b8b26e8

Please sign in to comment.