Static images in Bokeh using Div

In my Bokeh server based project I have to use/add a few images that are within the Bokeh project folder. I created a static folder called “static/” within the project folder and basically my code looks like this:

  div_img_html = "<img src='static/image.png'>"
div_img = Div(text = div_img_html)

however when running the server I get:

  404 GET /static/image.png (::1) 2.00ms

Obviously Bokeh gets the Div command however server doesn’t know how to retrieve the actual file… The actual file certainly is residing within that folder.

Thank you in advance for any suggestions and hopefully for a solution!

Hi, try (the docs can be fleshed out more here). - Andy

···

On Tuesday, January 10, 2017 at 5:31:50 AM UTC-5, Andrei Ionut Damian wrote:

In my Bokeh server based project I have to use/add a few images that are within the Bokeh project folder. I created a static folder called “static/” within the project folder and basically my code looks like this:

  div_img_html = "<img src='static/image.png'>"
div_img = Div(text = div_img_html)

however when running the server I get:

  404 GET /static/image.png (::1) 2.00ms

Obviously Bokeh gets the Div command however server doesn’t know how to retrieve the actual file… The actual file certainly is residing within that folder.

Thank you in advance for any suggestions and hopefully for a solution!

Hi,
already did try that… doesn’t work … same 404.

···

On Wednesday, January 11, 2017 at 7:04:40 AM UTC+2, [email protected] wrote:

Hi, try (the docs can be fleshed out more here). - Andy

On Tuesday, January 10, 2017 at 5:31:50 AM UTC-5, Andrei Ionut Damian wrote:

In my Bokeh server based project I have to use/add a few images that are within the Bokeh project folder. I created a static folder called “static/” within the project folder and basically my code looks like this:

  div_img_html = "<img src='static/image.png'>"
div_img = Div(text = div_img_html)

however when running the server I get:

  404 GET /static/image.png (::1) 2.00ms

Obviously Bokeh gets the Div command however server doesn’t know how to retrieve the actual file… The actual file certainly is residing within that folder.

Thank you in advance for any suggestions and hopefully for a solution!

Did you try with a / in front of the path?

Thanks,

Bryan

···

On Jan 11, 2017, at 2:32 AM, [email protected] wrote:

Hi,
already did try that... doesn't work ... same 404.

On Wednesday, January 11, 2017 at 7:04:40 AM UTC+2, [email protected] wrote:

Hi, try <img src="{name_of_your_app}/static/image.png"> (the docs can be fleshed out more here). - Andy

On Tuesday, January 10, 2017 at 5:31:50 AM UTC-5, Andrei Ionut Damian wrote:
In my Bokeh server based project I have to use/add a few images that are within the Bokeh project folder. I created a static folder called "static/" within the project folder and basically my code looks like this:

  div_img_html = "<img src='static/image.png'>"
  div_img = Div(text = div_img_html)

however when running the server I get:

  404 GET /static/image.png (::1) 2.00ms

Obviously Bokeh gets the Div command however server doesn't know how to retrieve the actual file.... The actual file certainly is residing within that folder.

Thank you in advance for any suggestions and hopefully for a solution!

--
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/57d9e552-ca35-434e-bb7e-8aeceefc78c9%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

I certainly did.

What I do have to say is that this file is in /static/ folder so basically bokeh server has to actually serve it - not other web server. Probably this is the problem, bokeh is not supposed to serve static files even if they are in the project folders…

···

On Wednesday, January 11, 2017 at 5:03:10 PM UTC+2, Bryan Van de ven wrote:

Did you try with a / in front of the path?

Thanks,

Bryan

On Jan 11, 2017, at 2:32 AM, [email protected] wrote:

Hi,

already did try that… doesn’t work … same 404.

On Wednesday, January 11, 2017 at 7:04:40 AM UTC+2, [email protected] wrote:

Hi, try (the docs can be fleshed out more here). - Andy

On Tuesday, January 10, 2017 at 5:31:50 AM UTC-5, Andrei Ionut Damian wrote:

In my Bokeh server based project I have to use/add a few images that are within the Bokeh project folder. I created a static folder called “static/” within the project folder and basically my code looks like this:

div_img_html = “

div_img = Div(text = div_img_html)

however when running the server I get:

404 GET /static/image.png (::1) 2.00ms

Obviously Bokeh gets the Div command however server doesn’t know how to retrieve the actual file… The actual file certainly is residing within that folder.

Thank you in advance for any suggestions and hopefully for a solution!


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/57d9e552-ca35-434e-bb7e-8aeceefc78c9%40continuum.io.

For more options, visit https://groups.google.com/a/continuum.io/d/optout.