Django Bokeh Example

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18

Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

  https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

···

On Aug 16, 2018, at 15:41, Neil Fernandes <[email protected]> wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data ("talk") with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user's activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18

--
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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Bryan,

Sure, I can translate this example to django:

https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

···

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:

Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18


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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%40continuum.io.

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

Hi Neil,

Sorry if I was not specific, it's all the examples here:

  https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

···

On Aug 20, 2018, at 17:39, Neil Fernandes <[email protected]> wrote:

Hi Bryan,

Sure, I can translate this example to django:
https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:
Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

        https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

> On Aug 16, 2018, at 15:41, Neil Fernandes <[email protected]> wrote:
>
> I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data ("talk") with a Bokeh server.
>
> An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user's activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).
>
> @Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18
>
> --
> 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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Neil and Bryan,

Thanks for doing this. I had a similar project in porting bokeh into Django and encountered this unresolved issue When you u try to make a request to an api for data using customJS

https://groups.google.com/a/continuum.io/forum/m/?utm_medium=email&utm_source=footer#!msg/bokeh/qcy-b-TFDzI/XAhjuKgvAQAJ

I want to get a bokeh interactive page on a Django run by an Apache server. For this:

1. Is bokeh run internally on the server and then rendered by Django through the embedding solution you are proposing or does bokeh need to be on Apache as well?

