Datafable / epu-index

EPU index
http://www.applieddatamining.com/cms/?q=content/economic-policy-uncertainty-index
1 stars 0 forks source link

Cannot access webapp API from JavaScript #9

Closed bartaelterman closed 9 years ago

bartaelterman commented 9 years ago

When I try to access the API using JavaScript, I get the following error:

XMLHttpRequest cannot load http://epu-index.herokuapp.com/api/epu/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:...' is therefore not allowed access.

Apparently, you need to enable these type of connections in the Django REST framework. (See this page under Cross-Origin Resource Sharing. It should be managed with this package.

niconoe commented 9 years ago

Allright ! I guess we don't need to protect from anything and so I can (for now at least) to give access whatever the origin ?

niconoe commented 9 years ago

Fixed, tell me if anything's wrong!

bartaelterman commented 9 years ago

certainly for GET calls. I don't know how specific you can tune this.