Skip to content

Commit 5841804

Browse files
committed
Try adding ssl for heroku db
1 parent 0e7148c commit 5841804

File tree

4 files changed

+4
-1
lines changed

4 files changed

+4
-1
lines changed

app.db

0 Bytes
Binary file not shown.

app/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import logging
99
from logging.handlers import SMTPHandler, RotatingFileHandler
1010
import os
11+
from flask_sslify import SSLify
1112

1213
app = Flask(__name__)
1314
app.config.from_object(Config)
@@ -17,6 +18,7 @@
1718
db = SQLAlchemy(app)
1819
migrate = Migrate(app, db)
1920
mail = Mail(app)
21+
sslify = SSLify(app)
2022

2123

2224
def start_ngrok():

config.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Config(object):
1010
SECRET_KEY = os.environ.get('SECRET_KEY') or 'you-will-never-guess'
1111

1212
# Database configuration
13-
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
13+
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', sslmode='require') or \
1414
'sqlite:///' + os.path.join(basedir, 'app.db')
1515
SQLALCHEMY_TRACK_MODIFICATIONS = False
1616

requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Flask-Login==0.5.0
1010
Flask-Mail==0.9.1
1111
Flask-Migrate==2.7.0
1212
Flask-SQLAlchemy==2.4.4
13+
Flask-SSLify==0.1.5
1314
Flask-WTF==0.14.3
1415
greenlet==1.0.0
1516
gunicorn==20.0.4

0 commit comments

Comments
 (0)