django front refactoring