2. is it possible to get the data for the plots by queries to an api from bokeh to modify the plots? Should this be using CustomJS Javascript or using python requests (that's my unresolved issue)

Any insight on this would be much appreciated.

Thank you
Joshua

Sure, I’ll look at the examples and start porting them to Django.

···

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Sorry if I was not specific, it’s all the examples here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

On Aug 20, 2018, at 17:39, Neil Fernandes [email protected] wrote:

Hi Bryan,

Sure, I can translate this example to django:

https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:

Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18


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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%40continuum.io.

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

HI,

Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can’t be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn’t in the DOm to be accessed and used to update the page along with the user’s request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.

···

On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:

Sure, I’ll look at the examples and start porting them to Django.

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Sorry if I was not specific, it’s all the examples here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

On Aug 20, 2018, at 17:39, Neil Fernandes [email protected] wrote:

Hi Bryan,

Sure, I can translate this example to django:

https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:

Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18


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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%40continuum.io.

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

What would you want a bokeh django integration to look like?

A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?

For the ajax interaction what did you have in mind?

Would you like a django example that takes the place of the flask server in this

Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?

···

On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:

HI,

Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can’t be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn’t in the DOm to be accessed and used to update the page along with the user’s request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.

On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:

Sure, I’ll look at the examples and start porting them to Django.

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Sorry if I was not specific, it’s all the examples here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

On Aug 20, 2018, at 17:39, Neil Fernandes [email protected] wrote:

Hi Bryan,

Sure, I can translate this example to django:

https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:

Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18


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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%40continuum.io.

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

I was thinking of porting this example to Django:

···

On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:

What would you want a bokeh django integration to look like?

A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?

For the ajax interaction what did you have in mind?

Would you like a django example that takes the place of the flask server in this

https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py

Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?

On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:

HI,

Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can’t be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn’t in the DOm to be accessed and used to update the page along with the user’s request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.

On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:

Sure, I’ll look at the examples and start porting them to Django.

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Sorry if I was not specific, it’s all the examples here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

On Aug 20, 2018, at 17:39, Neil Fernandes [email protected] wrote:

Hi Bryan,

Sure, I can translate this example to django:

https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:

Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18


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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%40continuum.io.

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

Hi,

FYI, I would love to have a Django version of that as a comparison to the others. I just know next to nothing about Django, and can't justify the personal bandwidth it would take to learn enough just to add it. I think it should be fairly similar in many ways to the other versions though, and I'm happy to try and answer any questions from the Bokeh end of things.

Thanks,

Bryan

···

On Feb 27, 2019, at 4:34 PM, Neil <[email protected]> wrote:

I was thinking of porting this example to Django:
https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/flask_embed.py

On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:
What would you want a bokeh django integration to look like?
A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?

For the ajax interaction what did you have in mind?
Would you like a django example that takes the place of the flask server in this
https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py

Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?

On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:
HI,

Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can't be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn't in the DOm to be accessed and used to update the page along with the user's request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.

On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:
Sure, I'll look at the examples and start porting them to Django.

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:
Hi Neil,

Sorry if I was not specific, it's all the examples here:

        https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

> On Aug 20, 2018, at 17:39, Neil Fernandes <[email protected]> wrote:
>
> Hi Bryan,
>
> Sure, I can translate this example to django:
> https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py
>
> -Neil
>
> On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:
> Hi Neil,
>
> I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:
>
> https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed
>
> All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.
>
> Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.
>
> Thanks,
>
> Bryan
>
> > On Aug 16, 2018, at 15:41, Neil Fernandes <[email protected]> wrote:
> >
> > I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data ("talk") with a Bokeh server.
> >
> > An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user's activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).
> >
> > @Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18
> >
> > --
> > 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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%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/f193a33b-6c80-4e0d-aff0-419a600c1451%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks Bryan, I’ll try to getting something started this week

···

On Wednesday, February 27, 2019 at 4:38:32 PM UTC-8, Bryan Van de Ven wrote:

Hi,

FYI, I would love to have a Django version of that as a comparison to the others. I just know next to nothing about Django, and can’t justify the personal bandwidth it would take to learn enough just to add it. I think it should be fairly similar in many ways to the other versions though, and I’m happy to try and answer any questions from the Bokeh end of things.

Thanks,

Bryan

On Feb 27, 2019, at 4:34 PM, Neil [email protected] wrote:

I was thinking of porting this example to Django:

https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/flask_embed.py

On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:

What would you want a bokeh django integration to look like?

A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?

For the ajax interaction what did you have in mind?

Would you like a django example that takes the place of the flask server in this

https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py

Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?

On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:

HI,

Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can’t be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn’t in the DOm to be accessed and used to update the page along with the user’s request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.

On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:

Sure, I’ll look at the examples and start porting them to Django.

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Sorry if I was not specific, it’s all the examples here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

On Aug 20, 2018, at 17:39, Neil Fernandes [email protected] wrote:

Hi Bryan,

Sure, I can translate this example to django:
https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:
Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18


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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%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/f193a33b-6c80-4e0d-aff0-419a600c1451%40continuum.io.

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

Here’s an example for sea temperature data (i’ve removed callbacks):

···

On Wednesday, February 27, 2019 at 4:43:03 PM UTC-8, Neil wrote:

Thanks Bryan, I’ll try to getting something started this week

On Wednesday, February 27, 2019 at 4:38:32 PM UTC-8, Bryan Van de Ven wrote:

Hi,

FYI, I would love to have a Django version of that as a comparison to the others. I just know next to nothing about Django, and can’t justify the personal bandwidth it would take to learn enough just to add it. I think it should be fairly similar in many ways to the other versions though, and I’m happy to try and answer any questions from the Bokeh end of things.

Thanks,

Bryan

On Feb 27, 2019, at 4:34 PM, Neil [email protected] wrote:

I was thinking of porting this example to Django:

https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/flask_embed.py

On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:

What would you want a bokeh django integration to look like?

A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?

For the ajax interaction what did you have in mind?

Would you like a django example that takes the place of the flask server in this

https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py

Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?

On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:

HI,

Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can’t be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn’t in the DOm to be accessed and used to update the page along with the user’s request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.

On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:

Sure, I’ll look at the examples and start porting them to Django.

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Sorry if I was not specific, it’s all the examples here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

On Aug 20, 2018, at 17:39, Neil Fernandes [email protected] wrote:

Hi Bryan,

Sure, I can translate this example to django:
https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:
Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18


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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%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/f193a33b-6c80-4e0d-aff0-419a600c1451%40continuum.io.

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

Hi Heil,

I think this is a good start but the use of components is I would say identical across all web platforms, the function output goes in whatever standard template mechanism the platform uses. I don't really see the benefit of adding a large Django example just for that. By contrast, many people have asked about how to have a Bokeh server app run "inside" Django, i.e. similar to all the "server_embed" examples in the repo. I would definitely be +1 for adding a demonstration of that. Let me know if I can assist.

Thanks,

Bryan

···

On Feb 27, 2019, at 6:38 PM, Neil <[email protected]> wrote:

Here's an example for sea temperature data (i've removed callbacks):

https://github.com/neilfrndes/bokeh/tree/example/django/examples/embed/django_example

On Wednesday, February 27, 2019 at 4:43:03 PM UTC-8, Neil wrote:
Thanks Bryan, I'll try to getting something started this week

