I have created a backend using Django REST and for handling API's at frontend I am using Angular (I have just started using angular).
I have one initial page let say User Profile Page So If user is authenticated I wants to show His profile on that initial page. All Authentication related thing is handled in API's So I am just getting response and redirection to profile page or login page is handled via Django.
I can get user related data in django and render that to HTMl page but in that case Angular functions cannot serve this django data.
So what will be the best way that whenever this profile page url is loaded an API call will be made that will fetch user data and angular can show that data in template and will be able to use it further ?
EDIT
let say you open this url -> /user-profile/ which refer to below View
class HomeView(TokenRequiredMixin, TemplateView):
"""
"""
template_name = 'portal/index.html'
mixin_failed_url = reverse_lazy('login-view')
It basically render to profile apge , here in this view I can fetch the user data and show them on HTML but angular will not be serve in this case.
One way to do this call any angular function using ng-init and load user data that will server the angular issue but its not the best way to do I guess.