Page 1 of 1

Using Dash

Posted: Thu 12 Apr 12 2018 1:17 pm
by Daniel Wee

Code: Select all

import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc
import dash_html_components as html

app = dash.Dash()

# define the layout of the page
app.layout = html.Div([
	dcc.Input(id='input', value='Enter something here!', type='text'),

# define the callback function
# this decorator function replaces some called function and performs the actual value update
# the function to update the value must immediately follow this decorator
	# change element marked 'output' whenever element 'input' changes its 'value'
	Output(component_id='output', component_property='children'),
	[Input(component_id='input', component_property='value')]
def update_value(input_data):
	return 'Input: "{}"'.format(input_data)

if __name__ == "__main__":

Re: Using Dash

Posted: Sun 06 May 06 2018 12:58 am
by Daniel Wee
To configure apache2 to redirect an alias to a different port, use proxy functions:- ... internally ... untu-16-04

This somewhat works but seems to fail in loading the layout. May need more work on the code.

Trying to resolve "Layout not loading issue"

Posted: Sun 06 May 06 2018 1:25 am
by Daniel Wee

Re: Using Dash

Posted: Sun 06 May 06 2018 1:35 am
by Daniel Wee
Resolution involved:-

Setting up mod_wsgi to work:-

see files:-

See Proxy lines for port 80 and 443 (SSL)

See how to get apache2 to serve up dash on given port 8050

You'll need to enable this with:-

Code: Select all

sudo a2ensite attendance
sudo service apache2 reload
Also need to make sure apache2 is listening on the port. See:-

See intermediate launch file:-
*note especially the hash bang line at the start

See dash python file:-
* see line with app.config.requests_pathname_prefix = "" ... out/8139/5

Re: Using Dash

Posted: Mon 07 May 07 2018 1:02 am
by Daniel Wee