On Sep 11, 2018, at 11:11, [email protected] wrote:
Bryan, thanks much for help on this, apologies for my poor clarification! I am trying to get the Bokeh server app to use a template directly itself, I am then just trying to route the through a nginx proxy. I have the following dir structure:
fireapp
- main.py
templates
- index.html
data
- datafile.h5
This seems quite similar to the gapminder example to me which just specifies super() in the content block but I seem to be getting the same result using this case as well.
Evan
On Tuesday, September 11, 2018 at 10:54:04 AM UTC-7, Bryan Van de ven wrote:
Hi,
I think there is some confusion, which is perhaps understandable. The usage of embed.roots, etc is for when you want a Bokeh server app to use a template directly, itself. My understanding from your question is that you have the converse task: you have a bokeh server app, and you want to embed it in a larger template, e.g. maybe inside a Flask or Django or other web app page. Is this not correct?
If it is correct, server_embed returns a full <script> tag, you only need to put that in your document wherever you want the bokeh app to embed itself. There are no set variable names to adhere to in that case, you can use whatever you like.
Thanks,
Bryan
> On Sep 11, 2018, at 10:48, ebur...@airsci.com wrote:
>
> Thanks Bryan, I now have a line
>
> script = server_document("http://myserver.com/fireapp"\)
>
> in main.py. My remaining issue is what variable name to use in the jinja template to place that script tag? I've tried 'server_document' and 'script'. Following examples suggested here, I added a 'name' to the layout:
>
> layout = column(row(state_tribe_radio, state_select), row(xaxis_select, yaxis_select, comparison_select, button), p, name='layout')
>
> and then this line in index.html:
>
> {{ embed(roots.layout) }}
>
> This works in the direct case but the element ids don't seem to match up when I go through the proxy.
>
> Evan
>
>
>
> On Monday, September 10, 2018 at 4:40:04 PM UTC-7, Bryan Van de ven wrote:
> If you are embedding a Bokeh server app, you need to use one of the embed methods "server_document" or (less likely) "server_session" to template a script tag in your page. The plot_div and plot_script parameters only show up for standalone (i.e. non-Bokeh server app) cases:
>
> https://bokeh.pydata.org/en/latest/docs/user_guide/embed.html#bokeh-applications
>
> Bryan
>
> > On Sep 10, 2018, at 16:33, ebur...@airsci.com wrote:
> >
> > I have a bokeh server application running on a single ec2 instance and am trying to setup a nginx proxy server on the same instance. bokeh server is on port 5006, nginx is on port 80.
> > I can bypass nginx and access bokeh server from port 5006 directly, and the plot works fine. However, if I access the plot through nginx, the template loads but I get a js error:
> >
> > Uncaught Error: Error rendering Bokeh model: could not find tag with id: undefined
> >
> > and no error from the bokeh server. The application has a template in templates/index.html. I have added the 'safe' filter to both the plot_div and plot_script following advice from here and here, but I keep getting the same error.
> >
> > It is probably obvious but I am allowing websocket-origins from 127.0.0.1:5006 (for the proxy) and mydomainname.com:5006 as well.
> > I'm on bokeh 0.12.16, python 3.6.5, any advice?
> >
> > Thanks! Evan
> >
> > --
> > You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
> > To post to this group, send email to bo...@continuum.io.
> > To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/5924970d-9765-4267-a26c-f2ff58639f94%40continuum.io\.
> > For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+un...@continuum.io.
> To post to this group, send email to bo...@continuum.io.
> To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/a210a232-5b44-4811-967d-c9dcb7872519%40continuum.io\.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/71d3cd53-dd8d-4fba-b519-b974724761f1%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.