Hi,
We have a DRF backend API and two front-end applications: a CRUD and a report server. Currently, we have issue with CORS:
These are the domains:
sever.com:8098 == >backend
and front ends:
crud.com
reporter.com
==
backend settings.py is: -
-
DEBUG = False
-
-
-
ALLOWED_HOSTS = ['crud.com', 'reporter.com',]
-
-
CORS_ORIGIN_ALLOW_ALL = False # dont want that.
-
-
CORS_ALLOW_CREDENTIALS = False # we use no cookies
-
-
CORS_ORIGIN_WHITELIST = (
-
-
'reporter.com',
-
'crud.com',
-
-
)
-
-
CORS_ALLOW_METHODS = (
-
'DELETE',
-
'GET',
-
'OPTIONS',
-
'PATCH',
-
'POST',
-
'PUT',
-
)
-
-
-
CSRF_TRUSTED_ORIGINS = (
-
'crud.com',
-
'reporter.com'
-
-
)
-
-
CORS_ALLOW_HEADERS = (
-
'accept',
-
'accept-encoding',
-
'authorization',
-
'content-type',
-
'dnt',
-
'origin',
-
'user-agent',
-
'language',
-
'x-requested-with',
-
)
But I still get CORS blocked error. What am I missing? Note that I have custom header but the front-end submits it successfully so not sure where it lies.
0 2205 Sign in to post your reply or Sign up for a free account.
Similar topics
by: knguyen |
last post by:
Hi,
For some reason, httplib request() method splits the request packet
into two packets, the first packet contains only HTTP headers, the body
in the second packet. The first packet size is way...
|
by: turnit \(removethis\) |
last post by:
I have a login form that uses the post method to carry the
information to the next page. The form works just fine in
ie6.0, but fails in mozilla and fails in ie5.2 on a
mac. "HTTP/1.1 400 Bad...
|
by: Sean Dotson |
last post by:
I have a form that passes variables to an asp file and then uploads a file.
For some reason the request.form is not getting the info from the form.
It's returning blanks. Any insight would be...
|
by: norton |
last post by:
Hi all.
I have a question in using Request and Request.Form
when the asp page is Request("txtName")
i can use "testpage.aspx?txtName=User1" to post the value
but when i use...
|
by: GarciaPL |
last post by:
Hi,
I have this well-known issue with Access-Control-Allow-Origin in my Spring application. I use cross-domain request to read data from built in MongoDB database REST interface (for example :...
|
by: tdrsam |
last post by:
I'm trying to set a list of two items that open separate modal dialogs in a node.js app. I'm using Jade.
Here's the Jade:
button.login-button(type='button' ng-app='ng-modal') Login
ul
...
|
by: samvb |
last post by:
Hey Fellas,
I am seriously in despair. I have a CI driven app in domaina.com. I need to send cross domain request to a SINGLE controller in it from domainb.com. It will be an ajax call using POST...
|
by: khaledbelal |
last post by:
When i post form angular form to API Laravel i get error 500 (Internal Server Error) in console .... why?
Note: Backend API is working perfectly with POSTMAN.
My Cors.php in Laravel is:
...
|
by: Palaksinghla |
last post by:
Angular, is the most popular javascript framework. The self proclaimed Super heroic framework is gaining a lot of traction from professionals over the globe.
With features like less coding and...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |