{"action":"opened","issue":{"url":"https://api.github.com/repos/Datafable/epu-index/issues/9","labels_url":"https://api.github.com/repos/Datafable/epu-index/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/Datafable/epu-index/issues/9/comments","events_url":"https://api.github.com/repos/Datafable/epu-index/issues/9/events","html_url":"https://github.com/Datafable/epu-index/issues/9","id":75214018,"number":9,"title":"Cannot access webapp API from JavaScript","user":{"login":"bartaelterman","id":2742677,"avatar_url":"https://avatars.githubusercontent.com/u/2742677?v=3","gravatar_id":"","url":"https://api.github.com/users/bartaelterman","html_url":"https://github.com/bartaelterman","followers_url":"https://api.github.com/users/bartaelterman/followers","following_url":"https://api.github.com/users/bartaelterman/following{/other_user}","gists_url":"https://api.github.com/users/bartaelterman/gists{/gist_id}","starred_url":"https://api.github.com/users/bartaelterman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartaelterman/subscriptions","organizations_url":"https://api.github.com/users/bartaelterman/orgs","repos_url":"https://api.github.com/users/bartaelterman/repos","events_url":"https://api.github.com/users/bartaelterman/events{/privacy}","received_events_url":"https://api.github.com/users/bartaelterman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"niconoe","id":386387,"avatar_url":"https://avatars.githubusercontent.com/u/386387?v=3","gravatar_id":"","url":"https://api.github.com/users/niconoe","html_url":"https://github.com/niconoe","followers_url":"https://api.github.com/users/niconoe/followers","following_url":"https://api.github.com/users/niconoe/following{/other_user}","gists_url":"https://api.github.com/users/niconoe/gists{/gist_id}","starred_url":"https://api.github.com/users/niconoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/niconoe/subscriptions","organizations_url":"https://api.github.com/users/niconoe/orgs","repos_url":"https://api.github.com/users/niconoe/repos","events_url":"https://api.github.com/users/niconoe/events{/privacy}","received_events_url":"https://api.github.com/users/niconoe/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-05-11T13:00:59Z","updated_at":"2015-05-11T13:00:59Z","closed_at":null,"body":"When I try to access the API using JavaScript, I get the following error:\r\n\r\n`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.`\r\n\r\nApparently, you need to enable these type of connections in the Django REST framework. (See [this page](http://www.django-rest-framework.org/topics/ajax-csrf-cors/#cors) under `Cross-Origin Resource Sharing`. It should be managed with [this package](https://github.com/ottoyiu/django-cors-headers/)."}}