I am trying to use the overpass API http://wiki.openstreetmap.org/wiki/Overpass_API with JavaScript XMLHttpRequest in a project running on Django, but I keep getting further
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://www.google.com/accounts/ClientLogin. (Reason: CORS header 'Access-Control-Allow-Origin' missing).
error. I get this error regardless of whether I use GET or POST, as well as from any other host, and not just the transition APIs.
I installed django-cors-headers https://github.com/ottoyiu/django-cors-headers and followed the instructions there by setting the corsherists in INSTALLED_APPS and the corsheads .middleware.CorsMiddleware ',' django.middleware.common. CommonMiddleware 'in MIDDLEWARE_APPS and I set
CORS_ORIGIN_ALLOW_ALL = true
in settings.py but nothing works. I run it locally with
python manage.py runserver
but I also accept it in openhift. In neither of these works do they both give the error above.
Please let me know if I am not missing anything here.
source share