On Wednesday, February 27, 2019 at 4:38:32 PM UTC-8, Bryan Van de Ven wrote:
Hi,

FYI, I would love to have a Django version of that as a comparison to the others. I just know next to nothing about Django, and can't justify the personal bandwidth it would take to learn enough just to add it. I think it should be fairly similar in many ways to the other versions though, and I'm happy to try and answer any questions from the Bokeh end of things.

Thanks,

Bryan

> On Feb 27, 2019, at 4:34 PM, Neil <[email protected]> wrote:
>
> I was thinking of porting this example to Django:
> https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/flask_embed.py
>
> On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:
> What would you want a bokeh django integration to look like?
> A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?
>
> For the ajax interaction what did you have in mind?
> Would you like a django example that takes the place of the flask server in this
> https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py
>
> Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?
>
>
>
> On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:
> HI,
>
> Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can't be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn't in the DOm to be accessed and used to update the page along with the user's request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.
>
> On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:
> Sure, I'll look at the examples and start porting them to Django.
>
> On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:
> Hi Neil,
>
> Sorry if I was not specific, it's all the examples here:
>
> https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed
>
> That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.
>
> Thanks,
>
> Bryan
>
> > On Aug 20, 2018, at 17:39, Neil Fernandes <[email protected]> wrote:
> >
> > Hi Bryan,
> >
> > Sure, I can translate this example to django:
> > https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py
> >
> > -Neil
> >
> > On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:
> > Hi Neil,
> >
> > I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:
> >
> > https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed
> >
> > All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.
> >
> > Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.
> >
> > Thanks,
> >
> > Bryan
> >
> > > On Aug 16, 2018, at 15:41, Neil Fernandes <[email protected]> wrote:
> > >
> > > I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data ("talk") with a Bokeh server.
> > >
> > > An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user's activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).
> > >
> > > @Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18
> > >
> > > --
> > > 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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%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/f193a33b-6c80-4e0d-aff0-419a600c1451%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/e89aef85-7355-4879-b813-51dc8b4238f1%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Hi Bryan
Sure, I’d like to help make an example where a bokeh server runs ‘inside’ django. I’m familiar with Python and Django but I dont know much about JavaScript. I will do some documentation reading over this weekend to see how the web browser can talk to the server via django.

Regards

Neil

···

On Friday, March 1, 2019 at 12:31:25 PM UTC-8, bokeh.bryan wrote:

Hi Heil,

I think this is a good start but the use of components is I would say identical across all web platforms, the function output goes in whatever standard template mechanism the platform uses. I don’t really see the benefit of adding a large Django example just for that. By contrast, many people have asked about how to have a Bokeh server app run “inside” Django, i.e. similar to all the “server_embed” examples in the repo. I would definitely be +1 for adding a demonstration of that. Let me know if I can assist.

Thanks,

Bryan

On Feb 27, 2019, at 6:38 PM, Neil [email protected] wrote:

Here’s an example for sea temperature data (i’ve removed callbacks):

https://github.com/neilfrndes/bokeh/tree/example/django/examples/embed/django_example

On Wednesday, February 27, 2019 at 4:43:03 PM UTC-8, Neil wrote:

Thanks Bryan, I’ll try to getting something started this week

On Wednesday, February 27, 2019 at 4:38:32 PM UTC-8, Bryan Van de Ven wrote:

Hi,

FYI, I would love to have a Django version of that as a comparison to the others. I just know next to nothing about Django, and can’t justify the personal bandwidth it would take to learn enough just to add it. I think it should be fairly similar in many ways to the other versions though, and I’m happy to try and answer any questions from the Bokeh end of things.

Thanks,

Bryan

On Feb 27, 2019, at 4:34 PM, Neil [email protected] wrote:

I was thinking of porting this example to Django:
https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/flask_embed.py

On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:
What would you want a bokeh django integration to look like?
A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?

For the ajax interaction what did you have in mind?
Would you like a django example that takes the place of the flask server in this
https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py

Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?

On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:
HI,

Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can’t be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn’t in the DOm to be accessed and used to update the page along with the user’s request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.

On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:
Sure, I’ll look at the examples and start porting them to Django.

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:
Hi Neil,

Sorry if I was not specific, it’s all the examples here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

On Aug 20, 2018, at 17:39, Neil Fernandes [email protected] wrote:

Hi Bryan,

