On Sep 12, 2017, at 13:10, Jonathan Bennett <[email protected]> wrote:
Thanks Bryan and Kevin!! I really appreciate the responses.
I don't really need help with Django right now (that could change, ha! And if so I'll seek an alternative location for that help.)
What I really want to understand at the moment is the right architecture approach.
This is what I'm thinking:
1) Use Docker to containerize my bokeh apps and serve them on AWS elastic beanstalk. expose an external port.
a) something like this: bokeh serve --allow-websocket-origin=127.0.0.1:5000 app1.py app2.py app3.py app4.py
2) Also Launch a Django application on separate AWS elastic beanstalk instance that calls each of the apps hosted by the bokeh server
3) Use firewalls rules in AWS so only the machines running Django can see the machines running bokeh server.
Reasoning: elastic beanstalk can scale up the bokeh server and/or the django server as needed, while keeping the bokeh server aspect relatively uncomplicated (since that's what I know least about).
Any idea whether this a terrible idea and/or a dead end?
Cheers,
Jonathan
On Tue, Sep 12, 2017 at 12:50 PM, Bryan Van de ven <[email protected]> wrote:
Sorry, stated that backwards: the example code assumes you've run "bokeh serve sliders.py" but it could also be done embedded with a FunctionHander as described in the docs an examples/howto/server_embed
Bryan
> On Sep 12, 2017, at 12:47, Bryan Van de ven <[email protected]> wrote:
>
> Hi,
>
> Unfortunately I don't know DJango and it is simply outside my ability to scale another learning curve right now. The core, most important gist of what the old happiness example did was simply to use "bokeh.client" to create an customize sessions on a per user basis. I've attached a simple Flask example below that hopefully is useful to adapt. The example uses an "embedded" server but it would work nearly identically if your ran the app in a separate "bokeh serve app.py" process.
>
> Note also that since making HTML request args available to apps, this use of bokeh.client is not even necessary to customize. If using HTML request args is acceptable, you can just put any customization data there (obviously not OK for private or sensitive things).
>
> Code:
>
> from flask import Flask, render_template
> from bokeh.client import pull_session
> from bokeh.embed import server_session
>
> app = Flask(__name__)
>
> @app.route('/', methods=['GET'])
> def bkapp_page():
> session = pull_session(url="http://localhost:5006/sliders"\)
>
> # Customize the session here
> session.document.roots[0].children[1].title.text = "Special Sliders For Jean-Luc"
>
> session.push()
>
> # Serve the specific customized session to viewer here
> script = server_session(None, session.id, url='http://localhost:5006/sliders'\)
>
> return render_template("embed.html", script=script, template="Flask")
>
> if __name__ == '__main__':
> app.run(port=8080)
>
> With this template:
>
> <!doctype html>
> <html lang="en">
> <head>
> <meta charset="utf-8">
> <title>Embedding a Bokeh Server With {{ framework }}</title>
> </head>
>
> <body>
> {{ script|safe }}
> </body>
> </html>
>
> Thanks,
>
> Bryan
>
>
>> On Sep 12, 2017, at 12:28, [email protected] wrote:
>>
>> https://groups.google.com/a/continuum.io/d/msg/bokeh/TtCyyKTiOIo/6UzhU0RlAwAJ
>>
>> :[
>>
>> On Tuesday, September 12, 2017 at 12:12:39 PM UTC-4, Jonathan Bennett wrote:
>> Hi All!
>>
>> I'm kicking off development for a Django web application that hosts a dashboard driven by Bokeh server. Any advice is greatly appreciated . . . blogs/templates/repositories/etc.
>> But right now I'm pouring over the Bokeh server documentation and found a dead link in the documentation at:
>>
>> http://bokeh.pydata.org/en/latest/docs/user_guide/server.html
>> The dead link is located where it says: "See a complete example at https://github.com/bokeh/bokeh-demos/tree/master/happiness "
>>
>> Does this still exist somewhere else, or is there another template I can use as a baseline to host a bokeh server that's called by a Django web application?
>>
>> Thanks in advance . . . looking forward to becoming a Bokeh expert.
>>
>> Cheers,
>> Jonathan
>>
>>
>> --
>> 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/847c3365-b9df-496f-bcf5-ec67263bd1a0%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/AA8D758A-2F16-4A50-BC24-3BAF68255BE8%40anaconda.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.
--
Jonathan Bennett
Kono Analytics
p: 713.489.4338
w: konoanalytics.com
--
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/CA%2BF%3D8g8ZAnAcWmHJV6n-KeU3NLcopxtD2KdZNy5-32_WxLpbpw%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.