N
N
Neoliz2015-12-12 16:01:14
JavaScript
Neoliz, 2015-12-12 16:01:14

How to correctly send a request from outside to django?

Good evening! Tell me please. I broke my whole head, rummaged through the whole Google. All I could find is that you need to ADD CROS to both the request and the response.
The point is the following. There is a site on a domain on a host somewhere. There is a site on another domain on the server.
Django service is running on the server.
And here I am from the site on the host, I need to send an ajax request to django on the server, and accept the response.
Help how to do it? The code is desirable, the simplest option

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem Klimenko, 2015-12-12
@aklim007

https://stackoverflow.com/questions/3506208/jquery...
enable-cors.org

  • if you just need to receive data, jsonp is enough for you
  • cors is better, but here you have to consider whether you are counting on old IE.
  • and actually another option: from the host page, you access the page of the host itself, which will already proxy the request to the server and return the result.

V
Vladimir, 2015-12-13
@vintello

look at this project.
TYTS . Used on two projects, the result is excellent.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question