cross-domain

Getting the request origin in a Django request

Getting the request origin in a Django request Question: So I’m trying to enable cross origin resource sharing in Django, so I can post to an external site, and it’s easy to do when I set response[“Access-Control-Allow-Origin”]=”*” but I want to instead have it check whether the origin is in an allowed list of origins …

Total answers: 7

CORS error on same domain?

CORS error on same domain? Question: I’m running into a weird CORS issue right now. Here’s the error message: XMLHttpRequest cannot load http://localhost:8666/routeREST/select?q=[…] Origin http://localhost:8080 is not allowed by Access-Control-Allow-Origin Two servers: localhost:8666/routeREST/ : this is a simple Python Bottle server. localhost:8080/ : Python simpleHTTPserver where I run y Javascript application. This app is executing …

Total answers: 2

Can I set a header with python's SimpleHTTPServer?

Can I set a header with python's SimpleHTTPServer? Question: I’m using SimpleHTTPServer to test some webpages I’m working on. It works great, however I need to do some cross-domain requests. That requires setting a Access-Control-Allow-Origin header with the domains the page is allowed to access. Is there an easy way to set a header with …

Total answers: 4

How do you call Python code from C code?

How do you call Python code from C code? Question: I want to extend a large C project with some new functionality, but I really want to write it in Python. Basically, I want to call Python code from C code. However, Python->C wrappers like SWIG allow for the OPPOSITE, that is writing C modules …

Total answers: 9