Placed code into proper django template blocks.