Brian Leach
Brian Leach

Reputation: 4154

Trouble accessing a dynamically generated javascript file

I am creating a plotting application with Python's bokeh.

bokeh dynamically generates javascript used in its plotting visualizations.

My setup works when I am running the debug server from within my IDE, but I get the following error when I attempt to run the app on a server and access it from a browser:

GET http://127.0.0.1:5006/bokeh/jsgenerate/VBox/PlottingApp/PlottingApp net::ERR_CONNECTION_REFUSED

If I put the following into the terminal, I get all the javascript fine.

$ curl http://127.0.0.1:5006/bokeh/jsgenerate/VBox/PlottingApp/PlottingApp

Where is this access problem originating from? I am using Flask as my application framework, uwsgi as my app server, and nginx as my webserver. Let me know if there are configuration settings within these modules that you need to see.

Upvotes: 0

Views: 57

Answers (1)

dan-klasson
dan-klasson

Reputation: 14210

Remote ajax calls are denied by default. Make sure your server returns this header:

Access-Control-Allow-Origin: *

Upvotes: 1

Related Questions