I am using Angular 2 as my front-end and Django Rest Framework on the backend to build a webapp.
I have set up a basic Angular 2 app that pulls data from my Django Rest Framework backend. The Django Rest Framework backend has the 'api-auth' url configured for logging in with the browsable API (see here for what I mean), but I am now running into trouble trying to log in from my Angular 2 app.
From what I can tell the best practice is to use JSON Web Tokens (JWT).
I have looked at almost all readily available tutorials/blog posts online but cannot seem to find a clear answer that sums up what I need to do on the backend (Django) and frontent (Angular 2). Anyone able to explain at a high level how to login to a Django Rest Framework backend from an Angular 2 front-end?
I'm specifically thinking about a "login" function that would sit in an ".service.ts" file in the Angular 2 app that would make a post request to some url ".../login". See the login() function in this blog to get a sense for what I mean. I was going off that example but it's not giving me the full picture of how to create the connection between the frontend & backend.