I have a django server running on Linode, I'm trying to make a POST request but all I get is detail:"Authentication credentials were not provided."
I already made my research and whenever I have the server in production, (port 80), it doesn't work, as soon as I make ./manage.py runserver 0.0.0.0:8000
it works, when I point my fetch to that URL.
fetch(URL,
method ='POST',
headers = {
'Authorization': `Token ${this.props.token}` ,
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body= JSON.stringify( {
user: 10,
voltage_coil_1: 1,
voltage_coil_2: 1,
voltage_generated_by_user: 1,
activity:1,
datetime:null
})
)
.then(res => res.json())
.then(console.log)
My expected results are a positive answer, but whenever I'm in production, I keep getting this error.