12. Adding Django CORS headers

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
yeah as you have seen we got uh the course error on the front side and that means that we need to add jungle course headers and update the settings and allow i'm going to allow all because i don't want to water with the settings anymore and that's why let's just quickly install jungle course headers into our pip install jungle course headers and doors of course we'll just uh yeah um pip pip phrase uh requirement three requirements dot txt uh let's see if it's added or not yes course headers and let's just quickly read uh read the documentation here so they say that we need to add it to the course headers installed apps that means we need to go to the config settings uh where the installed apps here also uh we need to add the middleware so this yeah common middleware course manual we are the middle common with the where course middlebury is going to be here and um and then then a course allow origins to be equal to all that means two to equal to two let's just quickly fire up our run server nice and let's just go back to our front end and let's check if if it will work for now or not and i'm going to sign up something happened internal server arrow from the back inside nice let's just quickly see again this user's username uh error with our oh gosh with our database site i don't know why we why we get those narrows okay let's just run my migrations make migrations all nothing changed i'm going to remove this oops uh remove this light and this mic or rations folder i'm going to explicitly create the user's migrations and then migrate nice and then once again i'm going to check let's focus now we have what happened response headers um nice we didn't fire up our development server let's just quickly check again sign up oops it should ah nice we are able to sign up uh with our users so let's just console it and this is uh where what is returned from the back inside i'm scrolling it and zooming it and the data is the first name and last name email and sent but returned like as is created right the status is created that means that um in fact the user is created so let's just quickly check it um if we can log in um log in with that a user something wrong something wrong something wrong ah the correct in my password for his tough account ah this is the first step i come from my bad mind so i need to create a the super user as i have smashed out my uh my my user so where is um it's a wealthbean activate there's no oh gosh yeah source source when the inactive wait and go through the back end it should be managed by this manage manage by um create super user this is my email and this is um yeah what was the password all right i'm going to set the password so again this unit constrained error for users username like preventing me doing this this stuff uh let me just fix it at all and come back here but still i'm pretty sure that we were able to register from the from the front-end side yeah see you in the next video where all stuff will be fixed and we are going to implement the login view and do the login integration with the phone inside bye
Info
Channel: Dev Internals
Views: 7,200
Rating: undefined out of 5
Keywords: django cors headers, nuxtjs cors error
Id: gbu3pFkoOM0
Channel Id: undefined
Length: 6min 37sec (397 seconds)
Published: Sat Apr 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.