display bokeh server online

Starting to look into putting my app online. Let’s assume I have my Apache all set up to run a bokeh server.

I went through https://bokeh.pydata.org/en/latest/docs/user_guide/server.html#userguide-server-applications-lifecycle

But it is still unclear to me how to make basic stuff like that happen:

I got my domain like www.mydomain.com, each user has their own webspace, they get a public_html/ folder in their personal directories on the server.

If I put mywebpage.html in my public_html/ folder, you can see it online by going to the url www.mydomain.com/~myusername/mywebpage.html

Now I have an app “myapp”. Do I just put “myapp” in public_html/ and run “bokeh serve myapp” in that directory to have it available at www.mydomain.com/~myusername/myapp ?

I would expect the webpage I linked to show minimal steps to get a minimal app online:

for example if myapp only consists of that:

main.py:

from bokeh.io import curdoc
from bokeh.plotting import figure

curdoc().add_root(figure())

``

Apache configuration aside, how do I get that to show up on a webpage at www.mydomain.com/~myusername/myapp for everyone to see?

I don’t know about online in your case, but may be my scenario will give you a hint. I do it locally with Django, and all I have to do is run “bokeh serve --allow-websocket-origin=127.0.0.1:8000 Script.py” on my terminal, That will allow requests from port 8000 which my Django is running from.

And on Django, I add the code below and render bokeh_script variable

session = pull_session(url = “http://localhost:5006/Script”)
bokeh_script=autoload_server(None,url = “http://localhost:5006/Script”, session_id= session.id)

``

I used “localhost:50006” because that is the port bokeh server(tornado) is running from.

Also, if you want to post static plots, you don’t even need a server.

Thank you, unfortunately I never used django, that would be quite a bit of additional learning I guess.

I have put a lot of static plots on my webspace before.

I have an app that I run locally which uses python callbacks and that I would like to make available there

···

Le vendredi 22 septembre 2017 12:02:22 UTC-4, kiluvya a écrit :

I don’t know about online in your case, but may be my scenario will give you a hint. I do it locally with Django, and all I have to do is run “bokeh serve --allow-websocket-origin=127.0.0.1:8000 Script.py” on my terminal, That will allow requests from port 8000 which my Django is running from.

And on Django, I add the code below and render bokeh_script variable

session = pull_session(url = “http://localhost:5006/Script”)
bokeh_script=autoload_server(None,url = “http://localhost:5006/Script”, session_id= session.id)

``

I used “localhost:50006” because that is the port bokeh server(tornado) is running from.

Also, if you want to post static plots, you don’t even need a server.