move logic from django template engine to angular