How to use angular service within another service

Actually it is easy! import { Injectable, Inject } from ‘@angular/core’; import { LoginService } from ‘../common/login.service’; @Injectable() export class PermissionService { constructor(@Inject(LoginService) private login_service: LoginService) { } hasCategoryDeletePerm(){ const u = this.login_service.getUser() return u.is_staff; } }

Configuring django for centralised log monitoring with ELK stack with custom logging option (eg. client ip, username, request & response data)

When you are lucky enough to have enough users that you decide to roll another cloud instance for your django app, logging becomes a little bit tough because in your architecture now you would be needing a load balancer which will be proxying request from […]

Dealing with mandatory ForiegnkeyField for fields that is not in django rest framework serializers

Although I am big fan of django rest framework but sometime i feel it is gruesome to deal with nested serializers (Maybe I am doing something wrong, feel free to suggest me your favourite trick.) Suppose we have two models, ASerializer is based on A […]

A Django Rest Framework Jwt middleware to support request.user

I am using following Django (2.0.1), djangorestframework (3.7.7), djangorestframework-jwt (1.11.0) on top of python 3.6.3. By default djangorestframework-jwt does not include users in django’s usual requst.user. If you are using code>djangorestframework, chances are you have a huge code base at API which is leveraging this, […]