# Elastic Bean Stalk, Dash, Flask, and Google Sites

**URL:** <https://community.plotly.com/t/elastic-bean-stalk-dash-flask-and-google-sites/24338>\
**Category:** Dash Python\
**Created:** [June 9, 2019, 11:09pm UTC](https://community.plotly.com/t/elastic-bean-stalk-dash-flask-and-google-sites/24338 "2019-06-09T23:09:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mddunlap924](https://avatars.discourse-cdn.com/v4/letter/m/8e8cbc/32.png) [@mddunlap924](https://community.plotly.com/u/mddunlap924)\
**Post date:** [June 9, 2019, 11:09pm UTC](https://community.plotly.com/t/elastic-bean-stalk-dash-flask-and-google-sites/24338/1 "2019-06-09T23:09:08Z")

</div>

My apologies for a redundant question but I’m relatively new to python and certainly new to dash and plotly. Basically, I’m kind of new to all of this computer stuff. Anyways, I’m stuck on embedding a dash graph into a webpage using an iframe and do not know where the issue resides. Can someone please help. The below is what I’m trying to do:  
\*Embed dash into flask and deploy using elastic bean stalk  
\*I’ve successfully deployed my application.py and requirements.txt files using elastic bean stalk see ([http://mydash-env-1.6fp3pk4uin.us-east-2.elasticbeanstalk.com/](http://mydash-env-1.6fp3pk4uin.us-east-2.elasticbeanstalk.com/)) but when I try to embed the url in an

application.py contains the following:

#!/usr/bin/env python3

# -_- coding: utf-8 -_-

“”"  
Created on Sat Jun 8 15:40:58 2019

“”"  
import flask  
import plotly.graph\_objs as go  
import dash  
import dash\_core\_components as dcc  
import dash\_html\_components as html  
from dash.dependencies import Input, Output

y1 = [0,1,2,3,4]  
y2 = [0,2,4,6,8]  
y3 = [0,4,-1,2,3]

server = flask.Flask( **name** )  
app = dash.Dash( **name** ,server=server)  
application = app.server

app.layout = html.Div([  
html.Label(‘Select Trend(s) to Plot’),  
dcc.Dropdown(id = ‘my-dropdown’,  
options = [  
{‘label’: ‘Y1’, ‘value’: ‘y1’},  
{‘label’: ‘Y2’, ‘value’: ‘y2’},  
{‘label’: ‘Y3’, ‘value’: ‘y3’},  
],  
value = [‘y1’],  
multi = True,  
),  
dcc.Graph(id=‘my-graph’)  
])

@app.callback(Output(‘my-graph’, ‘figure’),  
[Input(‘my-dropdown’, ‘value’)])

def update\_fig(selected\_dropdown\_value):  
trace = []  
for name in selected\_dropdown\_value:  
dropdown = {‘y1’: y1,‘y2’: y2,‘y3’: y3}  
y = dropdown[name]  
trace.append(go.Scatter(y=y,mode=‘lines’,name=f’{name}’))

```
figure = {'data': trace, 
	'layout': go.Layout(
		xaxis={'title':'X-axis'},
		yaxis={'title':'Y-axis'},
		title = 'Simple Plot'),
		}

return figure

```

if **name** == ‘ **main** ’:  
application.run(debug=True, port = 8080)
