Convert http to https

Hi members, I have prepared a dashboard in dash and then implemented it on flask.
I want to know how to convert http: to https:

Kinldy guide

I would also like to know the suggested way to redirect http to https requests. I tried using flask-talisman but then my Dash app gets stuck “Loading…”

Put ssl_context=‘adhoc’ when calling
I use Gunicorn and then add the absolute paths to the certificates in the arguments of the wsgi file.

I ended up using SSLify even though it is supposedly outdated, the redirect from flask-talisman is not working on heroku, as warned.

Could you share how you did it with SSlify? When I add it like this the app does not work.

app = dash.Dash('__name__', external_stylesheets=[dbc.themes.BOOTSTRAP],
                meta_tags=[{'name': 'viewport',
                            'content': 'width=device=width, initial-scale=1.0'}],
sslify = SSLify(app)
server = app.server
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
server = app.server

That didn’t work for me either. Is there anything you need to do other than that? Do you end the app with the below?

if __name__ == '__main__':

yes, that’s the command i used. what kind of error are you getting?

When I push to heroku and open the app, it just says the app has an error - the standard heroku error page… When I remove SSLify, it works fine however.

You may want to look at your Heroku logs to further debug the issue.

Here is my pyproject.toml if it’s helpful, you may want to match your dependency versions to what’s in mine. I vaguely remember needing to downgrade my SSLify version or something similar.

ahh, I see. Let me try that. Thanks a lot!