sb32134
sb32134

Reputation: 428

Web2py client server not working

I'm trying to run a project which holds data in web2py server and web2py based client shows the visualization. When running both server and client , the chrome console on clinet side shows:

XMLHttpRequest cannot load http://127.0.0.1:8075/?format=json. 
No 'Access-Control-     Allow-Origin' header is present on the requested resource.
Origin 'http://127.0.0.1:8080' is therefore not allowed access. (index):1
[ERROR] Cannot connect to data server:  http://127.0.0.1:8075?format=json 

I'm running above with web2py2.9.5 on linux.

Upvotes: 0

Views: 290

Answers (1)

Anthony
Anthony

Reputation: 25536

It looks like your web2py client page is served on port 8080 but is then making an Ajax request to port 8075, which violates the same origin policy enforced by web browsers.

If you can't serve both from the same origin, you can get around this by using JSONP or by setting up CORS.

Upvotes: 1

Related Questions