13

From what I read the dynamic and big data rendering capabilities of Bokeh are accessible by use of the bokeh-server.

In Bokeh documentation there is a brief mention of embedding the bokeh-server in a Flask application using the blueprint api. This option retains all of the Bokeh's dynamic and big data rendering capabilities.

I would like to do the same for a django1.7 application.

Has this been done?

If so are there any examples?

Rubber Duck
  • 3,673
  • 3
  • 40
  • 59
  • are you asking for someone to translate something / code you have not provided from `flask` to `django`? – dnozay Dec 17 '14 at 07:10
  • 2
    No I asked a pre-coding question aimed at saving fumbling time – Rubber Duck Dec 17 '14 at 07:44
  • If there is a way to compartmentalize portions of the Bokeh server to be integrated more cleanly with Django, that would definitely be a welcome contribution we could consider. But it would probably have to come from an interested outside contributor, AFAIK none of us on the Bokeh team have much Django experience. – bigreddot Dec 17 '14 at 13:54
  • In django and probably also in bokeh-server client server comunication is done though http response and request. I'm looking for a way to send requests from the bokeh.js to the django server i.e. urls send them for evaluation inside bokeh functions and then receive the response and send it to the server. – Rubber Duck Dec 18 '14 at 12:03
  • Are dynamic updates achieved by web-sockets? – Rubber Duck Dec 18 '14 at 15:32
  • Here's the official bokeh [example django app](https://github.com/bokeh/bokeh-demos) in [my answer](http://stackoverflow.com/a/40920700/623735) to a [duplicate question](http://stackoverflow.com/q/29508958/623735) – hobs Dec 01 '16 at 21:29

1 Answers1

10

No need to reinvent.

  • bokeh-server is a webserver and can listen on arbitrary port.
  • you can have your django webserver listen on some other arbitrary port.
  • ... and integrate the two:
    • have redirects from django to bokeh-server, or
    • webserver in front, e.g. nginx which does reverse-proxy.
dnozay
  • 23,846
  • 6
  • 82
  • 104
  • I would like to avoid having another damon server for the sake of simplicity and maintenance. – Rubber Duck Dec 17 '14 at 07:55
  • 1
    For architectual reasons I do not wish to use bokeh-server and so you are basically saying you think the question isn't good and how to incorporate is the proper question. Please revoke your answer so I have a chance to get one from someone else. – Rubber Duck Dec 23 '14 at 09:19