☰Read-only archive⌕
Looking for help with Bokeh?

This is a read-only archive. Ask questions and join the conversation on GitHub.

Visit Community Support on GitHub →
Archived discussions · Captured October 28, 2026

Static images in Bokeh using Div

Community Support
Andrei_Ionut_Damian
Andrei_Ionut_Damian

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!

⌁   Link to post
azjps
azjps

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!

⌁   Link to post
Andrei_Ionut_Damian
Andrei_Ionut_Damian

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

···

On Wednesday, January 11, 2017 at 7:04:40 AM UTC+2, azp...@gmail.com 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!

⌁   Link to post
Bryan
Bryan

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

Thanks,

Bryan

···

On Jan 11, 2017, at 2:32 AM, ionutdam@gmail.com wrote:

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

On Wednesday, January 11, 2017 at 7:04:40 AM UTC+2, azp...@gmail.com 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 bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
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\.

⌁   Link to post
Andrei_Ionut_Damian
Andrei_Ionut_Damian

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, ionu...@gmail.com wrote:

Hi,

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

On Wednesday, January 11, 2017 at 7:04:40 AM UTC+2, azp...@gmail.com 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 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/57d9e552-ca35-434e-bb7e-8aeceefc78c9%40continuum.io.

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

⌁   Link to post

End of archived discussion · Replies are disabled