BasicAuthentication: ============= This Authentication model only allows already logged in users to access the Rest API. To make a user as logged user, the application has to send a login page on to the Browser to accept Username and Password. The application has to verify the credentials , if they are valid then it should make that user has a logged in user as well as it sholud redirect the user to access the REST API. If credentials are not valid then the application has to re send loggin form again to access the Username and password . Note: Session Authentication ===== ===== =========== If we are using Session Authentication then we need to develop user defined Login page. After providing the credentials we need to get those values and validating those values. Session Authentication flow: ======= ========== === 1 ) http://127.0.0.1:8877/auth/ ------>> def login_form(request):------->>> login.html opens.....uname and pwd providing......submit...------>>> def login_user (request):-----checks valid or not. ---- if not valid send same login.html.... if valid send to api accesss link...---->>> call model view.... get output.. API Testing from "POSTMAN" ways. ======= = ========== step1 ) GET ------>>> http://127.0.0.1:7766/api/emp_viewset/ Select "Authorization" ----->>> select Type as "Basic Auth" ------>> Provide Username and Password ---> click "Send" button. ------->>> You are getting status code as "200 Ok" and Output also. step2 ) POST ------>>http://127.0.0.1:7766/api/emp_viewset/ Select "Authorization" ----->>> select Type as "Basic Auth" ------>> Provide Username and Password click on "Body" ---->> click on "raw" radio button ---->>> select JSON(application/json) in Body section provide your object ------->> click on "Send" button. You will get output and status code as "201 created". step3 : PUT ------>>>http://127.0.0.1:7766/api/emp_viewset/70/ Select "Authorization" ----->>> select Type as "Basic Auth" ------>> Provide Username and Password click on "Body" ---->> click on "raw" radio button ---->>> select JSON(application/json) in Body section provide your updated object ------->> click on "Send" button. You will get output and status code as "200 ok". step4 : DELETE ---->>> http://127.0.0.1:7766/api/emp_viewset/70/ Select "Authorization" ----->>> select Type as "Basic Auth" ------>> Provide Username and Password click on "send" button ----->> selected object deleted successfully and returns status code as "204 No content" step5 : DELETE ---->>> http://127.0.0.1:7766/api/emp_viewset/70/ Select "Authorization" ----->>> select Type as "Basic Auth" ------>> Provide Username and Password click on "send" button. ---->>> Then you will get "404 Not Found" ...... {'detail' : 'not found'}