Sure, I can translate this example to django:
https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:
Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18


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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%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/f193a33b-6c80-4e0d-aff0-419a600c1451%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/e89aef85-7355-4879-b813-51dc8b4238f1%40continuum.io.

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

Hi Neil,

Just to add my $0.02 I don;'t really consider there to be much if any JS component to this. If you look at the other examples in howto/server_embed the main task is how to embed the Bokeh server programmatically in each web framework (e.g. use Bokeh server as a library inside a Flask app). That is a purely Python task, and the reason it hasn't been done for Django is simply that I don't know much/anything about Django.

Thanks,

Bryan

···

On Mar 7, 2019, at 11:34 PM, Neil <[email protected]> wrote:

Hi Bryan
Sure, I'd like to help make an example where a bokeh server runs 'inside' django. I'm familiar with Python and Django but I dont know much about JavaScript. I will do some documentation reading over this weekend to see how the web browser can talk to the server via django.
Regards
Neil

On Friday, March 1, 2019 at 12:31:25 PM UTC-8, bokeh.bryan wrote:
Hi Heil,

I think this is a good start but the use of components is I would say identical across all web platforms, the function output goes in whatever standard template mechanism the platform uses. I don't really see the benefit of adding a large Django example just for that. By contrast, many people have asked about how to have a Bokeh server app run "inside" Django, i.e. similar to all the "server_embed" examples in the repo. I would definitely be +1 for adding a demonstration of that. Let me know if I can assist.

Thanks,

Bryan

> On Feb 27, 2019, at 6:38 PM, Neil <[email protected]> wrote:
>
> Here's an example for sea temperature data (i've removed callbacks):
>
> https://github.com/neilfrndes/bokeh/tree/example/django/examples/embed/django_example
>
> On Wednesday, February 27, 2019 at 4:43:03 PM UTC-8, Neil wrote:
> Thanks Bryan, I'll try to getting something started this week
>
> On Wednesday, February 27, 2019 at 4:38:32 PM UTC-8, Bryan Van de Ven wrote:
> Hi,
>
> FYI, I would love to have a Django version of that as a comparison to the others. I just know next to nothing about Django, and can't justify the personal bandwidth it would take to learn enough just to add it. I think it should be fairly similar in many ways to the other versions though, and I'm happy to try and answer any questions from the Bokeh end of things.
>
> Thanks,
>
> Bryan
>
> > On Feb 27, 2019, at 4:34 PM, Neil <[email protected]> wrote:
> >
> > I was thinking of porting this example to Django:
> > https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/flask_embed.py
> >
> > On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:
> > What would you want a bokeh django integration to look like?
> > A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?
> >
> > For the ajax interaction what did you have in mind?
> > Would you like a django example that takes the place of the flask server in this
> > https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py
> >
> > Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?
> >
> >
> >
> > On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:
> > HI,
> >
> > Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can't be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn't in the DOm to be accessed and used to update the page along with the user's request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.
> >
> > On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:
> > Sure, I'll look at the examples and start porting them to Django.
> >
> > On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:
> > Hi Neil,
> >
> > Sorry if I was not specific, it's all the examples here:
> >
> > https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed
> >
> > That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.
> >
> > Thanks,
> >
> > Bryan
> >
> > > On Aug 20, 2018, at 17:39, Neil Fernandes <[email protected]> wrote:
> > >
> > > Hi Bryan,
> > >
> > > Sure, I can translate this example to django:
> > > https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py
> > >
> > > -Neil
> > >
> > > On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:
> > > Hi Neil,
> > >
> > > I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:
> > >
> > > https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed
> > >
> > > All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.
> > >
> > > Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.
> > >
> > > Thanks,
> > >
> > > Bryan
> > >
> > > > On Aug 16, 2018, at 15:41, Neil Fernandes <[email protected]> wrote:
> > > >
> > > > I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data ("talk") with a Bokeh server.
> > > >
> > > > An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user's activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).
> > > >
> > > > @Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18
> > > >
> > > > --
> > > > 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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%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/f193a33b-6c80-4e0d-aff0-419a600c1451%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/e89aef85-7355-4879-b813-51dc8b4238f1%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/fa611fd5-9157-4f65-adb5-76de12a6b9a5%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.

$0.02 - haha, i’ve never seen it put this way!

From the documentation and the flask embed example, it looks like two things need to be accomplished:

  1. Start and run a bokeh server in the background

  2. Establish a two way two way communication channel between the client and the bokeh server using websockets.

