# Convert http to https

**URL:** <https://community.plotly.com/t/convert-http-to-https/44857>\
**Category:** Dash Python\
**Created:** [September 14, 2020, 5:16am UTC](https://community.plotly.com/t/convert-http-to-https/44857 "2020-09-14T05:16:48Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ajeetesh](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Ajeetesh](https://community.plotly.com/u/Ajeetesh)\
**Post date:** [September 14, 2020, 5:16am UTC](https://community.plotly.com/t/convert-http-to-https/44857/1 "2020-09-14T05:16:48Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tschlich](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/tschlich/32/23602_2.png) [@tschlich](https://community.plotly.com/u/tschlich)\
**Post date:** [October 12, 2020, 5:16pm UTC](https://community.plotly.com/t/convert-http-to-https/44857/2 "2020-10-12T17:16:50Z")

</div>

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…”

---

<div class="post-metadata">

**Author:** ![Croll12](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@Croll12](https://community.plotly.com/u/Croll12)\
**Post date:** [October 12, 2020, 6:19pm UTC](https://community.plotly.com/t/convert-http-to-https/44857/3 "2020-10-12T18:19:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![tschlich](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/tschlich/32/23602_2.png) [@tschlich](https://community.plotly.com/u/tschlich)\
**Post date:** [October 13, 2020, 5:43am UTC](https://community.plotly.com/t/convert-http-to-https/44857/4 "2020-10-13T05:43:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![riskfree](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@riskfree](https://community.plotly.com/u/riskfree)\
**Post date:** [February 20, 2021, 9:33pm UTC](https://community.plotly.com/t/convert-http-to-https/44857/5 "2021-02-20T21:33:02Z")

</div>

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

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

```

---

<div class="post-metadata">

**Author:** ![tschlich](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/tschlich/32/23602_2.png) [@tschlich](https://community.plotly.com/u/tschlich)\
**Post date:** [February 21, 2021, 6:05pm UTC](https://community.plotly.com/t/convert-http-to-https/44857/6 "2021-02-21T18:05:38Z")

</div>

```auto
app = dash.Dash( __name__ , external_stylesheets=external_stylesheets)
server = app.server
SSLify(server)

```

---

<div class="post-metadata">

**Author:** ![riskfree](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@riskfree](https://community.plotly.com/u/riskfree)\
**Post date:** [February 21, 2021, 6:27pm UTC](https://community.plotly.com/t/convert-http-to-https/44857/7 "2021-02-21T18:27:07Z")

</div>

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?

```auto
if __name__ == ' __main__':
    app.run_server()

```

---

<div class="post-metadata">

**Author:** ![tschlich](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/tschlich/32/23602_2.png) [@tschlich](https://community.plotly.com/u/tschlich)\
**Post date:** [February 21, 2021, 10:01pm UTC](https://community.plotly.com/t/convert-http-to-https/44857/8 "2021-02-21T22:01:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![riskfree](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@riskfree](https://community.plotly.com/u/riskfree)\
**Post date:** [February 22, 2021, 5:12pm UTC](https://community.plotly.com/t/convert-http-to-https/44857/9 "2021-02-22T17:12:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![tschlich](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/tschlich/32/23602_2.png) [@tschlich](https://community.plotly.com/u/tschlich)\
**Post date:** [February 22, 2021, 6:17pm UTC](https://community.plotly.com/t/convert-http-to-https/44857/10 "2021-02-22T18:17:42Z")

</div>

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

[Here is my pyproject.toml](https://github.com/schlich/gram/blob/master/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.

---

<div class="post-metadata">

**Author:** ![riskfree](https://avatars.discourse-cdn.com/v4/letter/r/59ef9b/32.png) [@riskfree](https://community.plotly.com/u/riskfree)\
**Post date:** [February 22, 2021, 6:25pm UTC](https://community.plotly.com/t/convert-http-to-https/44857/11 "2021-02-22T18:25:32Z")

</div>

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