PythonAnywhere Forums

Deploy an interactive web app using dash (plot.ly)

Greeting fellow slytherins

In a search to build an interactive data analytics app on flask, I stumbled upon this framework for building interactive web applications. It is build on top of flask, so I was wondering how could I deploy a dash app on py_anywhere? Could I deploy it inside an other flask app (someway)?

Any help would be appreciated. Thanks

From a quick cursory glance, I don't see anything that makes me worry it wouldn't work, so I'd say it's definitely worth a try...

Glad to hear that. However I don't know how to approach it. Dash behaving like a server, should I deploy it directly or build a new flask app and deploy it within that. I am new to flask and web development so any help would be great.

That's probably a good question to ask of the Dash maintainers -- the specific question to ask them (or to search for in their documentation) would be how you deploy it as a WSGI app. WSGI is the protocol our system uses to communicate between the web servers and your code.

Alright, thanks for your answer @giles. Since then I went with another, simpler route. But I will keep that in mind in case I want to give dash another chance. Cheers

I'm also interested in this, any developments?

Try going through the dash tutorial? At a cursory glance it is compatible with PythonAnywhere (so no new developments there).

If you are confused about how to setup dash on PythonAnywhere, I would suggest starting a flask app under the webapps tab. You will see a sample flask app which exports an app object (this is imported by the wsgi.py file, and is what we use to run your server). You can then add to / change that flask app by adding in dash components. (eg: by changing the line app = Flask(__name__) to app = dash.Dash().

Giles, this is another one for the list of webapps that people might be offered as default installs!!

Good suggestion! I've added it to our to-do list. No promises as to timelines, though...

Hi Giles, I did the following in order to try dash:

  • Create a virtualenv and install required packages for dash

  • Modified flask_app.py with the following code

  • I didnt modify the WSGI file

I got this error on the logs:

2017-07-21 17:08:59,601: Error running WSGI application

2017-07-21 17:08:59,601: TypeError: 'Dash' object is not callable

How can I solve it?

Thank you

it looks like you're following the official instructions correctly, so that's a strange error. maybe ask the Dash developers, or maybe they have a support forum?

Hi there, someone else had a similar problem. see if this solution works for you? https://www.pythonanywhere.com/forums/topic/11625/#id_post_43420

Hi harry, thank you very much for the info. Now is working! :)