Accomplishing 1) is pretty straightforward. However, i’m not sure what the best way to accomplish 2) is. Django only accepts HTTP requests by default. This is the process django follows:

Client sends a request -> Django processes the request using the appropriate ‘View’ -> ‘View’ returns a http response to be rendered by the client. Only one-way communication.

The solution for 2) maybe: a) to use a REST api to return the JSON that the client requests or b) Use websockets in Django using channels (https://channels.readthedocs.io/en/latest/)

Could we setup a conference call to discuss a solution strategy? I’m guessing it would be faster than back and forth emails.

···

On Monday, March 11, 2019 at 8:31:53 AM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Just to add my $0.02 I don;'t really consider there to be much if any JS component to this. If you look at the other examples in howto/server_embed the main task is how to embed the Bokeh server programmatically in each web framework (e.g. use Bokeh server as a library inside a Flask app). That is a purely Python task, and the reason it hasn’t been done for Django is simply that I don’t know much/anything about Django.

Thanks,

Bryan

On Mar 7, 2019, at 11:34 PM, Neil [email protected] wrote:

Hi Bryan

Sure, I’d like to help make an example where a bokeh server runs ‘inside’ django. I’m familiar with Python and Django but I dont know much about JavaScript. I will do some documentation reading over this weekend to see how the web browser can talk to the server via django.

Regards

Neil

On Friday, March 1, 2019 at 12:31:25 PM UTC-8, bokeh.bryan wrote:

Hi Heil,

I think this is a good start but the use of components is I would say identical across all web platforms, the function output goes in whatever standard template mechanism the platform uses. I don’t really see the benefit of adding a large Django example just for that. By contrast, many people have asked about how to have a Bokeh server app run “inside” Django, i.e. similar to all the “server_embed” examples in the repo. I would definitely be +1 for adding a demonstration of that. Let me know if I can assist.

Thanks,

Bryan

On Feb 27, 2019, at 6:38 PM, Neil [email protected] wrote:

Here’s an example for sea temperature data (i’ve removed callbacks):

https://github.com/neilfrndes/bokeh/tree/example/django/examples/embed/django_example

On Wednesday, February 27, 2019 at 4:43:03 PM UTC-8, Neil wrote:
Thanks Bryan, I’ll try to getting something started this week

On Wednesday, February 27, 2019 at 4:38:32 PM UTC-8, Bryan Van de Ven wrote:
Hi,

FYI, I would love to have a Django version of that as a comparison to the others. I just know next to nothing about Django, and can’t justify the personal bandwidth it would take to learn enough just to add it. I think it should be fairly similar in many ways to the other versions though, and I’m happy to try and answer any questions from the Bokeh end of things.

Thanks,

Bryan

On Feb 27, 2019, at 4:34 PM, Neil [email protected] wrote:

I was thinking of porting this example to Django:
https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/flask_embed.py

On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:
What would you want a bokeh django integration to look like?
A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?

For the ajax interaction what did you have in mind?
Would you like a django example that takes the place of the flask server in this
https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py

Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?

On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:
HI,

Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesnt change on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can’t be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn’t in the DOm to be accessed and used to update the page along with the user’s request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.

On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:
Sure, I’ll look at the examples and start porting them to Django.

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:
Hi Neil,

Sorry if I was not specific, it’s all the examples here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

On Aug 20, 2018, at 17:39, Neil Fernandes [email protected] wrote:

Hi Bryan,

Sure, I can translate this example to django:
https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:
Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18


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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%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/f193a33b-6c80-4e0d-aff0-419a600c1451%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/e89aef85-7355-4879-b813-51dc8b4238f1%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/fa611fd5-9157-4f65-adb5-76de12a6b9a5%40continuum.io.

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

Hi,

I think we may be talking at ends? Once you run a Bokeh server programmatically, it takes care of all the websocket communication. You use server_document (or possibly server_session if you need to do some pre-customization) and then you have Django template the result of that function in the page it renders. If you look at the other examples, you can see there is nothing anywhere explicit to do with webscokets. I would expect a Django version of that example to be largely identical, differing only mainly (as far I understand it) by:

* the custom non-jinja template language Django uses
* possibly in how the Bokeh server is started (if there is an idiomatic Django way to start things in the background)

Unfortunately I am about to start a new job I won't be available for any kind of call until after next week at the earliest.

Thanks,

Bryan

···

On Mar 11, 2019, at 6:02 PM, Neil <[email protected]> wrote:

$0.02 - haha, i've never seen it put this way!

From the documentation and the flask embed example, it looks like two things need to be accomplished:
1) Start and run a bokeh server in the background
2) Establish a two way two way communication channel between the client and the bokeh server using websockets.

Accomplishing 1) is pretty straightforward. However, i'm not sure what the best way to accomplish 2) is. Django only accepts HTTP requests by default. This is the process django follows:
Client sends a request -> Django processes the request using the appropriate 'View' -> 'View' returns a http response to be rendered by the client. Only one-way communication.

The solution for 2) maybe: a) to use a REST api to return the JSON that the client requests or b) Use websockets in Django using channels (https://channels.readthedocs.io/en/latest/)

Could we setup a conference call to discuss a solution strategy? I'm guessing it would be faster than back and forth emails.

On Monday, March 11, 2019 at 8:31:53 AM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Just to add my $0.02 I don;'t really consider there to be much if any JS component to this. If you look at the other examples in howto/server_embed the main task is how to embed the Bokeh server programmatically in each web framework (e.g. use Bokeh server as a library inside a Flask app). That is a purely Python task, and the reason it hasn't been done for Django is simply that I don't know much/anything about Django.

Thanks,

Bryan

> On Mar 7, 2019, at 11:34 PM, Neil <[email protected]> wrote:
>
> Hi Bryan
> Sure, I'd like to help make an example where a bokeh server runs 'inside' django. I'm familiar with Python and Django but I dont know much about JavaScript. I will do some documentation reading over this weekend to see how the web browser can talk to the server via django.
> Regards
> Neil
>
> On Friday, March 1, 2019 at 12:31:25 PM UTC-8, bokeh.bryan wrote:
> Hi Heil,
>
> I think this is a good start but the use of components is I would say identical across all web platforms, the function output goes in whatever standard template mechanism the platform uses. I don't really see the benefit of adding a large Django example just for that. By contrast, many people have asked about how to have a Bokeh server app run "inside" Django, i.e. similar to all the "server_embed" examples in the repo. I would definitely be +1 for adding a demonstration of that. Let me know if I can assist.
>
> Thanks,
>
> Bryan
>
> > On Feb 27, 2019, at 6:38 PM, Neil <[email protected]> wrote:
> >
> > Here's an example for sea temperature data (i've removed callbacks):
> >
> > https://github.com/neilfrndes/bokeh/tree/example/django/examples/embed/django_example
> >
> > On Wednesday, February 27, 2019 at 4:43:03 PM UTC-8, Neil wrote:
> > Thanks Bryan, I'll try to getting something started this week
> >
> > On Wednesday, February 27, 2019 at 4:38:32 PM UTC-8, Bryan Van de Ven wrote:
> > Hi,
> >
> > FYI, I would love to have a Django version of that as a comparison to the others. I just know next to nothing about Django, and can't justify the personal bandwidth it would take to learn enough just to add it. I think it should be fairly similar in many ways to the other versions though, and I'm happy to try and answer any questions from the Bokeh end of things.
> >
> > Thanks,
> >
> > Bryan
> >
> > > On Feb 27, 2019, at 4:34 PM, Neil <[email protected]> wrote:
> > >
> > > I was thinking of porting this example to Django:
> > > https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/flask_embed.py
> > >
> > > On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:
> > > What would you want a bokeh django integration to look like?
> > > A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?
> > >
> > > For the ajax interaction what did you have in mind?
> > > Would you like a django example that takes the place of the flask server in this
> > > https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py
> > >
> > > Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?
> > >
> > >
> > >
> > > On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:
> > > HI,
> > >
> > > Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesntchange on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can't be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn't in the DOm to be accessed and used to update the page along with the user's request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.
> > >
> > > On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:
> > > Sure, I'll look at the examples and start porting them to Django.
> > >
> > > On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:
> > > Hi Neil,
> > >
> > > Sorry if I was not specific, it's all the examples here:
> > >
> > > https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed
> > >
> > > That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.
> > >
> > > Thanks,
> > >
> > > Bryan
> > >
> > > > On Aug 20, 2018, at 17:39, Neil Fernandes <[email protected]> wrote:
> > > >
> > > > Hi Bryan,
> > > >
> > > > Sure, I can translate this example to django:
> > > > https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py
> > > >
> > > > -Neil
> > > >
> > > > On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:
> > > > Hi Neil,
> > > >
> > > > I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:
> > > >
> > > > https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed
> > > >
> > > > All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.
> > > >
> > > > Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.
> > > >
> > > > Thanks,
> > > >
> > > > Bryan
> > > >
> > > > > On Aug 16, 2018, at 15:41, Neil Fernandes <[email protected]> wrote:
> > > > >
> > > > > I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data ("talk") with a Bokeh server.
> > > > >
> > > > > An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user's activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).
> > > > >
> > > > > @Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18
> > > > >
> > > > > --
> > > > > 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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%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/f193a33b-6c80-4e0d-aff0-419a600c1451%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/e89aef85-7355-4879-b813-51dc8b4238f1%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/fa611fd5-9157-4f65-adb5-76de12a6b9a5%40continuum.io.
> For more options, visit https://groups.google.com/a/continuum.io/d/optout.

