Cors header 'access-control-allow-origin' (Django-cors-headers).Restframework project tutorial[15]

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
poor it is welcome back so in this one I want us to start talking about chords defining a cause policy for your web server so basically power stands for cross-origin resource sharing and it's basically a way that you can restrict access to your web server so you can define like rules to how your web server is exists by who so same way you can decide to not allow different computers access your web server so we do that by defining a cooperation so in Django we have different ways to hundred this you can decide to go write your own code and make sure everything is good but one of the easiest way to get started with it is this majek old jungle coils header so the way it works is basically you need to in stories which I think we're which we are going to do I'm also going to check out another branch we checked out - be let's say prepare deploy okay so here I'm actually I need to check out my latest code so I need to replace it so to replace origin/master okay so let's make sure I am up-to-date and now we can go to our terminal and install jungle quads headers okay so looking here we need to add this installed app section so if we go to our settings app UI which is here installed apps right here so we need to add it there make sure it's there and then the next thing we need to do is in the middle we have the coils middle so if we go to middle I'm going to search here you need to make sure we have those two so I'm going to bring this one here and now notice that you can actually define a whitelist and the way this basically will be a list of IP addresses that you would want to connect your web server so we need to find a whitelist it restricts access to your web server to only the domains you list so it's going to depend on your user case and they need for you for your web server but for us since this is for for running purposes and we really don't have a lot on a server to restrict to everyone so I'm going to use this cause original owl which will allow everyone to connect to our web server so anywhere in the settings @py let's say here you can define that and then set it to true then what that will do is it will allow everyone to connect to the web server all right so for us that's what we are going to need to do to enable coils with the application so if you have a different kind of need feel free to check out this documentation I'm sure you'll find something that's can work for you use case so if this video is helpful consider giving it a thumbs up subscribe position and I'll see you in the next one bye
Info
Channel: Cryce Truly
Views: 15,543
Rating: undefined out of 5
Keywords:
Id: q3HQyAObaac
Channel Id: undefined
Length: 3min 10sec (190 seconds)
Published: Wed Jun 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.