I've built a REST API and I'm following along with this tutorial: https://www.youtube.com/watch?v=hISSGMafzvU&t=14s
I've completed all up until 13minutes. addition of a JS script into the html template. When I run and check the console I get: "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:8000/api/task-list/. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing)."
I have no idea what part of my projects the CORS header goes into?
<script type="text/javascript">
buildList()
function buildList(){
var wrapper = document.getElementById('list-wrapper')
var url = 'http://127.0.0.1:8000/api/task-list/'
fetch(url)
.then((resp) => resp.json())
.then(function(data){
console.log('Data:', data)
})
}
</script>