Thanks for the clarification, I’ll spend some more time understanding the flask example.

Congratulations on your new job!

···

On Mon, Mar 11, 2019, 7:02 PM Bryan Van de ven [email protected] wrote:

Hi,

I think we may be talking at ends? Once you run a Bokeh server programmatically, it takes care of all the websocket communication. You use server_document (or possibly server_session if you need to do some pre-customization) and then you have Django template the result of that function in the page it renders. If you look at the other examples, you can see there is nothing anywhere explicit to do with webscokets. I would expect a Django version of that example to be largely identical, differing only mainly (as far I understand it) by:

  • the custom non-jinja template language Django uses

  • possibly in how the Bokeh server is started (if there is an idiomatic Django way to start things in the background)

Unfortunately I am about to start a new job I won’t be available for any kind of call until after next week at the earliest.

Thanks,

Bryan

On Mar 11, 2019, at 6:02 PM, Neil [email protected] wrote:

$0.02 - haha, i’ve never seen it put this way!

From the documentation and the flask embed example, it looks like two things need to be accomplished:

  1. Start and run a bokeh server in the background
  1. Establish a two way two way communication channel between the client and the bokeh server using websockets.

Accomplishing 1) is pretty straightforward. However, i’m not sure what the best way to accomplish 2) is. Django only accepts HTTP requests by default. This is the process django follows:

Client sends a request -> Django processes the request using the appropriate ‘View’ -> ‘View’ returns a http response to be rendered by the client. Only one-way communication.

