# Plotly express on Heroku

**URL:** <https://community.plotly.com/t/plotly-express-on-heroku/22284>\
**Category:** Dash Python\
**Created:** [April 14, 2019, 5:16pm UTC](https://community.plotly.com/t/plotly-express-on-heroku/22284 "2019-04-14T17:16:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxt](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/maxt/32/4972_2.png) [@maxt](https://community.plotly.com/u/maxt)\
**Post date:** [April 14, 2019, 5:16pm UTC](https://community.plotly.com/t/plotly-express-on-heroku/22284/1 "2019-04-14T17:16:05Z")

</div>

Hi  
I wonder if someone have managed to run a Dash page with a Plotly express chart on Heroku? If that is the case, could you provide me with a simple example?

This is what I tried:  
import dash  
import dash\_core\_components as dcc  
import dash\_html\_components as html  
import plotly\_express as px  
import pandas as pd

```
df = pd.read_csv('2011_us_ag_exports.csv')

app = dash.Dash()
server = app.server

app.layout = html.Div(
    html.Div([
        dcc.Graph(figure=px.scatter(df, x="beef", y="pork")
    ])
)

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

```

requirements.txt contains  
certifi==2018.4.16  
chardet==3.0.4  
click==6.7  
dash==0.36.0  
dash-core-components==0.43.0  
dash-html-components==0.13.5  
dash-renderer==0.12.1  
decorator==4.3.0  
Flask==1.0.2  
Flask-Compress==1.4.0  
gunicorn==19.8.1  
idna==2.6  
ipython-genutils==0.2.0  
itsdangerous==0.24  
Jinja2==2.10.1  
jsonschema==2.6.0  
jupyter-core==4.4.0  
MarkupSafe==1.0  
nbformat==4.4.0  
pandas==0.22.0  
plotly==2.5.1  
plotly\_express==0.1.3  
pytz==2018.4

six==1.11.0  
traitlets==4.3.2

Werkzeug==0.14.1

---

<div class="post-metadata">

**Author:** ![nicolaskruchten](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/nicolaskruchten/32/7018_2.png) [@nicolaskruchten](https://community.plotly.com/u/nicolaskruchten)\
**Post date:** [April 15, 2019, 2:42pm UTC](https://community.plotly.com/t/plotly-express-on-heroku/22284/2 "2019-04-15T14:42:26Z")

</div>

I’d be happy to try to help! Did what you tried not work? If so, why not, what happens?

---

<div class="post-metadata">

**Author:** ![SaltyCoco](https://avatars.discourse-cdn.com/v4/letter/s/6bbea6/32.png) [@SaltyCoco](https://community.plotly.com/u/SaltyCoco)\
**Post date:** [February 24, 2020, 3:34pm UTC](https://community.plotly.com/t/plotly-express-on-heroku/22284/3 "2020-02-24T15:34:32Z")

</div>

You are missing a ) at the end of the Graph component.

app.layout = html.Div(  
html.Div([  
dcc.Graph(figure=px.scatter(df, x=“beef”, y=“pork”))  
])  
)

On a side note, all the heroku apps I have using px do not create the figure in the layout. I have the figure in a callback or create a def. Shouldn’t matter but as the apps get larger you will be thankful.