The solution for 2) maybe: a) to use a REST api to return the JSON that the client requests or b) Use websockets in Django using channels (https://channels.readthedocs.io/en/latest/)

Could we setup a conference call to discuss a solution strategy? I’m guessing it would be faster than back and forth emails.

On Monday, March 11, 2019 at 8:31:53 AM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Just to add my $0.02 I don;'t really consider there to be much if any JS component to this. If you look at the other examples in howto/server_embed the main task is how to embed the Bokeh server programmatically in each web framework (e.g. use Bokeh server as a library inside a Flask app). That is a purely Python task, and the reason it hasn’t been done for Django is simply that I don’t know much/anything about Django.

Thanks,

Bryan

On Mar 7, 2019, at 11:34 PM, Neil [email protected] wrote:

Hi Bryan

Sure, I’d like to help make an example where a bokeh server runs ‘inside’ django. I’m familiar with Python and Django but I dont know much about JavaScript. I will do some documentation reading over this weekend to see how the web browser can talk to the server via django.

Regards

Neil

On Friday, March 1, 2019 at 12:31:25 PM UTC-8, bokeh.bryan wrote:

Hi Heil,

I think this is a good start but the use of components is I would say identical across all web platforms, the function output goes in whatever standard template mechanism the platform uses. I don’t really see the benefit of adding a large Django example just for that. By contrast, many people have asked about how to have a Bokeh server app run “inside” Django, i.e. similar to all the “server_embed” examples in the repo. I would definitely be +1 for adding a demonstration of that. Let me know if I can assist.

Thanks,

Bryan

On Feb 27, 2019, at 6:38 PM, Neil [email protected] wrote:

Here’s an example for sea temperature data (i’ve removed callbacks):

https://github.com/neilfrndes/bokeh/tree/example/django/examples/embed/django_example

On Wednesday, February 27, 2019 at 4:43:03 PM UTC-8, Neil wrote:

Thanks Bryan, I’ll try to getting something started this week

On Wednesday, February 27, 2019 at 4:38:32 PM UTC-8, Bryan Van de Ven wrote:

Hi,

FYI, I would love to have a Django version of that as a comparison to the others. I just know next to nothing about Django, and can’t justify the personal bandwidth it would take to learn enough just to add it. I think it should be fairly similar in many ways to the other versions though, and I’m happy to try and answer any questions from the Bokeh end of things.

Thanks,

Bryan

On Feb 27, 2019, at 4:34 PM, Neil [email protected] wrote:

I was thinking of porting this example to Django:

https://github.com/bokeh/bokeh/blob/master/examples/howto/server_embed/flask_embed.py

On Wednesday, February 27, 2019 at 10:13:52 AM UTC-8, Paddy Mullen wrote:

What would you want a bokeh django integration to look like?

A template tag that mimics the plotting api? a template tag that accepts a bokeh plot as an argument (my recommendation)?

For the ajax interaction what did you have in mind?

Would you like a django example that takes the place of the flask server in this

https://github.com/bokeh/bokeh/blob/master/examples/howto/ajax_source.py

Creating the template tag in either version is fairly straightforward. Figuring out a more universal ajax parameter and interaction mapping to ajax parameters is more involved. What did you have in mind?

On Friday, February 1, 2019 at 12:21:09 PM UTC-7, Isroel Kogan wrote:

HI,

Have there been any developments in this direction? I am developing an application that allows the user to query a geodjang (PostGis) backend and update data to be displayed on a map. The map itself doesntchange on each query other than the data associated with (the locations and other filters) user request - so the map can easily be rendered with something like leaflet or a host of js libraries. but they can’t be used interactively as they use canvas to render the map images - so the data (in the map -locations and other attributes - which were passed initially with geojson to render the map) isn’t in the DOm to be accessed and used to update the page along with the user’s request. Bokeh allows all that by embeding in the DOM - so using Bokeh with a django app would allow truly interactive (client-server) capabilities.

On Tuesday, August 21, 2018 at 6:20:13 PM UTC-4, Neil wrote:

Sure, I’ll look at the examples and start porting them to Django.

On Monday, August 20, 2018 at 8:30:52 PM UTC-7, Bryan Van de ven wrote:

Hi Neil,

Sorry if I was not specific, it’s all the examples here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

That are the similar ones to each other for server embed, and the ones I think it would be good to replicate with Django. They all have a themed plot with some ocean data and a single slider.

Thanks,

Bryan

On Aug 20, 2018, at 17:39, Neil Fernandes [email protected] wrote:

Hi Bryan,

Sure, I can translate this example to django:

https://github.com/bokeh/bokeh/blob/master/examples/embed/simple/simple.py

-Neil

On Monday, August 20, 2018 at 9:19:29 AM UTC-7, Bryan Van de ven wrote:

Hi Neil,

I think it would be great to have a django example. Ideally, it would be nice to have a django_emend example added here:

    [https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed](https://github.com/bokeh/bokeh/tree/master/examples/howto/server_embed)

All the examples there all embed that same simple Bokeh app with a slider and a plot. I believe having the same example replicated across different scenarios makes it easier for users to compare the different techniques. Would it be possible to adapt the example that is already there to a django_embed version? If so, please feel free to just open a PR with that adds that.

Otherwise, if you have a different sort of example in mind, perhaps you can put it up in a gist somewhere so I can take a look at it to see where else it might fit in.

Thanks,

Bryan

On Aug 16, 2018, at 15:41, Neil Fernandes [email protected] wrote:

I would like to contribute an example to illustrate Bokeh Django integration. I want to show how django can exchange data (“talk”) with a Bokeh server.

An example I came up with is a fitness/activity tracking website. Django stores the step count and heart rate of users in a database. When a user wishes to view a daily summary, Django passes the user’s activity data to a Bokeh server which generates a line chart (or performs some complicated calculations).

@Bryan, We discussed the Django example idea briefly after your Bokeh workshop at PyBay-18

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/5a53e698-9d24-4316-bdb8-67ac7a5b28b5%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/f7f60e78-5bfe-4544-9ac9-641ee085e71c%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/f193a33b-6c80-4e0d-aff0-419a600c1451%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/e89aef85-7355-4879-b813-51dc8b4238f1%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/fa611fd5-9157-4f65-adb5-76de12a6b9a5%40continuum.io.

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